Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ButtonEffectOpacity.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot : true), SCR_ButtonEffectTitleAttribute("Opacity", "m_sWidgetName")]
3 class SCR_ButtonEffectOpacity : SCR_ButtonEffectWidgetBase
4 {
5  [Attribute(defvalue: "0.2", UIWidgets.EditBox, "Duration of animation")]
6  protected float m_fAnimationTime;
7 
8  [Attribute()]
9  float m_fDefault;
10 
11  [Attribute()]
12  float m_fHovered;
13 
14  [Attribute()]
15  float m_fActivated;
16 
17  [Attribute()]
18  float m_fActivatedHovered;
19 
20  [Attribute()]
21  float m_fDisabled;
22 
23  [Attribute()]
24  float m_fDisabledActivated;
25 
26  [Attribute()]
27  float m_fClicked;
28 
29  [Attribute()]
30  float m_fFocusGained;
31 
32  [Attribute()]
33  float m_fFocusLost;
34 
35  [Attribute()]
36  float m_fToggledOn;
37 
38  [Attribute()]
39  float m_fToggledOff;
40 
41  [Attribute()]
42  float m_fMouseEnter;
43 
44  [Attribute()]
45  float m_fMouseLeave;
46 
47  //------------------------------------------------------------------------------------------------
48  override void OnStateDefault(bool instant)
49  {
50  Apply(m_fDefault, instant);
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  override void OnStateHovered(bool instant)
55  {
56  Apply(m_fHovered, instant);
57  }
58 
59  //------------------------------------------------------------------------------------------------
60  override void OnStateActivated(bool instant)
61  {
62  Apply(m_fActivated, instant);
63  }
64 
65  //------------------------------------------------------------------------------------------------
66  override void OnStateActivatedHovered(bool instant)
67  {
68  Apply(m_fActivatedHovered, instant);
69  }
70 
71  //------------------------------------------------------------------------------------------------
72  override void OnClicked(bool instant)
73  {
74  Apply(m_fClicked, instant);
75  }
76 
77  //------------------------------------------------------------------------------------------------
78  override void OnStateDisabled(bool instant)
79  {
80  Apply(m_fDisabled, instant);
81  }
82 
83  //------------------------------------------------------------------------------------------------
84  override void OnStateDisabledActivated(bool instant)
85  {
86  Apply(m_fDisabledActivated, instant);
87  }
88 
89  //------------------------------------------------------------------------------------------------
90  override void OnFocusGained(bool instant)
91  {
92  Apply(m_fFocusGained, instant);
93  }
94 
95  //------------------------------------------------------------------------------------------------
96  override void OnFocusLost(bool instant)
97  {
98  Apply(m_fFocusLost, instant);
99  }
100 
101  //------------------------------------------------------------------------------------------------
102  override void OnToggledOn(bool instant)
103  {
104  Apply(m_fToggledOn, instant);
105  }
106 
107  //------------------------------------------------------------------------------------------------
108  override void OnToggledOff(bool instant)
109  {
110  Apply(m_fToggledOff, instant);
111  }
112 
113  //------------------------------------------------------------------------------------------------
114  override void OnMouseEnter(bool instant)
115  {
116  Apply(m_fMouseEnter, instant);
117  }
118 
119  //------------------------------------------------------------------------------------------------
120  override void OnMouseLeave(bool instant)
121  {
122  Apply(m_fMouseLeave, instant);
123  }
124 
125  //------------------------------------------------------------------------------------------------
126  // Called when effect is disabled. Here you should stop all running effects.
127  override void OnDisabled()
128  {
129  AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationOpacity);
130  }
131 
132  //------------------------------------------------------------------------------------------------
133  protected void Apply(float value, bool instant)
134  {
135  if (m_wTarget)
136  {
137  if (!instant && m_fAnimationTime != 0)
138  {
139  AnimateWidget.Opacity(m_wTarget, value, 1 / m_fAnimationTime);
140  }
141  else
142  {
143  AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationOpacity);
144  m_wTarget.SetOpacity(value);
145  }
146  }
147  }
148 }
SCR_ButtonEffectOpacity
Effect which animated opacity of the target widget.
Definition: SCR_ButtonEffectOpacity.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468