Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorContentBrowserStateData.c
Go to the documentation of this file.
1 
6 {
7  [Attribute(desc: "List of labels that are saved", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EEditableEntityLabel))]
8  protected ref array<EEditableEntityLabel> m_iSavedLabels;
9 
10  [Attribute(desc: "Index that is set when loaded.")]
11  protected int m_iPageIndex = 0;
12 
13  [Attribute(desc: "Search string that is set when state is loaded")]
14  protected string m_sSearchString;
15 
20  int GetSavedLabelCount()
21  {
22  return m_iSavedLabels.Count();
23  }
24 
30  void SetLabels(notnull array<EEditableEntityLabel> savedLabels, bool checkForInvalid = false)
31  {
32  //~ Create list
33  if (!m_iSavedLabels)
34  m_iSavedLabels = new array<EEditableEntityLabel>;
35  else
36  m_iSavedLabels.Clear();
37 
38  array<EEditableEntityLabel> validLabels = {};
39 
40  if (checkForInvalid)
41  SCR_Enum.GetEnumValues(EEditableEntityLabel, validLabels);
42 
43  foreach (EEditableEntityLabel label: savedLabels)
44  {
45  //~ Check if invalid in cause the enums changed or a mod was changed
46  if (checkForInvalid && !validLabels.Contains(label))
47  continue;
48 
49  m_iSavedLabels.Insert(label);
50  }
51  }
52 
58  void AddRemoveLabel(EEditableEntityLabel label, bool addLabel)
59  {
60  if (addLabel)
61  {
62  if (m_iSavedLabels.Contains(label))
63  return;
64 
65  m_iSavedLabels.Insert(label);
66  }
67  else
68  {
69  int count = m_iSavedLabels.Count();
70 
71  for(int i = 0; i < count; i++)
72  {
73  if (m_iSavedLabels[i] == label)
74  {
75  m_iSavedLabels.RemoveOrdered(i);
76  return;
77  }
78  }
79  }
80 
81  }
82 
88  int GetLabels(out notnull array<EEditableEntityLabel> labels)
89  {
90  if (m_iSavedLabels)
91  labels.Copy(m_iSavedLabels);
92  else
93  return 0;
94 
95  return labels.Count();
96  }
97 
102  bool ContainsLabel(EEditableEntityLabel label)
103  {
104  return m_iSavedLabels.Contains(label);
105  }
106 
111  void SetPageIndex(int pageIndex)
112  {
113  m_iPageIndex = pageIndex;
114  }
115 
120  int GetPageIndex()
121  {
122  return m_iPageIndex;
123  }
124 
129  void SetSearchString(string searchString)
130  {
131  m_sSearchString = searchString;
132  }
133 
134 
139  string GetSearchString()
140  {
141  return m_sSearchString;
142  }
143 
148  bool HasSearchSaved()
149  {
150  return !m_sSearchString.IsEmpty();
151  }
152 }
EEditableEntityLabel
EEditableEntityLabel
Definition: EEditableEntityLabel.c:1
SCR_Enum
Definition: SCR_Enum.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditorContentBrowserSaveStateData
Definition: SCR_EditorContentBrowserStateData.c:5