4 protected string m_sPingBorderName;
7 protected string m_sPulseWidgetName;
10 protected float m_fPingBorderAnimationSpeed;
13 protected float m_fPulsateAnimationSpeed;
15 [
Attribute(
"5",
desc:
"The deletion is done with a seperate timer in SCR_PingEditorComponent")]
16 protected int m_iFadeOutDelaySeconds;
18 protected Widget m_Root;
21 protected bool m_bWaitingForFade =
true;
24 override void HandlerAttached(Widget w)
27 Widget pingBorder = w.FindAnyWidget(m_sPingBorderName);
28 Widget pulseWidget = w.FindAnyWidget(m_sPulseWidgetName);
30 if (!pulseWidget || !pingBorder)
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);
38 WidgetAnimationBase animationOpacity = AnimateWidget.Opacity(pulseWidget, 0, m_fPulsateAnimationSpeed);
40 animationOpacity.SetRepeat(
true);
42 WidgetAnimationBase animationSize = AnimateWidget.Size(pulseWidget, sizePulse, m_fPulsateAnimationSpeed);
44 animationSize.SetRepeat(
true);
46 GetGame().GetCallqueue().CallLater(FadeOut, m_iFadeOutDelaySeconds * 1000);
51 protected void FadeOut()
53 m_bWaitingForFade =
false;
54 AnimateWidget.Opacity(
m_Root, 0, 1);
58 override void HandlerDeattached(Widget w)
60 if (m_bWaitingForFade)
61 GetGame().GetCallqueue().Remove(FadeOut);