Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FieldManualConfigEntry.c
Go to the documentation of this file.
1 [BaseContainerProps(insertable: false), SCR_BaseContainerLocalizedTitleField("m_sTitle", "Do NOT use SCR_FieldManualConfigEntry class")]
3 {
4  [Attribute(defvalue: "1")]
5  bool m_bEnabled;
6 
7  [Attribute(defvalue: SCR_Enum.GetDefault(EFieldManualEntryId.NONE), uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EFieldManualEntryId))]
9 
10  [Attribute(uiwidget: UIWidgets.LocaleEditBox)]
11  string m_sTitle;
12 
13  [Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail, params: "edds")]
14  ResourceName m_Image; // m_s
15 
16  SCR_FieldManualConfigCategory m_Parent; // no strong ref: if the parent dies, he dies
17 
18  [Attribute()]
19  ref array<ref SCR_FieldManualPiece> m_aContent;
20 
21  protected bool m_bCanRefresh;
22 
23  //------------------------------------------------------------------------------------------------
24  // constructor
26  {
27  if (!m_aContent) // can be config-provided
28  m_aContent = {};
29  }
30 
31  //------------------------------------------------------------------------------------------------
33  Widget CreateWidget(notnull Widget parent);
34 
35  //------------------------------------------------------------------------------------------------
36  protected Widget CreateWidgetFromLayout(ResourceName layout, notnull Widget parent)
37  {
38  Widget createdWidget = GetGame().GetWorkspace().CreateWidgets(layout, parent);
39  if (!createdWidget)
40  {
41  Print(string.Format("could not create widget from layout \"%1\" | ", layout) + FilePath.StripPath(__FILE__) + ":" + __LINE__, LogLevel.WARNING);
42  return null;
43  }
44 
45  if (!m_aContent)
46  {
47  Print("no content found (null array) | " + FilePath.StripPath(__FILE__) + ":" + __LINE__, LogLevel.WARNING);
48  return createdWidget;
49  }
50 
51  Widget piecesLayout = SCR_WidgetHelper.GetWidgetOrChild(createdWidget, "piecesLayout");
52  if (!piecesLayout || !m_aContent)
53  {
54  Print("no pieces layout found | " + FilePath.StripPath(__FILE__) + ":" + __LINE__, LogLevel.WARNING);
55  return createdWidget;
56  }
57 
58  foreach (SCR_FieldManualPiece piece : m_aContent)
59  {
60  if (piece.CanCreateWidget())
61  {
62  piece.CreateWidget(piecesLayout);
63  if (!m_bCanRefresh)
64  m_bCanRefresh = piece.CanRefresh();
65  }
66  }
67 
68  return createdWidget;
69  }
70 
71  //------------------------------------------------------------------------------------------------
75  bool CanRefresh()
76  {
77  return m_bCanRefresh;
78  }
79 }
SCR_Enum
Definition: SCR_Enum.c:1
SCR_FieldManualPiece
Definition: SCR_FieldManualPiece.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseContainerLocalizedTitleField
SCR_TabViewComponent SCR_ScriptedWidgetComponent SCR_BaseContainerLocalizedTitleField("m_sTabButtonContent")
Definition: SCR_TabViewComponent.c:963
SCR_WidgetHelper
Definition: SCR_WidgetHelper.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_FieldManualConfigCategory
Definition: SCR_FieldManualConfigCategory.c:2
layout
UI layouts HUD CampaignMP CampaignMainHUD layout
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:20
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_FieldManualConfigEntry
Definition: SCR_FieldManualConfigEntry.c:2
EFieldManualEntryId
EFieldManualEntryId
used to grab the first id-matching Field Manual entry
Definition: EFieldManualEntryId.c:2
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