Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ContentBrowserSortingBarComponent.c
Go to the documentation of this file.
2{
3
4 [Attribute()]
5 bool m_bDefaultSelected = true;
6
7 SCR_ButtonImageComponent m_CurrentSelection;
8 protected int m_iCurrentIndex;
9 protected ref array<SCR_ButtonImageComponent> m_aButtons = new array<SCR_ButtonImageComponent>();
10
12
13 override void HandlerAttached(Widget w)
14 {
15 super.HandlerAttached(w);
16 m_iCurrentIndex = m_aButtons.Count() - 1;
17 m_CurrentSelection = m_aButtons[m_iCurrentIndex];
18
19 m_aButtons[m_iCurrentIndex].SetToggled(true, false, false);
20 }
21
22
23 protected override void ListenToSelectables(notnull array<Widget> aWidgets)
24 {
25 foreach (Widget w : aWidgets)
26 {
28 if (!comp)
29 return;
30 m_aButtons.Insert(comp);
31 comp.m_OnToggled.Insert(OnSorting);
32 //Print("attach listener");
33 }
34 }
35
37 {
38 return m_iCurrentIndex;
39 }
40
41 protected void OnSorting(SCR_ButtonImageComponent comp, bool isSelected)
42 {
43 int index = -1;
44 if (isSelected)
45 {
46 if (m_CurrentSelection)
47 m_CurrentSelection.SetToggled(false, true, false);
48 m_CurrentSelection = comp;
49 index = m_aButtons.Find(comp);
51 }
52 else
53 {
54 m_CurrentSelection.SetToggled(true, false, false);
55 return;
56 }
57
59
60 }
61};
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
override void ListenToSelectables(notnull array< Widget > aWidgets)
ref array< SCR_ButtonImageComponent > m_aButtons
void OnSorting(SCR_ButtonImageComponent comp, bool isSelected)
SCR_FieldOfViewSettings Attribute
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134