Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_RadialMenuPair.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
6
class
SCR_RadialMenuWidgetPairList
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
24
RecalculateCount
();
25
}
26
27
//------------------------------------------------------------------------------------------------
28
int
Count
(
bool
recalculate =
false
)
29
{
30
if
(recalculate)
31
RecalculateCount
();
32
33
return
m_iCount
;
34
}
35
36
//------------------------------------------------------------------------------------------------
37
void
RemoveAt
(
int
index
)
38
{
39
if
(
index < 0 || index >
=
m_iCount
)
40
return
;
41
42
m_aWidgets
.Remove(
index
);
43
m_aEntries
.Remove(
index
);
44
45
RecalculateCount
();
46
}
47
48
//------------------------------------------------------------------------------------------------
49
void
AddEntry
(
SCR_RadialMenuPair
pair)
50
{
51
if
(pair == null)
52
return
;
53
54
m_aWidgets
.Insert(pair.m_pWidget);
55
m_aEntries
.Insert(pair.m_pEntry);
56
57
RecalculateCount
();
58
}
59
60
//------------------------------------------------------------------------------------------------
61
void
AddEntry
(
Widget
widget,
BaseSelectionMenuEntry
entry)
62
{
63
ref
auto
pair =
new
SCR_RadialMenuPair
(widget, entry);
64
AddEntry
(pair);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
void
RemoveByWidget
(
Widget
widget)
69
{
70
if
(widget == null)
71
return
;
72
73
int
index
=
m_aWidgets
.Find(widget);
74
if
(
index
== -1)
75
return
;
76
77
RemoveAt
(
index
);
78
79
RecalculateCount
();
80
}
81
82
//------------------------------------------------------------------------------------------------
83
void
RemoveByEntry
(
BaseSelectionMenuEntry
entry)
84
{
85
if
(entry == null)
86
return
;
87
88
int
index
=
m_aEntries
.Find(entry);
89
if
(
index
== -1)
90
return
;
91
92
RemoveAt
(
index
);
93
94
RecalculateCount
();
95
}
96
97
//------------------------------------------------------------------------------------------------
98
void
SetEntryAt
(
int
index
,
BaseSelectionMenuEntry
entry)
99
{
100
// Invalid index
101
if
(
index < 0 || index >
=
m_iCount
)
102
return
;
103
104
m_aEntries
[
index
] = entry;
105
}
106
107
//------------------------------------------------------------------------------------------------
108
void
SetWidgetAt
(
int
index
,
Widget
value)
109
{
110
// Invalid index
111
if
(
index < 0 || index >
=
m_iCount
)
112
return
;
113
114
m_aWidgets
[
index
] = value;
115
}
116
117
//------------------------------------------------------------------------------------------------
118
Widget
GetWidgetAt
(
int
index
)
119
{
120
// Invalid index
121
if
(
index < 0 || index >
=
m_iCount
)
122
return
null;
123
124
return
m_aWidgets
[
index
];
125
}
126
127
//------------------------------------------------------------------------------------------------
128
BaseSelectionMenuEntry
GetEntryAt
(
int
index
)
129
{
130
// Invalid index
131
if
(
index < 0 || index >
=
m_iCount
)
132
return
null;
133
134
return
m_aEntries
[
index
];
135
}
136
137
//------------------------------------------------------------------------------------------------
138
ref
SCR_RadialMenuPair
GetAt
(
int
index
)
139
{
140
// Invalid index
141
if
(
index < 0 || index >
=
m_iCount
)
142
return
null;
143
144
ref
auto
pair =
new
SCR_RadialMenuPair
(
m_aWidgets
[
index
],
m_aEntries
[
index
]);
145
return
pair;
146
}
147
148
//------------------------------------------------------------------------------------------------
149
void
SCR_RadialMenuWidgetPairList
()
150
{
151
m_aWidgets
=
new
array<Widget>();
152
m_aEntries
=
new
array<BaseSelectionMenuEntry>();
153
}
154
155
//------------------------------------------------------------------------------------------------
156
void
~SCR_RadialMenuWidgetPairList
()
157
{
158
m_aWidgets
.Clear();
159
m_aEntries
.Clear();
160
161
m_aWidgets
= null;
162
m_aEntries
= null;
163
}
164
};
165
166
//------------------------------------------------------------------------------------------------
170
class
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
};
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
BaseSelectionMenuEntry
Definition
BaseSelectionMenuEntry.c:13
SCR_RadialMenuPair
Definition
SCR_RadialMenuPair.c:171
SCR_RadialMenuWidgetPairList::AddEntry
void AddEntry(Widget widget, BaseSelectionMenuEntry entry)
Definition
SCR_RadialMenuPair.c:61
SCR_RadialMenuWidgetPairList::AddEntry
void AddEntry(SCR_RadialMenuPair pair)
Definition
SCR_RadialMenuPair.c:49
SCR_RadialMenuWidgetPairList::RemoveByWidget
void RemoveByWidget(Widget widget)
Definition
SCR_RadialMenuPair.c:68
SCR_RadialMenuWidgetPairList::SetEntryAt
void SetEntryAt(int index, BaseSelectionMenuEntry entry)
Definition
SCR_RadialMenuPair.c:98
SCR_RadialMenuWidgetPairList::RemoveByEntry
void RemoveByEntry(BaseSelectionMenuEntry entry)
Definition
SCR_RadialMenuPair.c:83
SCR_RadialMenuWidgetPairList::RemoveAt
void RemoveAt(int index)
Definition
SCR_RadialMenuPair.c:37
SCR_RadialMenuWidgetPairList::GetWidgetAt
Widget GetWidgetAt(int index)
Definition
SCR_RadialMenuPair.c:118
SCR_RadialMenuWidgetPairList::SCR_RadialMenuWidgetPairList
void SCR_RadialMenuWidgetPairList()
Definition
SCR_RadialMenuPair.c:149
SCR_RadialMenuWidgetPairList::Clear
void Clear()
Definition
SCR_RadialMenuPair.c:19
SCR_RadialMenuWidgetPairList::GetAt
ref SCR_RadialMenuPair GetAt(int index)
Definition
SCR_RadialMenuPair.c:138
SCR_RadialMenuWidgetPairList::m_aWidgets
ref array< Widget > m_aWidgets
Definition
SCR_RadialMenuPair.c:8
SCR_RadialMenuWidgetPairList::m_aEntries
ref array< BaseSelectionMenuEntry > m_aEntries
Definition
SCR_RadialMenuPair.c:9
SCR_RadialMenuWidgetPairList::RecalculateCount
void RecalculateCount()
Definition
SCR_RadialMenuPair.c:13
SCR_RadialMenuWidgetPairList::m_iCount
int m_iCount
Definition
SCR_RadialMenuPair.c:10
SCR_RadialMenuWidgetPairList::GetEntryAt
BaseSelectionMenuEntry GetEntryAt(int index)
Definition
SCR_RadialMenuPair.c:128
SCR_RadialMenuWidgetPairList::Count
int Count(bool recalculate=false)
Definition
SCR_RadialMenuPair.c:28
SCR_RadialMenuWidgetPairList::~SCR_RadialMenuWidgetPairList
void ~SCR_RadialMenuWidgetPairList()
Definition
SCR_RadialMenuPair.c:156
SCR_RadialMenuWidgetPairList::SetWidgetAt
void SetWidgetAt(int index, Widget value)
Definition
SCR_RadialMenuPair.c:108
Widget
Definition
Widget.c:13
IsEmpty
proto native bool IsEmpty()
scripts
Game
UI
HUD
SelectionMenu
SCR_RadialMenuPair.c
Generated by
1.17.0