Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RadialMenuPair.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
7{
8 protected ref array<Widget> m_aWidgets;
9 protected ref array<BaseSelectionMenuEntry> m_aEntries;
10 protected int m_iCount;
11
12 //------------------------------------------------------------------------------------------------
13 protected void RecalculateCount()
14 {
15 m_iCount = m_aWidgets.Count();
16 }
17
18 //------------------------------------------------------------------------------------------------
19 void Clear()
20 {
21 m_aWidgets.Clear();
22 m_aEntries.Clear();
23
25 }
26
27 //------------------------------------------------------------------------------------------------
28 int Count(bool recalculate = false)
29 {
30 if (recalculate)
32
33 return m_iCount;
34 }
35
36 //------------------------------------------------------------------------------------------------
37 void RemoveAt(int index)
38 {
40 return;
41
42 m_aWidgets.Remove(index);
43 m_aEntries.Remove(index);
44
46 }
47
48 //------------------------------------------------------------------------------------------------
50 {
51 if (pair == null)
52 return;
53
54 m_aWidgets.Insert(pair.m_pWidget);
55 m_aEntries.Insert(pair.m_pEntry);
56
58 }
59
60 //------------------------------------------------------------------------------------------------
62 {
63 ref auto pair = new SCR_RadialMenuPair(widget, entry);
64 AddEntry(pair);
65 }
66
67 //------------------------------------------------------------------------------------------------
69 {
70 if (widget == null)
71 return;
72
73 int index = m_aWidgets.Find(widget);
74 if (index == -1)
75 return;
76
78
80 }
81
82 //------------------------------------------------------------------------------------------------
84 {
85 if (entry == null)
86 return;
87
88 int index = m_aEntries.Find(entry);
89 if (index == -1)
90 return;
91
93
95 }
96
97 //------------------------------------------------------------------------------------------------
99 {
100 // Invalid index
102 return;
103
104 m_aEntries[index] = entry;
105 }
106
107 //------------------------------------------------------------------------------------------------
108 void SetWidgetAt(int index, Widget value)
109 {
110 // Invalid index
112 return;
113
114 m_aWidgets[index] = value;
115 }
116
117 //------------------------------------------------------------------------------------------------
119 {
120 // Invalid index
122 return null;
123
124 return m_aWidgets[index];
125 }
126
127 //------------------------------------------------------------------------------------------------
129 {
130 // Invalid index
132 return null;
133
134 return m_aEntries[index];
135 }
136
137 //------------------------------------------------------------------------------------------------
139 {
140 // Invalid index
142 return null;
143
144 ref auto pair = new SCR_RadialMenuPair(m_aWidgets[index], m_aEntries[index]);
145 return pair;
146 }
147
148 //------------------------------------------------------------------------------------------------
150 {
151 m_aWidgets = new array<Widget>();
152 m_aEntries = new array<BaseSelectionMenuEntry>();
153 }
154
155 //------------------------------------------------------------------------------------------------
157 {
158 m_aWidgets.Clear();
159 m_aEntries.Clear();
160
161 m_aWidgets = null;
162 m_aEntries = null;
163 }
164};
165
166//------------------------------------------------------------------------------------------------
170class SCR_RadialMenuPair
171{
172 Widget m_pWidget;
173 BaseSelectionMenuEntry m_pEntry;
174
175 //------------------------------------------------------------------------------------------------
176 bool IsEmpty()
177 {
178 return (!m_pWidget && !m_pEntry);
179 }
180
181 //------------------------------------------------------------------------------------------------
182 void SCR_RadialMenuPair(Widget widget, BaseSelectionMenuEntry entry)
183 {
184 m_pWidget = widget;
185 m_pEntry = entry;
186 }
187};
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void AddEntry(Widget widget, BaseSelectionMenuEntry entry)
void AddEntry(SCR_RadialMenuPair pair)
void RemoveByWidget(Widget widget)
void SetEntryAt(int index, BaseSelectionMenuEntry entry)
void RemoveByEntry(BaseSelectionMenuEntry entry)
ref SCR_RadialMenuPair GetAt(int index)
ref array< BaseSelectionMenuEntry > m_aEntries
BaseSelectionMenuEntry GetEntryAt(int index)
int Count(bool recalculate=false)
void SetWidgetAt(int index, Widget value)
proto native bool IsEmpty()