Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PingEffectsEditorUIComponent.c
Go to the documentation of this file.
2{
3 [Attribute("PingBorder")]
4 protected string m_sPingBorderName;
5
6 [Attribute("PulseWidget")]
7 protected string m_sPulseWidgetName;
8
9 [Attribute("2")]
11
12 [Attribute("1")]
13 protected float m_fPulsateAnimationSpeed;
14
15 [Attribute("5", desc: "The deletion is done with a seperate timer in SCR_PingEditorComponent")]
17
18 protected Widget m_Root;
19
20 //State
21 protected bool m_bWaitingForFade = true;
22
23 //---- REFACTOR NOTE START: Hardcoded values
24
25 //------------------------------------------------------------------------------------------------
26 override void HandlerAttached(Widget w)
27 {
28 m_Root = w;
29 Widget pingBorder = w.FindAnyWidget(m_sPingBorderName);
30 Widget pulseWidget = w.FindAnyWidget(m_sPulseWidgetName);
31
32 if (!pulseWidget || !pingBorder)
33 return;
34
35 float sizeBorder[2] = {150, 150};
36 float sizePulse[2] = {70, 70};
38 AnimateWidget.Size(pingBorder, sizeBorder, m_fPingBorderAnimationSpeed);
39
40 WidgetAnimationBase animationOpacity = AnimateWidget.Opacity(pulseWidget, 0, m_fPulsateAnimationSpeed);
41 if (animationOpacity)
42 animationOpacity.SetRepeat(true);
43
44 WidgetAnimationBase animationSize = AnimateWidget.Size(pulseWidget, sizePulse, m_fPulsateAnimationSpeed);
45 if (animationSize)
46 animationSize.SetRepeat(true);
47
48 GetGame().GetCallqueue().CallLater(FadeOut, m_iFadeOutDelaySeconds * 1000);
49 }
50
51 //---- REFACTOR NOTE END ----
52
53 //------------------------------------------------------------------------------------------------
54 //~Todo: Should delete the widget once fading is done rather then having a seperate delete timer
55 protected void FadeOut()
56 {
57 m_bWaitingForFade = false;
59 }
60
61 //------------------------------------------------------------------------------------------------
62 override void HandlerDeattached(Widget w)
63 {
65 GetGame().GetCallqueue().Remove(FadeOut);
66 }
67}
ArmaReforgerScripted GetGame()
Definition game.c:1398
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void WidgetAnimationBase(Widget w, float speed)
static WidgetAnimationFrameSize Size(Widget widget, float size[2], float speed)
static WidgetAnimationOpacity Opacity(Widget widget, float targetValue, float speed, bool toggleVisibility=false)
SCR_FieldOfViewSettings Attribute