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_SelectionMenuEntry.c
Go to the documentation of this file.
1
4
5
//------------------------------------------------------------------------------------------------
6
[
BaseContainerProps
(configRoot:
true
),
SCR_BaseContainerCustomTitleUIInfo
(
"Name"
)]
7
class
SCR_SelectionMenuEntry
:
SCR_UIInfo
8
{
9
[
Attribute
(
desc
:
"Entry name used for searching and definition"
)]
10
protected
string
m_sId
;
11
12
[
Attribute
(
"1"
)]
13
protected
bool
m_bEnabled
;
14
15
[
Attribute
(
desc
:
"Action name use as input shortcut for entry"
)]
16
protected
string
m_sInputAction
;
17
18
[
Attribute
(
""
,
".layout"
,
desc
:
"By default menu has predefined layouts. Use only if specific layout for entry is needed"
)]
19
protected
ResourceName
m_sCustomLayout
;
20
21
protected
ref
SCR_SelectionMenuEntryComponent
m_EntryComponent
;
22
23
// Invokers
24
protected
ref
ScriptInvoker<SCR_SelectionMenuEntry>
m_OnPerform
;
25
protected
ref
ScriptInvoker<SCR_SelectionMenuEntry>
m_OnPerformFail
;
26
protected
ref
ScriptInvoker<SCR_SelectionMenuEntry, ResourceName, string>
m_OnIconChange
;
27
28
//------------------------------------------------------------------------------------------------
29
protected
void
InvokeOnPerform
()
30
{
31
if
(
m_OnPerform
)
32
m_OnPerform
.Invoke(
this
);
33
}
34
35
//------------------------------------------------------------------------------------------------
36
ScriptInvoker
GetOnPerform
()
37
{
38
if
(!
m_OnPerform
)
39
m_OnPerform
=
new
ScriptInvoker
();
40
41
return
m_OnPerform
;
42
}
43
44
//------------------------------------------------------------------------------------------------
45
protected
void
InvokeOnPerformFail
()
46
{
47
if
(
m_OnPerformFail
)
48
m_OnPerformFail
.Invoke(
this
);
49
}
50
51
//------------------------------------------------------------------------------------------------
52
ScriptInvoker
GetOnPerformFail
()
53
{
54
if
(!
m_OnPerformFail
)
55
m_OnPerformFail
=
new
ScriptInvoker
();
56
57
return
m_OnPerformFail
;
58
}
59
60
//------------------------------------------------------------------------------------------------
61
protected
void
InvokeOnIconChange
(
ResourceName
icon,
string
imageSetImage)
62
{
63
if
(
m_OnIconChange
)
64
m_OnIconChange
.Invoke(
this
, icon, imageSetImage);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
ScriptInvoker
GetOnIconChange
()
69
{
70
if
(!
m_OnIconChange
)
71
m_OnIconChange
=
new
ScriptInvoker
();
72
73
return
m_OnIconChange
;
74
}
75
76
//------------------------------------------------------------------------------------------------
77
// Custom methods
78
//------------------------------------------------------------------------------------------------
79
80
//------------------------------------------------------------------------------------------------
82
void
Update
()
83
{
84
}
85
86
//------------------------------------------------------------------------------------------------
89
void
Perform
()
90
{
91
// Check can be performed
92
if
(!
m_bEnabled
)
93
{
94
InvokeOnPerformFail
();
95
return
;
96
}
97
98
OnPerform
();
99
InvokeOnPerform
();
100
}
101
102
//------------------------------------------------------------------------------------------------
104
protected
void
OnPerform
()
105
{
106
}
107
108
//------------------------------------------------------------------------------------------------
109
void
Enable
(
bool
enable)
110
{
111
m_bEnabled
= enable;
112
113
if
(
m_EntryComponent
)
114
m_EntryComponent
.SetEnabled(enable);
115
}
116
117
//------------------------------------------------------------------------------------------------
118
// Callbacks
119
//------------------------------------------------------------------------------------------------
120
121
//------------------------------------------------------------------------------------------------
122
protected
void
OnEntryClick
(
SCR_SelectionMenuEntryComponent
entryComponent)
123
{
124
Perform
();
125
}
126
127
//------------------------------------------------------------------------------------------------
128
// Get set
129
//------------------------------------------------------------------------------------------------
130
131
//------------------------------------------------------------------------------------------------
132
void
SetId
(
string
id
)
133
{
134
m_sId
=
id
;
135
}
136
137
//------------------------------------------------------------------------------------------------
138
string
GetId
()
139
{
140
return
m_sId
;
141
}
142
143
//------------------------------------------------------------------------------------------------
144
void
SetName
(
string
name)
145
{
146
Name
= name;
147
}
148
149
//------------------------------------------------------------------------------------------------
150
void
SetDescription
(
string
description)
151
{
152
Description
= description;
153
}
154
155
//------------------------------------------------------------------------------------------------
157
void
SetIcon
(
ResourceName
iconPath,
string
imageSetName =
""
)
158
{
159
Icon
= iconPath;
160
IconSetName
= imageSetName;
161
162
InvokeOnIconChange
(
Icon
,
IconSetName
);
163
}
164
165
//------------------------------------------------------------------------------------------------
166
void
SetIconFromDeafaultImageSet
(
string
imageSetName =
""
)
167
{
168
Icon
=
UIConstants
.ICONS_IMAGE_SET;
169
IconSetName
= imageSetName;
170
171
InvokeOnIconChange
(
Icon
,
IconSetName
);
172
}
173
174
//------------------------------------------------------------------------------------------------
175
ResourceName
GetCustomLayout
()
176
{
177
return
m_sCustomLayout
;
178
}
179
180
//------------------------------------------------------------------------------------------------
181
void
SetCustomLayout
(
ResourceName
layout
)
182
{
183
m_sCustomLayout
=
layout
;
184
}
185
186
//------------------------------------------------------------------------------------------------
187
void
SetEntryComponent
(
SCR_SelectionMenuEntryComponent
entryComponent)
188
{
189
// Clear
190
if
(
m_EntryComponent
)
191
m_EntryComponent
.GetOnClick().Clear();
192
193
194
m_EntryComponent
= entryComponent;
195
196
// Setup invokers
197
if
(
m_EntryComponent
)
198
m_EntryComponent
.GetOnClick().Insert(
OnEntryClick
);
199
200
201
// Setup icons - TODO: probably can be moved to seperate component
202
SCR_SelectionMenuEntryIconComponent
iconEntry =
SCR_SelectionMenuEntryIconComponent
.Cast(entryComponent);
203
if
(iconEntry)
204
iconEntry.
SetImage
(
Icon
,
IconSetName
);
205
206
entryComponent.
SetEntry
(
this
);
207
}
208
209
//------------------------------------------------------------------------------------------------
210
SCR_SelectionMenuEntryComponent
GetEntryComponent
()
211
{
212
return
m_EntryComponent
;
213
}
214
215
//------------------------------------------------------------------------------------------------
216
bool
IsEnabled
()
217
{
218
return
m_bEnabled
;
219
}
220
221
//------------------------------------------------------------------------------------------------
222
void
SetInputAction
(
string
action)
223
{
224
m_sInputAction
= action;
225
}
226
227
//------------------------------------------------------------------------------------------------
228
string
GetInputAction
()
229
{
230
return
m_sInputAction
;
231
}
232
233
//------------------------------------------------------------------------------------------------
234
// Constructor
235
//------------------------------------------------------------------------------------------------
236
237
//------------------------------------------------------------------------------------------------
238
void
SCR_SelectionMenuEntry
()
239
{
240
m_bEnabled
=
true
;
241
242
if
(
Icon
.IsEmpty())
243
Icon
=
UIConstants
.ICONS_IMAGE_SET;
244
}
245
};
id
AddonBuildInfoTool id
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_BaseContainerCustomTitleUIInfo
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
Definition
SCR_ArsenalManagerComponent.c:1752
layout
UI layouts Menus CleanSweep CleanSweepAreaSelection layout
Definition
SCR_GameModeCleanSweep.c:19
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
ResourceName
Definition
ResourceName.c:13
SCR_SelectionMenuEntryComponent
Definition
SCR_SelectionMenuEntryComponent.c:7
SCR_SelectionMenuEntryComponent::SetEntry
void SetEntry(SCR_SelectionMenuEntry entry)
Set entry holding data driving this visuals.
Definition
SCR_SelectionMenuEntryComponent.c:152
SCR_SelectionMenuEntry::m_OnIconChange
ref ScriptInvoker< SCR_SelectionMenuEntry, ResourceName, string > m_OnIconChange
Definition
SCR_SelectionMenuEntry.c:26
SCR_SelectionMenuEntry::SetInputAction
void SetInputAction(string action)
Definition
SCR_SelectionMenuEntry.c:222
SCR_SelectionMenuEntry::OnEntryClick
void OnEntryClick(SCR_SelectionMenuEntryComponent entryComponent)
Definition
SCR_SelectionMenuEntry.c:122
SCR_SelectionMenuEntry::GetOnPerform
ScriptInvoker GetOnPerform()
Definition
SCR_SelectionMenuEntry.c:36
SCR_SelectionMenuEntry::m_OnPerform
ref ScriptInvoker< SCR_SelectionMenuEntry > m_OnPerform
Definition
SCR_SelectionMenuEntry.c:24
SCR_SelectionMenuEntry::SetIcon
void SetIcon(ResourceName iconPath, string imageSetName="")
Set icon and invoke change.
Definition
SCR_SelectionMenuEntry.c:157
SCR_SelectionMenuEntry::InvokeOnIconChange
void InvokeOnIconChange(ResourceName icon, string imageSetImage)
Definition
SCR_SelectionMenuEntry.c:61
SCR_SelectionMenuEntry::SetId
void SetId(string id)
Definition
SCR_SelectionMenuEntry.c:132
SCR_SelectionMenuEntry::m_sInputAction
string m_sInputAction
Definition
SCR_SelectionMenuEntry.c:16
SCR_SelectionMenuEntry::GetCustomLayout
ResourceName GetCustomLayout()
Definition
SCR_SelectionMenuEntry.c:175
SCR_SelectionMenuEntry::GetId
string GetId()
Definition
SCR_SelectionMenuEntry.c:138
SCR_SelectionMenuEntry::SetName
void SetName(string name)
Definition
SCR_SelectionMenuEntry.c:144
SCR_SelectionMenuEntry::SetEntryComponent
void SetEntryComponent(SCR_SelectionMenuEntryComponent entryComponent)
Definition
SCR_SelectionMenuEntry.c:187
SCR_SelectionMenuEntry::GetInputAction
string GetInputAction()
Definition
SCR_SelectionMenuEntry.c:228
SCR_SelectionMenuEntry::Enable
void Enable(bool enable)
Definition
SCR_SelectionMenuEntry.c:109
SCR_SelectionMenuEntry::InvokeOnPerformFail
void InvokeOnPerformFail()
Definition
SCR_SelectionMenuEntry.c:45
SCR_SelectionMenuEntry::SCR_SelectionMenuEntry
void SCR_SelectionMenuEntry()
Definition
SCR_SelectionMenuEntry.c:238
SCR_SelectionMenuEntry::GetEntryComponent
SCR_SelectionMenuEntryComponent GetEntryComponent()
Definition
SCR_SelectionMenuEntry.c:210
SCR_SelectionMenuEntry::GetOnIconChange
ScriptInvoker GetOnIconChange()
Definition
SCR_SelectionMenuEntry.c:68
SCR_SelectionMenuEntry::OnPerform
void OnPerform()
Empty methods for deifinition of perform behavior.
Definition
SCR_SelectionMenuEntry.c:104
SCR_SelectionMenuEntry::GetOnPerformFail
ScriptInvoker GetOnPerformFail()
Definition
SCR_SelectionMenuEntry.c:52
SCR_SelectionMenuEntry::SetCustomLayout
void SetCustomLayout(ResourceName layout)
Definition
SCR_SelectionMenuEntry.c:181
SCR_SelectionMenuEntry::SetDescription
void SetDescription(string description)
Definition
SCR_SelectionMenuEntry.c:150
SCR_SelectionMenuEntry::m_sId
string m_sId
Definition
SCR_SelectionMenuEntry.c:10
SCR_SelectionMenuEntry::m_EntryComponent
ref SCR_SelectionMenuEntryComponent m_EntryComponent
Definition
SCR_SelectionMenuEntry.c:21
SCR_SelectionMenuEntry::IsEnabled
bool IsEnabled()
Definition
SCR_SelectionMenuEntry.c:216
SCR_SelectionMenuEntry::Perform
void Perform()
Definition
SCR_SelectionMenuEntry.c:89
SCR_SelectionMenuEntry::InvokeOnPerform
void InvokeOnPerform()
Definition
SCR_SelectionMenuEntry.c:29
SCR_SelectionMenuEntry::Update
void Update()
Public method to make entry update itself.
Definition
SCR_SelectionMenuEntry.c:82
SCR_SelectionMenuEntry::m_sCustomLayout
ResourceName m_sCustomLayout
Definition
SCR_SelectionMenuEntry.c:19
SCR_SelectionMenuEntry::m_bEnabled
bool m_bEnabled
Definition
SCR_SelectionMenuEntry.c:13
SCR_SelectionMenuEntry::SetIconFromDeafaultImageSet
void SetIconFromDeafaultImageSet(string imageSetName="")
Definition
SCR_SelectionMenuEntry.c:166
SCR_SelectionMenuEntry::m_OnPerformFail
ref ScriptInvoker< SCR_SelectionMenuEntry > m_OnPerformFail
Definition
SCR_SelectionMenuEntry.c:25
SCR_SelectionMenuEntryIconComponent
Definition
SCR_SelectionMenuEntryIconComponent.c:3
SCR_SelectionMenuEntryIconComponent::SetImage
void SetImage(ResourceName texture, string image)
Definition
SCR_SelectionMenuEntryIconComponent.c:54
SCR_UIDescription::Description
LocalizedString Description
Definition
SCR_UIDescription.c:8
SCR_UIInfo
Definition
SCR_UIInfo.c:8
SCR_UIInfo::IconSetName
string IconSetName
Definition
SCR_UIInfo.c:13
SCR_UIInfo::Icon
ResourceName Icon
Definition
SCR_UIInfo.c:10
SCR_UIName::Name
LocalizedString Name
Definition
SCR_UIName.c:8
UIConstants
Definition
Constants.c:151
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
HUD
SelectionMenu
SCR_SelectionMenuEntry.c
Generated by
1.17.0