Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ButtonLegendComponent.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
3{
4 [Attribute()]
6
11
16
17 protected int m_ibuttonId;
18
19 [Attribute()]
20 protected bool m_bIsActive;
21
22 [Attribute("0 0 0 1", UIWidgets.ColorPicker)]
23 protected ref Color m_ColorInactive;
24
25 [Attribute("0 0 0 0.5", UIWidgets.ColorPicker)]
27
28 [Attribute("0.898 0.541 0.184 1", UIWidgets.ColorPicker)]
29 protected ref Color m_ColorActive;
30
31 [Attribute("1 1 1 1", UIWidgets.ColorPicker)]
33
34 [Attribute("0 0 0 1", UIWidgets.ColorPicker)]
36
37 [Attribute("{FDD5423E69D007F8}UI/Textures/Icons/icons_wrapperUI-128.imageset", UIWidgets.ResourcePickerThumbnail)]
39
40 [Attribute("career_traits")]
42
43 [Attribute("careerCircle")]
45
46 [Attribute("careerCircleOutline")]
48
49 [Attribute("careerCircleSelected")]
51
52 /*
53 [Attribute("{F7FD1672FECA05E8}UI/Textures/Icons/icons_gamepad_64.imageset", UIWidgets.ResourcePickerThumbnail)]
54 protected ResourceName m_TextureChangeSpButtonKeyboard;
55
56 [Attribute("DPAD_left")]
57 protected string m_StringChangeSpLeft;
58
59 [Attribute("DPAD_right")]
60 protected string m_StringChangeSpRight;
61 */
62
63 [Attribute("{3093C92AE673BC5E}UI/Textures/Workshop/PagingArrow_UI.edds", UIWidgets.ResourcePickerThumbnail)]
65
66 protected bool m_bLeftAndRightUI;
67
68 // Arguments passed: this
72
73 //------------------------------------------------------------------------------------------------
74 protected override void HandlerAttached(Widget w)
75 {
76 super.HandlerAttached(w);
77
78 m_wSpecializationText = TextWidget.Cast(w.FindAnyWidget("SpecializationText"));
80 {
83 }
84
85 m_wSpecializationCoreImage = ImageWidget.Cast(w.FindAnyWidget("SpecializationCoreImage"));
86 m_wSpecializationBorderImage = ImageWidget.Cast(w.FindAnyWidget("SpecializationBorderImage"));
87 m_wSpecializationBackgroundImage = ImageWidget.Cast(w.FindAnyWidget("SpecializationBackgroundImage"));
89 {
96 }
97
98 m_wChangeSpLeftLayout = w.FindAnyWidget("ChangeSpLeftSizeLayout");
99 m_wChangeSpLeft = ImageWidget.Cast(w.FindAnyWidget("ChangeSpLeft"));
100 m_wChangeSpRight = ImageWidget.Cast(w.FindAnyWidget("ChangeSpRight"));
101 m_wChangeSpRightLayout = w.FindAnyWidget("ChangeSpRightSizeLayout");
102
103 //Buttons on the sides of the legend
104 m_bLeftAndRightUI = false;
105
107 {
108 /*
109 SetTexture(m_wChangeSpLeft, m_TextureChangeSpButtonKeyboard, m_StringChangeSpLeft);
110 SetTexture(m_wChangeSpRight, m_TextureChangeSpButtonKeyboard, m_StringChangeSpRight);
111 */
114
117 m_wChangeSpLeftLayout.SetVisible(false);
118 m_wChangeSpRightLayout.SetVisible(false);
119 }
120 }
121
122 //------------------------------------------------------------------------------------------------
124 {
125 return m_OnClicked;
126 }
127
128 //------------------------------------------------------------------------------------------------
133
134 //------------------------------------------------------------------------------------------------
139
140 //------------------------------------------------------------------------------------------------
141 protected override bool OnClick(Widget w, int x, int y, int button)
142 {
143 super.OnClick(w, x, y, button);
144 if (button != 0)
145 return false;
146
147 m_OnClicked.Invoke(this);
148
149 return false;
150 }
151
152 //------------------------------------------------------------------------------------------------
153 override bool OnFocus(Widget w, int x, int y)
154 {
155 return false;
156 return OnClick(w, x, y, 0);
157 }
158
159 //------------------------------------------------------------------------------------------------
160 protected override bool OnMouseEnter(Widget w, int x, int y)
161 {
162 super.OnMouseEnter(w, x, y);
163
164 m_OnMouseEnter.Invoke(this);
165 return false;
166 }
167
168 //------------------------------------------------------------------------------------------------
169 protected override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
170 {
171 super.OnMouseLeave(w, enterW, x, y);
172
173 m_OnMouseLeave.Invoke(this);
174 return false;
175 }
176
177 //------------------------------------------------------------------------------------------------
178 void Activate(bool animate = true, bool playsound = true)
179 {
180 if (m_bIsActive)
181 return;
182
183 m_bIsActive = true;
184 if (playsound)
186
187 if (animate)
188 {
191
194
197
200 }
201 else
202 {
204 {
207 }
208
210 {
214 }
215
217 {
220 }
221
223 {
226 }
227 }
228
230 {
231 m_wChangeSpLeftLayout.SetVisible(true);
232 m_wChangeSpRightLayout.SetVisible(true);
233 }
234 }
235
236 //------------------------------------------------------------------------------------------------
237 void Deactivate(bool animate = true, bool playsound = true)
238 {
239 if (!m_bIsActive)
240 return;
241
242 m_bIsActive = false;
243 if (playsound)
245
246 if (animate)
247 {
250
253
256
259 }
260 else
261 {
263 {
266 }
267
269 {
273 }
274
276 {
279 }
280
282 {
285 }
286 }
287
289 {
290 m_wChangeSpLeftLayout.SetVisible(false);
291 m_wChangeSpRightLayout.SetVisible(false);
292 }
293 }
294
295 //------------------------------------------------------------------------------------------------
323
324 //------------------------------------------------------------------------------------------------
325 void Hide()
326 {
327 m_wRoot.SetOpacity(0);
328 }
329
330 //------------------------------------------------------------------------------------------------
331 void Unhide()
332 {
333 m_wRoot.SetOpacity(255);
334 }
335
336 //------------------------------------------------------------------------------------------------
337 bool IsActive()
338 {
339 return m_bIsActive;
340 }
341
342 //------------------------------------------------------------------------------------------------
343 void SetText(string text)
344 {
346 return;
347
348 if (m_sSpecializationText == text)
349 return;
350
352 m_wSpecializationText.SetText(text);
353 }
354
355 //------------------------------------------------------------------------------------------------
356 string GetText()
357 {
359 }
360
361 //------------------------------------------------------------------------------------------------
366
367 //------------------------------------------------------------------------------------------------
372
373 //------------------------------------------------------------------------------------------------
378
379 //------------------------------------------------------------------------------------------------
384
385 //------------------------------------------------------------------------------------------------
390
391 //------------------------------------------------------------------------------------------------
393 {
394 return m_bLeftAndRightUI;
395 }
396
398 {
399 m_bLeftAndRightUI = flag;
400 }
401
402 //------------------------------------------------------------------------------------------------
409
410 //------------------------------------------------------------------------------------------------
411 void SetFocus()
412 {
413 WorkspaceWidget workspace = GetGame().GetWorkspace();
414 if (!workspace)
415 return;
416
417 GetGame().GetCallqueue().CallLater(workspace.SetFocusedWidget, 1000, false, m_wRoot, true);
418 }
419
420 //------------------------------------------------------------------------------------------------
422 {
423 return m_ibuttonId;
424 }
425};
ArmaReforgerScripted GetGame()
Definition game.c:1398
void OnClick()
On click callback.
void OnHover(EEditableEntityState state, set< SCR_EditableEntityComponent > entitiesInsert, set< SCR_EditableEntityComponent > entitiesRemove)
static bool StopAnimation(Widget w, typename typeName)
static WidgetAnimationColor Color(Widget widget, Color color, float speed)
Definition Color.c:13
override void HandlerAttached(Widget w)
void Activate(bool animate=true, bool playsound=true)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
override bool OnClick(Widget w, int x, int y, int button)
void Deactivate(bool animate=true, bool playsound=true)
override bool OnFocus(Widget w, int x, int y)
override bool OnMouseEnter(Widget w, int x, int y)
Base class for all final Reforger interactive elements.
static bool SetTexture(ImageWidget widget, ResourceName texture, string image="")
SCR_FieldOfViewSettings Attribute
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134