Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FieldManualConfigCategory.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot: true), SCR_BaseContainerLocalizedTitleField("m_sTitle", "Category: %1")]
3 {
4  [Attribute(defvalue: "1")]
5  bool m_bEnabled;
6 
7  [Attribute(uiwidget: UIWidgets.LocaleEditBox)]
8  string m_sTitle;
9 
10  [Attribute(uiwidget: UIWidgets.Auto, desc: "Field Manual sub-categories")]
11  ref array<ref SCR_FieldManualConfigCategory> m_aCategories;
12 
13  [Attribute()]
14  ref array<ref SCR_FieldManualConfigEntry> m_aEntries;
15 
16  [Attribute(defvalue: "{0D3AF0CFA1D1F9A6}UI/layouts/Menus/FieldManual/MenuParts/FieldManual_MenuCategory.layout", uiwidget: UIWidgets.EditBoxWithButton, params: "layout")]
17  ResourceName m_CategoryLayout;
18 
19  [Attribute(defvalue: "{A316FF2475A5ADAB}UI/layouts/Menus/FieldManual/MenuParts/FieldManual_MenuSubCategory.layout", uiwidget: UIWidgets.EditBoxWithButton, params: "layout")]
20  ResourceName m_SubCategoryLayout;
21 
22  SCR_FieldManualConfigCategory m_Parent; // no strong ref: if the parent dies, he dies
23 
24  //------------------------------------------------------------------------------------------------
25  // constructor
27  {
28  if (!m_aCategories) // can be config-provided
29  {
30  m_aCategories = {};
31  }
32 
33  if (!m_aEntries) // can be config-provided
34  {
35  m_aEntries = {};
36  }
37  }
38 
39  //------------------------------------------------------------------------------------------------
43  Widget CreateWidget(notnull Widget parent)
44  {
45  if (m_aCategories.Count() > 0)
46  {
47  return CreateMainCategory(parent);
48  }
49  else
50  {
51  return CreateSubCategory(parent);
52  }
53  }
54 
55  //------------------------------------------------------------------------------------------------
56  protected Widget CreateMainCategory(notnull Widget parent)
57  {
58  Widget createdWidget = GetGame().GetWorkspace().CreateWidgets(m_CategoryLayout, parent);
59  if (!createdWidget)
60  return null;
61 
62  Widget widget = createdWidget.FindAnyWidget("Title");
63  if (widget != null)
64  {
65  TextWidget titleWidget = TextWidget.Cast(widget);
66  if (titleWidget)
67  titleWidget.SetText(m_sTitle);
68  }
69 
70  return createdWidget;
71  }
72 
73  //------------------------------------------------------------------------------------------------
74  protected Widget CreateSubCategory(notnull Widget parent)
75  {
76  Widget createdWidget = GetGame().GetWorkspace().CreateWidgets(m_SubCategoryLayout, parent);
77  if (!createdWidget)
78  return null;
79 
80  SCR_ButtonTextComponent buttonTextComponent = SCR_ButtonTextComponent.Cast(createdWidget.FindHandler(SCR_ButtonTextComponent));
81  if (buttonTextComponent != null)
82  buttonTextComponent.SetText(m_sTitle);
83 
84  return createdWidget;
85  }
86 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseContainerLocalizedTitleField
SCR_TabViewComponent SCR_ScriptedWidgetComponent SCR_BaseContainerLocalizedTitleField("m_sTabButtonContent")
Definition: SCR_TabViewComponent.c:963
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
m_aEntries
protected ref array< ref SCR_TextsTaskManagerEntry > m_aEntries
Definition: SCR_TextsTaskManagerComponent.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ButtonTextComponent
Definition: SCR_ButtonTextComponent.c:2
SCR_FieldManualConfigCategory
Definition: SCR_FieldManualConfigCategory.c:2
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
m_aCategories
protected ref array< ref SCR_DownloadManagerListCategory > m_aCategories
Definition: SCR_DownloadManagerListComponent.c:9
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468