Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ButtonEffectPadding.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot : true), SCR_ButtonEffectTitleAttribute("Padding", "m_sWidgetName")]
3 class SCR_ButtonEffectPadding : 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_fFocusGained;
28 
29  [Attribute()]
30  float m_fFocusLost;
31 
32  [Attribute()]
33  float m_fToggledOn;
34 
35  [Attribute()]
36  float m_fToggledOff;
37 
38  //------------------------------------------------------------------------------------------------
39  override void OnStateDefault(bool instant)
40  {
41  Apply(m_fDefault, instant);
42  }
43 
44  //------------------------------------------------------------------------------------------------
45  override void OnStateHovered(bool instant)
46  {
47  Apply(m_fHovered, instant);
48  }
49 
50  //------------------------------------------------------------------------------------------------
51  override void OnStateActivated(bool instant)
52  {
53  Apply(m_fActivated, instant);
54  }
55 
56  //------------------------------------------------------------------------------------------------
57  override void OnStateActivatedHovered(bool instant)
58  {
59  Apply(m_fActivatedHovered, instant);
60  }
61 
62  //------------------------------------------------------------------------------------------------
63  override void OnStateDisabled(bool instant)
64  {
65  Apply(m_fDisabled, instant);
66  }
67 
68  //------------------------------------------------------------------------------------------------
69  override void OnStateDisabledActivated(bool instant)
70  {
71  Apply(m_fDisabled, instant);
72  }
73 
74  //------------------------------------------------------------------------------------------------
75  override void OnFocusGained(bool instant)
76  {
77  Apply(m_fFocusGained, instant);
78  }
79 
80  //------------------------------------------------------------------------------------------------
81  override void OnFocusLost(bool instant)
82  {
83  Apply(m_fFocusLost, instant);
84  }
85 
86  //------------------------------------------------------------------------------------------------
87  override void OnToggledOn(bool instant)
88  {
89  Apply(m_fToggledOn, instant);
90  }
91 
92  //------------------------------------------------------------------------------------------------
93  override void OnToggledOff(bool instant)
94  {
95  Apply(m_fToggledOff, instant);
96  }
97 
98  //------------------------------------------------------------------------------------------------
99  // Called when effect is disabled. Here you should stop all running effects.
100  override void OnDisabled()
101  {
102  AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationPadding);
103  }
104 
105  //------------------------------------------------------------------------------------------------
106  protected void Apply(float value, bool instant)
107  {
108  if (m_wTarget)
109  {
110  if (!instant && m_fAnimationTime != 0)
111  {
112  float padding[4] = {value, value, value, value};
113  AnimateWidget.Padding(m_wTarget, padding, 1/m_fAnimationTime);
114  }
115  else
116  {
117  AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationPadding);
118  AlignableSlot.SetPadding(m_wTarget, value, value, value, value);
119  }
120  }
121  }
122 }
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ButtonEffectPadding
Effect which changes all padding values of a target widget.
Definition: SCR_ButtonEffectPadding.c:3
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