Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PingEffectsEditorUIComponent.c
Go to the documentation of this file.
1 class SCR_PingEffectsEditorUIComponent : ScriptedWidgetComponent
2 {
3  [Attribute("PingBorder")]
4  protected string m_sPingBorderName;
5 
6  [Attribute("PulseWidget")]
7  protected string m_sPulseWidgetName;
8 
9  [Attribute("2")]
10  protected float m_fPingBorderAnimationSpeed;
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")]
16  protected int m_iFadeOutDelaySeconds;
17 
18  protected Widget m_Root;
19 
20  //State
21  protected bool m_bWaitingForFade = true;
22 
23  //------------------------------------------------------------------------------------------------
24  override void HandlerAttached(Widget w)
25  {
26  m_Root = w;
27  Widget pingBorder = w.FindAnyWidget(m_sPingBorderName);
28  Widget pulseWidget = w.FindAnyWidget(m_sPulseWidgetName);
29 
30  if (!pulseWidget || !pingBorder)
31  return;
32 
33  float sizeBorder[2] = {150, 150};
34  float sizePulse[2] = {70, 70};
35  AnimateWidget.Opacity(pingBorder, 0, m_fPingBorderAnimationSpeed);
36  AnimateWidget.Size(pingBorder, sizeBorder, m_fPingBorderAnimationSpeed);
37 
38  WidgetAnimationBase animationOpacity = AnimateWidget.Opacity(pulseWidget, 0, m_fPulsateAnimationSpeed);
39  if (animationOpacity)
40  animationOpacity.SetRepeat(true);
41 
42  WidgetAnimationBase animationSize = AnimateWidget.Size(pulseWidget, sizePulse, m_fPulsateAnimationSpeed);
43  if (animationSize)
44  animationSize.SetRepeat(true);
45 
46  GetGame().GetCallqueue().CallLater(FadeOut, m_iFadeOutDelaySeconds * 1000);
47  }
48 
49  //------------------------------------------------------------------------------------------------
50  //~Todo: Should delete the widget once fading is done rather then having a seperate delete timer
51  protected void FadeOut()
52  {
53  m_bWaitingForFade = false;
54  AnimateWidget.Opacity(m_Root, 0, 1);
55  }
56 
57  //------------------------------------------------------------------------------------------------
58  override void HandlerDeattached(Widget w)
59  {
60  if (m_bWaitingForFade)
61  GetGame().GetCallqueue().Remove(FadeOut);
62  }
63 }
m_Root
SCR_ServerHostingModSubMenu m_Root
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_PingEffectsEditorUIComponent
Definition: SCR_PingEffectsEditorUIComponent.c:1