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_MapUIElement.c
Go to the documentation of this file.
1
enum
SCR_EIconType
2
{
3
NONE
,
4
BASE
,
5
ENEMY_BASE
,
6
RELAY
,
7
TASK
,
8
SERVICE
,
9
SPAWNPOINT
10
};
11
12
class
SCR_MapUIElement
:
SCR_ScriptedWidgetComponent
13
{
14
protected
SCR_MapUIElementContainer
m_Parent
;
15
protected
static
SCR_MapUIElement
s_SelectedElement
;
16
17
protected
MapItem
m_MapItem
;
// todo@lk: delet
18
19
protected
ImageWidget
m_wImage
;
20
protected
ImageWidget
m_wGradient
;
21
protected
ImageWidget
m_wSelectImg
;
22
protected
ImageWidget
m_wHighlightImg
;
23
24
protected
bool
m_bIsSelected
;
25
protected
const
float
ANIM_SPEED
= 20;
26
protected
SCR_EIconType
m_eIconType
;
27
protected
bool
m_bVisible
=
false
;
28
29
[
Attribute
(
"{8479B3B5347DF5CF}UI/Imagesets/MilitarySymbol/ID_D.imageset"
)]
30
protected
ResourceName
m_sImageSetARO
;
31
32
[
Attribute
(
"{27F2439D610D02B3}UI/Imagesets/MilitarySymbol/ICO_Land.imageset"
)]
33
protected
ResourceName
m_sImageSetSpecial
;
34
35
[
Attribute
(
"1"
)]
36
protected
bool
m_bUseBackgroundGradient
;
37
38
[
Attribute
(
SCR_SoundEvent
.SOUND_MAP_HOVER_BASE)]
39
protected
string
m_sSoundBase
;
40
41
[
Attribute
(
SCR_SoundEvent
.SOUND_MAP_HOVER_ENEMY)]
42
protected
string
m_sSoundEnemyBase
;
43
44
[
Attribute
(
SCR_SoundEvent
.SOUND_MAP_HOVER_TRANS_TOWER)]
45
protected
string
m_sSoundRelay
;
46
47
[
Attribute
(
SCR_SoundEvent
.SOUND_FE_BUTTON_HOVER)]
48
protected
string
m_sSoundTask
;
49
50
[
Attribute
(
SCR_SoundEvent
.SOUND_FE_BUTTON_HOVER)]
51
protected
string
m_sSoundService
;
52
53
[
Attribute
(
SCR_SoundEvent
.SOUND_FE_BUTTON_HOVER)]
54
protected
string
m_sSoundHover
;
55
56
[
Attribute
()]
57
ref
Color
m_UnknownFactionColor
;
58
59
protected
string
m_sName
;
60
61
//------------------------------------------------------------------------------
62
override
void
HandlerAttached
(
Widget
w)
63
{
64
m_wRoot
= w;
65
66
m_wImage
=
ImageWidget
.Cast(w.FindAnyWidget(
"Image"
));
67
m_wSelectImg
=
ImageWidget
.Cast(w.FindAnyWidget(
"Corners"
));
68
m_wHighlightImg
=
ImageWidget
.Cast(w.FindAnyWidget(
"Highlight"
));
69
70
if
(
m_bUseBackgroundGradient
)
71
m_wGradient
=
ImageWidget
.Cast(w.FindAnyWidget(
"BackgroundGradient"
));
72
}
73
74
//------------------------------------------------------------------------------
75
void
SetParent
(
SCR_MapUIElementContainer
parent)
76
{
77
m_Parent
= parent;
78
}
79
80
//------------------------------------------------------------------------------
81
string
GetName
()
82
{
83
return
m_sName
;
84
}
85
86
//------------------------------------------------------------------------------
87
bool
GetIconVisible
()
88
{
89
return
m_bVisible
;
90
}
91
92
//------------------------------------------------------------------------------
93
void
ShowName
(
bool
visible)
94
{
95
}
96
97
//------------------------------------------------------------------------------
98
void
SetVisible
(
bool
visible)
99
{
100
m_wRoot
.SetVisible(visible);
101
}
102
103
//------------------------------------------------------------------------------
104
Widget
GetRoot
()
105
{
106
return
m_wRoot
;
107
}
108
109
// //------------------------------------------------------------------------------
110
// override bool OnMouseEnter(Widget w, int x, int y)
111
// {
112
113
// return false;
114
// }
115
116
// //------------------------------------------------------------------------------
117
// override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
118
// {
119
120
// return false;
121
// }
122
123
//------------------------------------------------------------------------------
124
override
bool
OnClick
(
Widget
w,
int
x,
int
y,
int
button)
125
{
126
if
(
m_bVisible
)
127
SelectIcon
();
128
129
return
false
;
130
}
131
132
//------------------------------------------------------------------------------
133
void
SelectIcon
(
bool
invoke =
true
)
134
{
135
}
136
137
//------------------------------------------------------------------------------
138
void
Select
(
bool
select =
true
)
139
{
140
s_SelectedElement
=
this
;
141
m_bIsSelected
= select;
142
if
(
m_wSelectImg
)
143
m_wSelectImg
.SetVisible(select);
144
if
(select)
145
{
146
s_SelectedElement
=
this
;
147
AnimExpand
();
148
}
149
else
150
{
151
AnimCollapse
();
152
}
153
154
if
(
m_wGradient
)
155
m_wGradient
.SetVisible(select);
156
}
157
158
//------------------------------------------------------------------------------
159
protected
void
AnimExpand
()
160
{
161
}
162
163
//------------------------------------------------------------------------------
164
protected
void
AnimCollapse
()
165
{
166
}
167
168
//------------------------------------------------------------------------------
169
protected
void
PlayHoverSound
(
string
sound)
170
{
171
if
(sound !=
string
.Empty)
172
SCR_UISoundEntity
.SoundEvent(sound);
173
}
174
175
//------------------------------------------------------------------------------
176
vector
GetPos
()
177
{
178
}
179
180
//------------------------------------------------------------------------------
181
protected
void
SetImage
(
string
image)
182
{
183
}
184
185
//------------------------------------------------------------------------------
186
Color
GetColorForFaction
(
string
factionKey)
187
{
188
FactionManager fm =
GetGame
().GetFactionManager();
189
if
(!fm)
190
return
null;
191
192
Faction
faction = fm.GetFactionByKey(factionKey);
193
if
(!faction)
194
return
Color
.FromInt(
m_UnknownFactionColor
.PackToInt());
195
196
return
Color
.FromInt(faction.GetFactionColor().PackToInt());
197
}
198
199
//------------------------------------------------------------------------------
200
RplId
GetSpawnPointId
()
201
{
202
return
RplId
.Invalid();
203
}
204
205
//------------------------------------------------------------------------------------------------
206
void
SetName
(
string
name);
207
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BASE
@ BASE
Definition
SCR_CampaignMilitaryBaseComponent.c:2967
RELAY
@ RELAY
Definition
SCR_CampaignMilitaryBaseComponent.c:2968
SCR_EIconType
SCR_EIconType
Definition
SCR_MapUIElement.c:2
SPAWNPOINT
@ SPAWNPOINT
Definition
SCR_MapUIElement.c:9
SERVICE
@ SERVICE
Definition
SCR_MapUIElement.c:8
ENEMY_BASE
@ ENEMY_BASE
Definition
SCR_MapUIElement.c:5
Color
Definition
Color.c:13
Faction
Definition
Faction.c:13
ImageWidget
Definition
ImageWidget.c:13
MapItem
Definition
MapItem.c:13
ResourceName
Definition
ResourceName.c:13
RplId
Replication item identifier.
Definition
RplId.c:14
SCR_MapUIElementContainer
Definition
SCR_MapUIElementContainer.c:2
SCR_MapUIElement
Definition
SCR_MapUIElement.c:13
SCR_MapUIElement::m_sSoundRelay
string m_sSoundRelay
Definition
SCR_MapUIElement.c:45
SCR_MapUIElement::GetSpawnPointId
RplId GetSpawnPointId()
Definition
SCR_MapUIElement.c:200
SCR_MapUIElement::AnimCollapse
void AnimCollapse()
Definition
SCR_MapUIElement.c:164
SCR_MapUIElement::SetParent
void SetParent(SCR_MapUIElementContainer parent)
Definition
SCR_MapUIElement.c:75
SCR_MapUIElement::GetColorForFaction
Color GetColorForFaction(string factionKey)
Definition
SCR_MapUIElement.c:186
SCR_MapUIElement::m_bIsSelected
bool m_bIsSelected
Definition
SCR_MapUIElement.c:24
SCR_MapUIElement::m_sSoundEnemyBase
string m_sSoundEnemyBase
Definition
SCR_MapUIElement.c:42
SCR_MapUIElement::ShowName
void ShowName(bool visible)
Definition
SCR_MapUIElement.c:93
SCR_MapUIElement::m_sSoundHover
string m_sSoundHover
Definition
SCR_MapUIElement.c:54
SCR_MapUIElement::SetVisible
void SetVisible(bool visible)
Definition
SCR_MapUIElement.c:98
SCR_MapUIElement::GetRoot
Widget GetRoot()
Definition
SCR_MapUIElement.c:104
SCR_MapUIElement::m_sSoundTask
string m_sSoundTask
Definition
SCR_MapUIElement.c:48
SCR_MapUIElement::m_wImage
ImageWidget m_wImage
Definition
SCR_MapUIElement.c:19
SCR_MapUIElement::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_MapUIElement.c:62
SCR_MapUIElement::m_eIconType
SCR_EIconType m_eIconType
Definition
SCR_MapUIElement.c:26
SCR_MapUIElement::m_MapItem
MapItem m_MapItem
Definition
SCR_MapUIElement.c:17
SCR_MapUIElement::m_UnknownFactionColor
ref Color m_UnknownFactionColor
Definition
SCR_MapUIElement.c:57
SCR_MapUIElement::m_sImageSetARO
ResourceName m_sImageSetARO
Definition
SCR_MapUIElement.c:30
SCR_MapUIElement::m_bUseBackgroundGradient
bool m_bUseBackgroundGradient
Definition
SCR_MapUIElement.c:36
SCR_MapUIElement::m_sSoundService
string m_sSoundService
Definition
SCR_MapUIElement.c:51
SCR_MapUIElement::s_SelectedElement
static SCR_MapUIElement s_SelectedElement
Definition
SCR_MapUIElement.c:15
SCR_MapUIElement::ANIM_SPEED
const float ANIM_SPEED
Definition
SCR_MapUIElement.c:25
SCR_MapUIElement::m_bVisible
bool m_bVisible
Definition
SCR_MapUIElement.c:27
SCR_MapUIElement::PlayHoverSound
void PlayHoverSound(string sound)
Definition
SCR_MapUIElement.c:169
SCR_MapUIElement::GetPos
vector GetPos()
Definition
SCR_MapUIElement.c:176
SCR_MapUIElement::m_sSoundBase
string m_sSoundBase
Definition
SCR_MapUIElement.c:39
SCR_MapUIElement::m_wSelectImg
ImageWidget m_wSelectImg
Definition
SCR_MapUIElement.c:21
SCR_MapUIElement::m_Parent
SCR_MapUIElementContainer m_Parent
Definition
SCR_MapUIElement.c:14
SCR_MapUIElement::AnimExpand
void AnimExpand()
Definition
SCR_MapUIElement.c:159
SCR_MapUIElement::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
SCR_MapUIElement.c:124
SCR_MapUIElement::GetIconVisible
bool GetIconVisible()
Definition
SCR_MapUIElement.c:87
SCR_MapUIElement::m_sName
string m_sName
Definition
SCR_MapUIElement.c:59
SCR_MapUIElement::m_wGradient
ImageWidget m_wGradient
Definition
SCR_MapUIElement.c:20
SCR_MapUIElement::SelectIcon
void SelectIcon(bool invoke=true)
Definition
SCR_MapUIElement.c:133
SCR_MapUIElement::SetImage
void SetImage(string image)
Definition
SCR_MapUIElement.c:181
SCR_MapUIElement::m_wHighlightImg
ImageWidget m_wHighlightImg
Definition
SCR_MapUIElement.c:22
SCR_MapUIElement::GetName
string GetName()
Definition
SCR_MapUIElement.c:81
SCR_MapUIElement::Select
void Select(bool select=true)
Definition
SCR_MapUIElement.c:138
SCR_MapUIElement::SetName
void SetName(string name)
SCR_MapUIElement::m_sImageSetSpecial
ResourceName m_sImageSetSpecial
Definition
SCR_MapUIElement.c:33
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SCR_SoundEvent
Definition
SCR_SoundEvent.c:2
SCR_UISoundEntity
Definition
SCR_UISoundEntity.c:8
Widget
Definition
Widget.c:13
vector
Definition
vector.c:13
NONE
@ NONE
When Shape is created and not initialized yet.
Definition
ShapeType.c:15
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TASK
@ TASK
Definition
EEditableEntityType.c:15
scripts
Game
UI
Conflict
SCR_MapUIElement.c
Generated by
1.17.0