Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
WidgetAnimations.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
3{
4 protected float m_fValueDefault;
5 protected float m_fValueTarget;
6 protected float m_fValueCurrent;
8
9 //------------------------------------------------------------------------------------------------
10 protected override void Animate(bool finished)
11 {
12 if (!m_wWidget)
13 return;
14
15 BlurWidget blurWidget = BlurWidget.Cast(m_wWidget);
16 if (!blurWidget)
17 return;
18
20 blurWidget.SetIntensity(m_fValueCurrent);
21 }
22
23 //------------------------------------------------------------------------------------------------
24 // constructor
28 void WidgetAnimationBlurIntensity(Widget w, float speed, float targetValue)
29 {
30 m_fValueTarget = targetValue;
32 }
33};
34//------------------------------------------------------------------------------------------------
36{
37 protected float m_fValueDefault;
38 protected float m_fValueTarget;
39 protected float m_fValueCurrent;
40 protected bool m_bChangeVisibleFlag;
41
42 //------------------------------------------------------------------------------------------------
43 // Expose target opacity value so it can be adjusted while the animation is running
44 void SetTargetValue(float targetValue)
45 {
46 m_fValueTarget = targetValue;
47 }
48
49 //------------------------------------------------------------------------------------------------
50 // Get target opacity value from running animation
52 {
53 return m_fValueTarget;
54 }
55
56 //------------------------------------------------------------------------------------------------
57 protected override void ReverseDirection()
58 {
59 float f = m_fValueDefault;
62 m_fValue = 0;
63 }
64
65 //------------------------------------------------------------------------------------------------
66 protected override void Animate(bool finished)
67 {
68 if (!m_wWidget)
69 return;
70
72 m_wWidget.SetOpacity(m_fValueCurrent);
73
74 if (finished && m_bChangeVisibleFlag)
75 m_wWidget.SetVisible(m_fValueCurrent != 0);
76 }
77
78 //------------------------------------------------------------------------------------------------
79 void WidgetAnimationOpacity(Widget w, float speed, float targetValue, bool toggleVisibility = false)
80 {
81 m_fValueTarget = targetValue;
82 m_fValueDefault = w.GetOpacity();
83 m_bChangeVisibleFlag = toggleVisibility;
84
85 if (toggleVisibility)
86 w.SetVisible(true);
87 }
88};
89
90//------------------------------------------------------------------------------------------------
92{
93 protected float m_fValueDefault[4];
94 protected float m_fValueTarget[4];
95 protected bool m_bIsGrid;
96
97 //------------------------------------------------------------------------------------------------
98 protected override void ReverseDirection()
99 {
102 m_fValueTarget = f;
103 }
104
105 //------------------------------------------------------------------------------------------------
106 protected override void Animate(bool finished)
107 {
108 if (!m_wWidget)
109 return;
110
111 float l = Math.Lerp(m_fValueDefault[0], m_fValueTarget[0], m_fValue);
112 float t = Math.Lerp(m_fValueDefault[1], m_fValueTarget[1], m_fValue);
113 float r = Math.Lerp(m_fValueDefault[2], m_fValueTarget[2], m_fValue);
114 float b = Math.Lerp(m_fValueDefault[3], m_fValueTarget[3], m_fValue);
115
116 if (m_bIsGrid)
117 GridSlot.SetPadding(m_wWidget, l, t, r, b);
118 else
119 AlignableSlot.SetPadding(m_wWidget, l, t, r, b);
120 }
121
122 //------------------------------------------------------------------------------------------------
123 void WidgetAnimationPadding(Widget w, float speed, float padding[4])
124 {
125 m_fValueTarget = padding;
126
127 float l,t,r,b;
128 m_bIsGrid = GridLayoutWidget.Cast(w);
129 if (m_bIsGrid)
130 GridSlot.GetPadding(w, l,t,r,b);
131 else
132 AlignableSlot.GetPadding(w, l,t,r,b);
133
134 m_fValueDefault = {l,t,r,b};
135 }
136};
137
138//------------------------------------------------------------------------------------------------
140{
141 protected float m_fValueDefault;
142 protected float m_fValueTarget;
143 protected float m_fValueCurrent;
144
145 //------------------------------------------------------------------------------------------------
146 protected override void ReverseDirection()
147 {
148 float f = m_fValueDefault;
150 m_fValueTarget = f;
151 }
152
153 //------------------------------------------------------------------------------------------------
154 protected override void Animate(bool finished)
155 {
156 if (!m_wWidget)
157 return;
158
160 LayoutSlot.SetFillWeight(m_wWidget, m_fValueCurrent);
161 }
162
163 //------------------------------------------------------------------------------------------------
164 void WidgetAnimationLayoutFill(Widget w, float speed, float targetValue)
165 {
166 m_fValueTarget = targetValue;
167 m_fValueDefault = LayoutSlot.GetFillWeight(w);
168 }
169};
170
171//------------------------------------------------------------------------------------------------
173{
174 protected float m_fValueDefault;
175 protected float m_fValueTarget;
176 protected float m_fValueCurrent;
178
179 //------------------------------------------------------------------------------------------------
180 protected override void ReverseDirection()
181 {
182 float f = m_fValueDefault;
184 m_fValueTarget = f;
185 }
186
187 //------------------------------------------------------------------------------------------------
188 protected override void Animate(bool finished)
189 {
190 if (!m_wImage)
191 return;
192
194 m_wImage.SetMaskProgress(m_fValueCurrent);
195 }
196
197 //------------------------------------------------------------------------------------------------
198 void WidgetAnimationAlphaMask(Widget w, float speed, float targetValue)
199 {
200 m_wImage = ImageWidget.Cast(w);
201 if (!m_wImage)
202 return;
203
204 m_fValueTarget = targetValue;
205 m_fValueDefault = m_wImage.GetMaskProgress();
206 }
207};
208
209//------------------------------------------------------------------------------------------------
211{
212 protected float m_fValueDefault;
213 protected float m_fValueTarget;
214 protected float m_fValueCurrent;
216
217 //------------------------------------------------------------------------------------------------
218 protected override void ReverseDirection()
219 {
220 float f = m_fValueDefault;
222 m_fValueTarget = f;
223 }
224
225 //------------------------------------------------------------------------------------------------
226 protected override void Animate(bool finished)
227 {
228 if (!m_wImage)
229 return;
230
232 m_wImage.SetRotation(m_fValueCurrent);
233 }
234
235 //------------------------------------------------------------------------------------------------
236 void WidgetAnimationImageRotation(Widget w, float speed, float targetValue)
237 {
238 m_wImage = ImageWidget.Cast(w);
239 if (!m_wImage)
240 return;
241
242 m_fValueTarget = targetValue;
243 m_fValueDefault = m_wImage.GetRotation();
244 }
245};
246
247//------------------------------------------------------------------------------------------------
249{
250 protected ref Color m_ColorDefault;
251 protected ref Color m_ColorTarget;
252 protected ref Color m_ColorCurrent;
253
254 //------------------------------------------------------------------------------------------------
255 protected override void ReverseDirection()
256 {
259 m_ColorTarget = color;
260 m_fValue = 0;
261 }
262
263 //------------------------------------------------------------------------------------------------
264 protected override void Animate(bool finished)
265 {
266 if (!m_wWidget)
267 return;
268
270 m_wWidget.SetColor(m_ColorCurrent);
271 }
272
273 //------------------------------------------------------------------------------------------------
274 void WidgetAnimationColor(Widget w, float speed, Color targetColor)
275 {
276 m_ColorTarget = targetColor;
277 m_ColorDefault = w.GetColor();
278 }
279};
280
281//------------------------------------------------------------------------------------------------
283{
284 protected float m_fValueDefault[2];
285 protected float m_fValueTarget[2];
286 protected float m_fValueCurrent[2];
287
288 //------------------------------------------------------------------------------------------------
289 protected override void ReverseDirection()
290 {
291 float f[2] = {m_fValueDefault[0], m_fValueDefault[1]};
293 m_fValueTarget = f;
294 m_fValue = 0;
295 }
296
297 //------------------------------------------------------------------------------------------------
298 protected override void Animate(bool finished)
299 {
300 if (!m_wWidget)
301 return;
302
306 }
307
308 //------------------------------------------------------------------------------------------------
309 void WidgetAnimationFrameSize(Widget w, float speed, float size[2])
310 {
312 m_fValueDefault[0] = FrameSlot.GetSizeX(w);
313 m_fValueDefault[1] = FrameSlot.GetSizeY(w);
314 }
315};
316
317//------------------------------------------------------------------------------------------------
319{
320 protected float m_fValueDefault[2];
321 protected float m_fValueTarget[2];
322 protected float m_fValueCurrent[2];
323
324 //------------------------------------------------------------------------------------------------
325 protected override void ReverseDirection()
326 {
327 float f[2] = {m_fValueDefault[0], m_fValueDefault[1]};
329 m_fValueTarget = f;
330 }
331
332 //------------------------------------------------------------------------------------------------
333 protected override void Animate(bool finished)
334 {
335 if (!m_wWidget)
336 return;
337
341 }
342
343 //------------------------------------------------------------------------------------------------
344 void WidgetAnimationPosition(Widget w, float speed, float position[2])
345 {
347
348 m_fValueDefault[0] = FrameSlot.GetPosX(w);
349 m_fValueDefault[1] = FrameSlot.GetPosY(w);
350 }
351};
352
353//------------------------------------------------------------------------------------------------
355{
356 protected float m_fValueDefault;
357 protected float m_fValueTarget;
358 protected float m_fValueCurrent;
360
361 //------------------------------------------------------------------------------------------------
362 protected override void ReverseDirection()
363 {
364 float f = m_fValueDefault;
366 m_fValueTarget = f;
367 }
368
369 //------------------------------------------------------------------------------------------------
370 protected override void Animate(bool finished)
371 {
372 if (!m_wImage)
373 return;
374
376 m_wImage.SetSaturation(m_fValueCurrent);
377 }
378
379 //------------------------------------------------------------------------------------------------
380 void WidgetAnimationImageSaturation(Widget w, float speed, float targetValue)
381 {
382 m_wImage = ImageWidget.Cast(w);
383 if (!m_wImage)
384 return;
385
386 m_fValueTarget = targetValue;
387 m_fValueDefault = m_wImage.GetSaturation();
388 }
389};
390
391//------------------------------------------------------------------------------------------------
393{
394 protected float m_fValueDefault;
395 protected float m_fValueTarget;
396 protected float m_fValueCurrent;
397
398 //------------------------------------------------------------------------------------------------
399 protected override void ReverseDirection()
400 {
401 float f = m_fValueDefault;
403 m_fValueTarget = f;
404 }
405
406 //------------------------------------------------------------------------------------------------
407 protected override void Animate(bool finished)
408 {
410 }
411
412 //------------------------------------------------------------------------------------------------
413 void WidgetAnimationValue(Widget w, float speed, float targetValue, float defaultValue)
414 {
415 m_fValueTarget = targetValue;
416 m_fValueDefault = defaultValue;
417 }
418};
int size
vector position
Widget m_wWidget
void WidgetAnimationBase(Widget w, float speed)
Definition Color.c:13
Definition Math.c:13
override void Animate(bool finished)
void WidgetAnimationAlphaMask(Widget w, float speed, float targetValue)
override void ReverseDirection()
void WidgetAnimationBlurIntensity(Widget w, float speed, float targetValue)
override void Animate(bool finished)
override void ReverseDirection()
void WidgetAnimationColor(Widget w, float speed, Color targetColor)
override void Animate(bool finished)
void WidgetAnimationFrameSize(Widget w, float speed, float size[2])
override void ReverseDirection()
override void Animate(bool finished)
override void Animate(bool finished)
void WidgetAnimationImageRotation(Widget w, float speed, float targetValue)
void WidgetAnimationImageSaturation(Widget w, float speed, float targetValue)
override void Animate(bool finished)
override void Animate(bool finished)
void WidgetAnimationLayoutFill(Widget w, float speed, float targetValue)
void SetTargetValue(float targetValue)
override void ReverseDirection()
override void Animate(bool finished)
void WidgetAnimationOpacity(Widget w, float speed, float targetValue, bool toggleVisibility=false)
void WidgetAnimationPadding(Widget w, float speed, float padding[4])
override void Animate(bool finished)
override void ReverseDirection()
void WidgetAnimationPosition(Widget w, float speed, float position[2])
override void Animate(bool finished)
override void ReverseDirection()
override void ReverseDirection()
void WidgetAnimationValue(Widget w, float speed, float targetValue, float defaultValue)
override void Animate(bool finished)