Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MapUIElement.c
Go to the documentation of this file.
11
13{
16
17 protected MapItem m_MapItem; // todo@lk: delet
18
23
24 protected bool m_bIsSelected;
25 protected const float ANIM_SPEED = 20;
27 protected bool m_bVisible = false;
28
29 [Attribute("{8479B3B5347DF5CF}UI/Imagesets/MilitarySymbol/ID_D.imageset")]
31
32 [Attribute("{27F2439D610D02B3}UI/Imagesets/MilitarySymbol/ICO_Land.imageset")]
34
35 [Attribute("1")]
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()]
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
71 m_wGradient = ImageWidget.Cast(w.FindAnyWidget("BackgroundGradient"));
72 }
73
74 //------------------------------------------------------------------------------
76 {
77 m_Parent = parent;
78 }
79
80 //------------------------------------------------------------------------------
81 string GetName()
82 {
83 return m_sName;
84 }
85
86 //------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------
201 {
202 return RplId.Invalid();
203 }
204
205 //------------------------------------------------------------------------------------------------
206 void SetName(string name);
207};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_EIconType
@ SPAWNPOINT
@ SERVICE
@ ENEMY_BASE
Definition Color.c:13
Replication item identifier.
Definition RplId.c:14
void SetParent(SCR_MapUIElementContainer parent)
Color GetColorForFaction(string factionKey)
void ShowName(bool visible)
void SetVisible(bool visible)
override void HandlerAttached(Widget w)
SCR_EIconType m_eIconType
ref Color m_UnknownFactionColor
ResourceName m_sImageSetARO
static SCR_MapUIElement s_SelectedElement
const float ANIM_SPEED
void PlayHoverSound(string sound)
ImageWidget m_wSelectImg
SCR_MapUIElementContainer m_Parent
override bool OnClick(Widget w, int x, int y, int button)
ImageWidget m_wGradient
void SelectIcon(bool invoke=true)
void SetImage(string image)
ImageWidget m_wHighlightImg
void Select(bool select=true)
void SetName(string name)
ResourceName m_sImageSetSpecial
@ NONE
When Shape is created and not initialized yet.
Definition ShapeType.c:15
SCR_FieldOfViewSettings Attribute