Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LoadingCircleComponent.c
Go to the documentation of this file.
1 // Component for simple loading circle widget with endless spining
2 
3 //------------------------------------------------------------------------------------------------
5 {
6  const string WIDGET_IMAGE = "Image";
7 
8  [Attribute("1", UIWidgets.CheckBox, "Speed of rotation")]
9  protected float m_fSpeed;
10 
11  protected bool m_bIsPlayingAnimation;
12  protected bool m_bIsAnimationDone;
13 
14  SizeLayoutWidget m_wRootSize;
15  ImageWidget m_wImage;
16 
17  //------------------------------------------------------------------------------------------------
18  override void HandlerAttached(Widget w)
19  {
20  super.HandlerAttached(w);
21 
22  m_wRoot = w;
23 
24  m_wRootSize = SizeLayoutWidget.Cast(m_wRoot);
25  m_wImage = ImageWidget.Cast(m_wRoot.FindAnyWidget(WIDGET_IMAGE));
26 
27  m_bIsPlayingAnimation = true;
28  m_bIsAnimationDone = true;
29 
30  Animate();
31  }
32 
33  //------------------------------------------------------------------------------------------------
34  protected void Animate()
35  {
36  if (!m_wImage)
37  return;
38 
39  m_wImage.SetRotation(0);
40  WidgetAnimationBase anim = AnimateWidget.Rotation(m_wImage, 360, m_fSpeed);
41  if (anim)
42  anim.GetOnCompleted().Insert(Animate);
43  }
44 
45  //------------------------------------------------------------------------------------------------
47  {
48 
49  }
50 
51  //------------------------------------------------------------------------------------------------
53  {
54 
55  }
56 
57  // API
58  //------------------------------------------------------------------------------------------------
59  void SetSpeed(float speed) { m_fSpeed = speed; }
60 
61  //------------------------------------------------------------------------------------------------
62  float GetSpeed() { return m_fSpeed; }
63 
64  //------------------------------------------------------------------------------------------------
65  void GetIsPlayingAnimation(bool playing) { m_bIsPlayingAnimation = playing; }
66 
67  //------------------------------------------------------------------------------------------------
68  bool GetIsPlayingAnimation() { return m_bIsPlayingAnimation; }
69 };
SCR_LoadingCircleComponent
Definition: SCR_LoadingCircleComponent.c:4
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_WLibComponentBase
Base class for all final Reforger interactive elements.
Definition: SCR_WLibComponentBase.c:4
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_wImage
protected ImageWidget m_wImage
Definition: SCR_BackendImageComponent.c:248