Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorContentBrowserDisplayConfig.c
Go to the documentation of this file.
1 
4 [BaseContainerProps(configRoot: true)]
6 {
7  [Attribute(desc: "Sets the header of the content browser. Leaving this empty keeps the default header.", UIWidgets.LocaleEditBox)]
8  protected LocalizedString m_sContentBrowserHeader;
9 
10  [Attribute(desc: "List of Label groups that can be shown in the Content browser. If not empty then only these groups can be shown, If empty all groups can be shown.")]
11  protected ref array<ref SCR_EditorContentBrowserDisplayGroupLabel> m_aWhiteListLabelGroups;
12 
13  [Attribute(desc: "List of labels that are active when the content browser is opened and can never be removed (These labels will never be shown and cannot be disabled).")]
14  protected ref array<ref SCR_EditorContentBrowserActiveDisplayLabel> m_aAlwaysActiveLabels;
15 
16  [Attribute(desc: "List of Labels that can be shown in the Content browser. If not empty then only these lables can be shown, If empty all labels can be shown. (Unless always active label hides it)")]
17  protected ref array<ref SCR_EditorContentBrowserDisplayLabel> m_aWhiteListLabels;
18 
19  [Attribute(desc: "Should the browser opened with this config save it's state", defvalue: "1")]
20  protected bool m_bSaveContentBrowserState;
21 
26  LocalizedString GetHeader()
27  {
28  return m_sContentBrowserHeader;
29  }
30 
36  bool CanShowLabelGroup(EEditableEntityLabelGroup groupLabel)
37  {
38  //~ Search label is white list
39  if (!m_aWhiteListLabelGroups.IsEmpty())
40  {
41  bool groupLabelFound = false;
42 
43  foreach (SCR_EditorContentBrowserDisplayGroupLabel whiteGroupLabel: m_aWhiteListLabelGroups)
44  {
45  //~ Found group label in white list
46  if (whiteGroupLabel.GetGroupLabel() == groupLabel)
47  {
48  //~ Check if white label was actually enabled
49  if (whiteGroupLabel.GetEnabled())
50  groupLabelFound = true;
51 
52  break;
53  }
54  }
55 
56  //White label not found so return false
57  if (!groupLabelFound)
58  return false;
59  }
60 
61  return true;
62  }
63 
69  bool CanShowLabel(EEditableEntityLabel label)
70  {
71  //~ Search label is white list
72  if (!m_aWhiteListLabels.IsEmpty())
73  {
74  bool labelFound = false;
75 
76  foreach (SCR_EditorContentBrowserDisplayLabel whiteLabel: m_aWhiteListLabels)
77  {
78  //~ Found label in white list
79  if (whiteLabel.GetLabel() == label)
80  {
81  //~ Check if white label was actually enabled
82  if (whiteLabel.IsEnabled())
83  labelFound = true;
84 
85  break;
86  }
87  }
88  //White label not found so return false
89  if (!labelFound)
90  return false;
91  }
92 
93  //~ Is always active label so check if can be shown
94  if (!m_aAlwaysActiveLabels.IsEmpty())
95  {
96  foreach(SCR_EditorContentBrowserActiveDisplayLabel alwaysActiveLabel: m_aAlwaysActiveLabels)
97  {
98  if (alwaysActiveLabel.GetLabel() == label)
99  {
100  if (alwaysActiveLabel.IsEnabled() && !alwaysActiveLabel.m_bShowLabel)
101  return false;
102 
103  break;
104  }
105  }
106  }
107 
108  return true;
109  }
110 
115  void GetAlwaysActiveLabels(out notnull array<EEditableEntityLabel> alwaysActiveLabels)
116  {
117  foreach (SCR_EditorContentBrowserDisplayLabel label: m_aAlwaysActiveLabels)
118  alwaysActiveLabels.Insert(label.GetLabel());
119  }
120 
125  void GetWhiteListeLabels(out notnull array<EEditableEntityLabel> whitelistLabels)
126  {
127  foreach (SCR_EditorContentBrowserDisplayLabel label: m_aWhiteListLabels)
128  whitelistLabels.Insert(label.GetLabel());
129  }
130 
135  void GetWhiteListeLabelGroups(out notnull array<EEditableEntityLabelGroup> whitelistLabelGroups)
136  {
137  foreach (SCR_EditorContentBrowserDisplayGroupLabel label: m_aWhiteListLabelGroups)
138  whitelistLabelGroups.Insert(label.GetGroupLabel());
139  }
140 
146  bool IsAlwaysActiveLabel(EEditableEntityLabel label)
147  {
148  //~ No always active labels
149  if (m_aAlwaysActiveLabels.IsEmpty())
150  return false;
151 
152  foreach (SCR_EditorContentBrowserDisplayLabel alwaysActiveLabel: m_aAlwaysActiveLabels)
153  {
154  //~ Found label in alwaysActive List
155  if (alwaysActiveLabel.GetLabel() == label)
156  {
157  //~ Always active label is enabled so return true
158  if (alwaysActiveLabel.IsEnabled())
159  return true;
160 
161  break;
162  }
163  }
164 
165  //~ Always active label not found or was not enabled
166  return false;
167  }
168 
169 
175  bool CanShowLabelInActiveFilters(EEditableEntityLabel label)
176  {
177  SCR_EditorContentBrowserActiveDisplayLabel alwaysActiveLabelClass;
178 
179  foreach(SCR_EditorContentBrowserDisplayLabel alwaysActiveLabel: m_aAlwaysActiveLabels)
180  {
181  if (alwaysActiveLabel.GetLabel() != label)
182  continue;
183 
184  if (!alwaysActiveLabel.IsEnabled())
185  return true;
186 
187  alwaysActiveLabelClass = SCR_EditorContentBrowserActiveDisplayLabel.Cast(alwaysActiveLabel);
188  if (!alwaysActiveLabelClass)
189  return false;
190 
191  return alwaysActiveLabelClass.m_bShowLabel;
192  }
193 
194  return true;
195  }
196 
201  bool GetSaveContentBrowserState()
202  {
203  return m_bSaveContentBrowserState;
204  }
205 
214  void SCR_EditorContentBrowserDisplayConfig(array<EEditableEntityLabelGroup> whiteListGroupLabels = null, array<EEditableEntityLabel> whiteListLabels = null, array<EEditableEntityLabel> alwaysActiveLabels = null, bool saveContentBrowserState = false, LocalizedString browserHeader = string.Empty)
215  {
216  // Return when called with empty arguments
217  if (browserHeader.IsEmpty())
218  return;
219 
220  m_sContentBrowserHeader = browserHeader;
221 
222  m_aWhiteListLabelGroups = {};
223  //~ Create White list Group
224  if (whiteListGroupLabels)
225  {
226  foreach (EEditableEntityLabelGroup groupLabel: whiteListGroupLabels)
227  {
228  m_aWhiteListLabelGroups.Insert(new SCR_EditorContentBrowserDisplayGroupLabel(groupLabel));
229  }
230  }
231 
232  m_aWhiteListLabels = {};
233  //~ Create white list labels
234  if (whiteListLabels)
235  {
236  foreach (EEditableEntityLabel label: whiteListLabels)
237  {
238  m_aWhiteListLabels.Insert(new SCR_EditorContentBrowserDisplayLabel(label));
239  }
240  }
241 
242  m_aAlwaysActiveLabels = {};
243  //~ Create Always active labels
244  if (alwaysActiveLabels)
245  {
246  foreach(EEditableEntityLabel label: alwaysActiveLabels)
247  {
248  m_aAlwaysActiveLabels.Insert(new SCR_EditorContentBrowserActiveDisplayLabel(label));
249  }
250  }
251 
252  //~ If this config allows for saving of the Content Browser state. If this config is temporarly created then keep it false
253  m_bSaveContentBrowserState = saveContentBrowserState;
254  }
255 };
256 
259 {
260  [Attribute(uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EEditableEntityLabelGroup))]
261  protected EEditableEntityLabelGroup m_iGroupLabel;
262 
263  [Attribute("1", desc: "If false then this label group will be ignored in the list")]
264  protected bool m_bEnabled;
265 
270  EEditableEntityLabelGroup GetGroupLabel()
271  {
272  return m_iGroupLabel;
273  }
274 
279  bool GetEnabled()
280  {
281  return m_bEnabled;
282  }
283 
285  {
286  if (groupLabel == EEditableEntityLabelGroup.NONE)
287  return;
288 
289  m_iGroupLabel = groupLabel;
290  m_bEnabled = true;
291  }
292 };
293 
296 {
297  [Attribute(uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EEditableEntityLabel))]
298  protected EEditableEntityLabel m_iLabel;
299 
300  [Attribute("1", desc: "If false then this label will be ignored in the list")]
301  protected bool m_bEnabled;
302 
307  EEditableEntityLabel GetLabel()
308  {
309  return m_iLabel;
310  }
311 
316  bool IsEnabled()
317  {
318  return m_bEnabled;
319  }
320 
322  {
323  if (label == EEditableEntityLabel.NONE)
324  return;
325 
326  m_iLabel = label;
327  m_bEnabled = true;
328  }
329 };
330 
333 {
334  [Attribute("0", desc: "If false then this label will hidden in filters and will always be forced to be active (if enabled)")]
335  bool m_bShowLabel;
336 };
SCR_EditorContentBrowserActiveDisplayLabel
Definition: SCR_EditorContentBrowserDisplayConfig.c:332
EEditableEntityLabel
EEditableEntityLabel
Definition: EEditableEntityLabel.c:1
SCR_EditorContentBrowserDisplayLabel
Definition: SCR_EditorContentBrowserDisplayConfig.c:295
SCR_EditorContentBrowserDisplayConfig
Definition: SCR_EditorContentBrowserDisplayConfig.c:5
SCR_BaseContainerCustomTitleEnum
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
Definition: SCR_CampaignHintStorage.c:22
SCR_EditorContentBrowserDisplayGroupLabel
Definition: SCR_EditorContentBrowserDisplayConfig.c:258
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
EEditableEntityLabelGroup
EEditableEntityLabelGroup
Definition: EEditableEntityLabel.c:200
m_bEnabled
private bool m_bEnabled
Definition: SCR_BaseManualCameraComponent.c:3
LocalizedString
Definition: LocalizedString.c:21
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