Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ConfigListComponent.c
Go to the documentation of this file.
1 
5 class SCR_ConfigListComponent : ScriptedWidgetComponent
6 {
7  [Attribute("VerticalLayout")]
8  protected string m_sListParent;
9 
10  [Attribute()]
11  protected ref array<ref SCR_WidgetListEntry> m_aInitialEntryList;
12 
13  protected Widget m_Root;
14  protected ScrollLayoutWidget m_wScrollWidget;
15  protected VerticalLayoutWidget m_wList;
16 
17  //-------------------------------------------------------------------------------------------
18  // Overridden widget api
19  //-------------------------------------------------------------------------------------------
20 
21  //-------------------------------------------------------------------------------------------
22  override void HandlerAttached(Widget w)
23  {
24  m_Root = w;
25 
26  m_wList = VerticalLayoutWidget.Cast(w.FindAnyWidget(m_sListParent));
27  if (!m_wList)
28  m_wList = VerticalLayoutWidget.Cast(w);
29 
30  for (int i = 0, count = m_aInitialEntryList.Count(); i < count; i++)
31  {
32  m_aInitialEntryList[i].CreateWidget(m_wList);
33  }
34  }
35 
36  //-------------------------------------------------------------------------------------------
37  // API
38  //-------------------------------------------------------------------------------------------
39 
40  //-------------------------------------------------------------------------------------------
41  array<ref SCR_WidgetListEntry> GetInitialEntryList()
42  {
43  return m_aInitialEntryList;
44  }
45 
46  //-------------------------------------------------------------------------------------------
48  protected SCR_WidgetListEntry FindEntry(string propertyName, string groupTag = "")
49  {
50  for (int i = 0, count = m_aInitialEntryList.Count(); i < count; i++)
51  {
52  if (groupTag == "")
53  {
54  // Has given property name
55  if (m_aInitialEntryList[i].GetPropertyName() == propertyName)
56  return m_aInitialEntryList[i];
57  }
58  else
59  {
60  // Has propery and group
61  if (m_aInitialEntryList[i].GetPropertyName() == propertyName && m_aInitialEntryList[i].GetGroupTag() == groupTag)
62  return m_aInitialEntryList[i];
63  }
64  }
65 
66  return null;
67  }
68 
69  //-------------------------------------------------------------------------------------------
73  Widget GetInvalidEntry()
74  {
75  // Go through entries list
76  for (int i = 0, count = m_aInitialEntryList.Count(); i < count; i++)
77  {
78  if (!m_aInitialEntryList[i].CheckValidity())
79  {
80  // Invalid entry widget
81  return m_aInitialEntryList[i].GetEntryRoot();
82  }
83  }
84 
85  // Is valid
86  return null;
87  }
88 };
SCR_ConfigListComponent
Definition: SCR_ConfigListComponent.c:5
m_Root
SCR_ServerHostingModSubMenu m_Root
CheckValidity
override bool CheckValidity()
Definition: SCR_WidgetListEntry.c:12
m_wList
protected Widget m_wList
Definition: SCR_DownloadManagerListComponent.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_WidgetListEntry
Configurable class for widget.
Definition: SCR_WidgetListEntry.c:115