Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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 //------------------------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------------------------
76 {
77 return m_bCanRefresh;
78 }
79}
EFieldManualEntryId
used to grab the first id-matching Field Manual entry
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI layouts Menus CleanSweep CleanSweepAreaSelection layout
SCR_PlayerCommandingConfigActionPair Managed SCR_BaseContainerLocalizedTitleField("m_sCommandName")
bool CanRefresh()
Widget CreateWidgetFromLayout(ResourceName layout, notnull Widget parent)
bool m_bCanRefresh
void SCR_FieldManualConfigEntry()
Widget CreateWidget(notnull Widget parent)
To be overridden by child classes to call CreateWidgetFromLayout.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute