Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ModularButtonComponent.c
Go to the documentation of this file.
1 //#define DEBUG_MODULAR_BUTTON
2 
3 
7 {
8  STATE_DEFAULT = 1 << 0,
9  STATE_HOVERED = 1 << 1,
10  STATE_ACTIVATED = 1 << 2,
11  STATE_ACTIVATED_HOVERED = 1 << 3,
12  STATE_DISABLED = 1 << 4,
13  STATE_DISABLED_ACTIVATED = 1 << 5
14 }
15 
17 enum EModularButtonEventHandler
18 {
19  CLICK = 1 << 0,
20  DOUBLE_CLICK = 1 << 1,
21  FOCUS_GAINED = 1 << 2,
22  FOCUS_LOST = 1 << 3,
23  MOUSE_ENTER = 1 << 4,
24  MOUSE_LEAVE = 1 << 5,
25 }
26 
29 class SCR_ModularButtonComponent : ScriptedWidgetComponent
30 {
31  // ---- Public and attributes ----
32 
33  // Attributes - effects
34 
35  [Attribute()]
36  protected ref array<ref SCR_ButtonEffectBase> m_aEffects;
37 
38  // Attributes - other properties
39 
40  [Attribute("false", UIWidgets.CheckBox, "Can the button be only clicked, or also toggled?")]
41  protected bool m_bCanBeToggled;
42 
43  [Attribute("false", UIWidgets.CheckBox, "If the button can be toggled, toggle it automatically on click or only through external API?")]
44  protected bool m_bToggledOnlyThroughApi;
45 
46  [Attribute("false")]
47  protected bool m_bToggledAtStart;
48 
49  [Attribute("2147483647", UIWidgets.Flags, "Value which will be returned from event handlers. Useful in button-over-button cases: tiles with buttons inside or similar.", "", ParamEnumArray.FromEnum(EModularButtonEventHandler))]
50  protected EModularButtonEventHandler m_eEventReturnValue;
51 
52  [Attribute("false", UIWidgets.CheckBox, "The button will be focused on mouse enter events")]
53  protected bool m_bFocusOnMouseEnter;
54 
55  [Attribute("false", UIWidgets.CheckBox, "Mouse over, focus, clicks, etc, will be completely ignored. Useful to create a button driven by SlaveButton effect.")]
56  protected bool m_bIgnoreStandardInputs;
57 
58  // Script invokers
59 
60  ref ScriptInvoker m_OnClicked = new ScriptInvoker(); // (SCR_ModularButtonComponent comp)
61  ref ScriptInvoker m_OnDoubleClicked = new ScriptInvoker(); // (SCR_ModularButtonComponent comp)
62  ref ScriptInvoker m_OnToggled = new ScriptInvoker(); // (SCR_ModularButtonComponent comp, bool newToggled)
63  ref ScriptInvoker m_OnFocus = new ScriptInvoker(); // (SCR_ModularButtonComponent comp)
64  ref ScriptInvoker m_OnFocusLost = new ScriptInvoker(); // (SCR_ModularButtonComponent comp)
65  ref ScriptInvoker m_OnMouseEnter = new ScriptInvoker(); // (SCR_ModularButtonComponent comp, bool mouseInput) - mouseEvent - when true, last input was from a mouse, not keyboard/gamepad.
66  ref ScriptInvoker m_OnMouseLeave = new ScriptInvoker(); // (SCR_ModularButtonComponent comp, bool mouseInput)
67 
68  // ---- Protected ----
69 
70  // Widgets
71  protected Widget m_wRoot;
72 
73  // Internal state
74  protected bool m_bFocus;
75  protected bool m_bMouseOver;
76  protected bool m_bToggled;
78 
79  // Other
80  protected ref Managed m_UserData; // User data - can be accessed with SetData, GetData
81 
82  // ------------------------------- Public -----------------------------------
83 
84  //------------------------------------------------------------------------------------------------
88  static SCR_ModularButtonComponent FindComponent(Widget w)
89  {
90  return SCR_ModularButtonComponent.Cast(w.FindHandler(SCR_ModularButtonComponent));
91  }
92 
93  //------------------------------------------------------------------------------------------------
95  void SetEnabled(bool enabled)
96  {
97  #ifdef DEBUG_MODULAR_BUTTON
98  _print(string.Format("SetEnabled: %1", enabled));
99  #endif
100 
101  m_wRoot.SetEnabled(enabled);
103  }
104 
105  //------------------------------------------------------------------------------------------------
107  bool GetEnabled()
108  {
109  return m_wRoot.IsEnabled();
110  }
111 
112  //------------------------------------------------------------------------------------------------
115  void SetToggled(bool toggled, bool invokeOnToggled = true)
116  {
117  #ifdef DEBUG_MODULAR_BUTTON
118  _print(string.Format("SetToggled: %1", toggled));
119  #endif
120 
121  if (!m_bCanBeToggled)
122  return;
123 
124  Internal_SetToggled(toggled, invokeOnToggled);
125  }
126 
127  //------------------------------------------------------------------------------------------------
129  bool GetToggled()
130  {
131  return m_bToggled;
132  }
133 
134  //------------------------------------------------------------------------------------------------
136  bool GetFocused()
137  {
138  return m_bFocus;
139  }
140 
141  //------------------------------------------------------------------------------------------------
144  {
145  return m_bMouseOver;
146  }
147 
148  //------------------------------------------------------------------------------------------------
150  void SetToggleable(bool toggleable)
151  {
152  m_bCanBeToggled = toggleable;
153  }
154 
155  //------------------------------------------------------------------------------------------------
157  void SetTogglableOnlyThroughApi(bool newValue)
158  {
159  m_bToggledOnlyThroughApi = newValue;
160  }
161 
162  //------------------------------------------------------------------------------------------------
164  void SetData(Managed data)
165  {
166  m_UserData = data;
167  }
168 
169  //------------------------------------------------------------------------------------------------
171  Managed GetData()
172  {
173  return m_UserData;
174  }
175 
176  //------------------------------------------------------------------------------------------------
178  Widget GetRootWidget()
179  {
180  return m_wRoot;
181  }
182 
183  //------------------------------------------------------------------------------------------------
186  bool SetVisible(bool visible)
187  {
188  if (!m_wRoot)
189  return false;
190 
191  m_wRoot.SetVisible(visible);
192 
193  return true;
194  }
195 
196  //------------------------------------------------------------------------------------------------
200  SCR_ButtonEffectBase FindEffect(string tag)
201  {
202  foreach (SCR_ButtonEffectBase e : m_aEffects)
203  {
204  if (e.m_aTags.Contains(tag))
205  return e;
206  }
207 
208  return null;
209  }
210 
211  //------------------------------------------------------------------------------------------------
214  array<SCR_ButtonEffectBase> FindAllEffects(string tag)
215  {
216  array<SCR_ButtonEffectBase> effects = {};
217  foreach (SCR_ButtonEffectBase e : m_aEffects)
218  {
219  if (e.m_aTags.Contains(tag))
220  effects.Insert(e);
221  }
222 
223  return effects;
224  }
225 
226  //------------------------------------------------------------------------------------------------
228  array<SCR_ButtonEffectBase> GetAllEffects()
229  {
230  array<SCR_ButtonEffectBase> effects = {};
231  foreach (SCR_ButtonEffectBase e : m_aEffects)
232  {
233  effects.Insert(e);
234  }
235 
236  return effects;
237  }
238 
239  //------------------------------------------------------------------------------------------------
243  void SetEffectsEnabled(string tag, bool enable)
244  {
245  #ifdef DEBUG_MODULAR_BUTTON
246  _print(string.Format("SetEffectsEnabled: %1, %2", tag, enable));
247  #endif
248 
249  foreach (SCR_ButtonEffectBase e : m_aEffects)
250  {
251  if (e.m_aTags.Contains(tag))
252  e.SetEnabled(enable);
253  }
254  }
255 
256  //------------------------------------------------------------------------------------------------
259  void SetEffectsWithAnyTagEnabled(notnull array<string> tags)
260  {
261  foreach (SCR_ButtonEffectBase e : m_aEffects)
262  {
263  bool found = false;
264  foreach (string tag : tags)
265  {
266  if (e.m_aTags.Contains(tag))
267  {
268  found = true;
269  break;
270  }
271  }
272 
273  e.SetEnabled(found);
274  }
275  }
276 
277  //------------------------------------------------------------------------------------------------
280  void SetAllEffectsEnabled(bool enable)
281  {
282  #ifdef DEBUG_MODULAR_BUTTON
283  _print(string.Format("SetAllEffectsEnabled: %1", enable));
284  #endif
285 
286  foreach (SCR_ButtonEffectBase e : m_aEffects)
287  {
288  e.SetEnabled(enable);
289  }
290  }
291 
292  //------------------------------------------------------------------------------------------------
295  void InvokeAllEnabledEffects(bool instant)
296  {
298  InvokeEffectsEvent(state, instant);
299 
300  if (m_bCanBeToggled)
301  {
302  if (m_bToggled)
303  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_TOGGLED_ON, instant);
304  else
305  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_TOGGLED_OFF, instant);
306  }
307 
308  if (m_bFocus)
309  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_FOCUS_GAINED, instant);
310  else
311  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_FOCUS_LOST, instant);
312  }
313 
314  // ------------------------ Protected -------------------------------------
315 
316  //------------------------------------------------------------------------------------------------
318  protected void UpdateCurrentState()
319  {
321  EModularButtonState oldState = m_eState;
322  m_eState = newState;
323 
324  #ifdef DEBUG_MODULAR_BUTTON
325  _print(string.Format("UpdateCurrentState: old: %1, new: %2", typename.EnumToString(EModularButtonState, oldState), typename.EnumToString(EModularButtonState, newState)));
326  #endif
327 
328  if (newState != oldState)
329  InvokeEffectsEvent(newState);
330  }
331 
332  //------------------------------------------------------------------------------------------------
335  {
336  if (m_wRoot.IsEnabled())
337  {
338  // Enabled
339 
340  if (m_bCanBeToggled)
341  {
342  if (m_bToggled)
343  {
344  if (m_bMouseOver)
345  return EModularButtonState.STATE_ACTIVATED_HOVERED;
346  else
347  return EModularButtonState.STATE_ACTIVATED;
348  }
349  else
350  {
351  if (m_bMouseOver)
352  return EModularButtonState.STATE_HOVERED;
353  else
354  return EModularButtonState.STATE_DEFAULT;
355  }
356  }
357  else
358  {
359  // Non toggleable
360  if (m_bMouseOver)
361  return EModularButtonState.STATE_HOVERED;
362  else
363  return EModularButtonState.STATE_DEFAULT;
364  }
365  }
366  else
367  {
368  // Disabled
369 
370  if (m_bCanBeToggled)
371  {
372  if (m_bToggled)
373  return EModularButtonState.STATE_DISABLED_ACTIVATED;
374  else
375  return EModularButtonState.STATE_DISABLED;
376  }
377  else
378  return EModularButtonState.STATE_DISABLED;
379  }
380 
381  return EModularButtonState.STATE_DEFAULT;
382  }
383 
384  //------------------------------------------------------------------------------------------------
388  protected void InvokeEffectsEvent(EModularButtonEventFlag eventFlag, bool instant = false)
389  {
390  EInputDeviceType deviceType = GetGame().GetInputManager().GetLastUsedInputDevice();
391 
392  #ifdef DEBUG_MODULAR_BUTTON
393  _print(string.Format("InvokeEffectsEvent: %1, %2", typename.EnumToString(EModularButtonEventFlag, eventFlag), typename.EnumToString(EInputDeviceType, deviceType)));
394  #endif
395 
396  foreach (SCR_ButtonEffectBase effect : m_aEffects)
397  {
398  if (effect.GetEnabled())
399  effect.Internal_OnEvent(eventFlag, deviceType, instant);
400  }
401  }
402 
403  //------------------------------------------------------------------------------------------------
409  {
410  InvokeEffectsEvent(eventFlag, instant);
411  }
412 
413  //------------------------------------------------------------------------------------------------
414  protected void Internal_SetToggled(bool newToggled, bool invokeOnToggled = true)
415  {
416  bool oldToggled = m_bToggled;
417  m_bToggled = newToggled;
418 
419  if (newToggled != oldToggled)
420  {
421  if (newToggled)
423  else
424  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_TOGGLED_OFF);
425  }
426 
428 
429  if (invokeOnToggled && newToggled != oldToggled)
430  m_OnToggled.Invoke(this, newToggled);
431  }
432 
433  //------------------------------------------------------------------------------------------------
436  void Internal_OnEffectEnabled(SCR_ButtonEffectBase effect)
437  {
439  EInputDeviceType deviceType = GetGame().GetInputManager().GetLastUsedInputDevice();
440  effect.Internal_OnEvent(state, deviceType, true);
441 
442  if (m_bCanBeToggled)
443  {
444  if (m_bToggled)
445  effect.Internal_OnEvent(EModularButtonEventFlag.EVENT_TOGGLED_ON, deviceType, true);
446  else
447  effect.Internal_OnEvent(EModularButtonEventFlag.EVENT_TOGGLED_OFF, deviceType, true);
448  }
449 
450  if (m_bFocus)
451  effect.Internal_OnEvent(EModularButtonEventFlag.EVENT_FOCUS_GAINED, deviceType, true);
452  else
453  effect.Internal_OnEvent(EModularButtonEventFlag.EVENT_FOCUS_LOST, deviceType, true);
454  }
455 
456  // --------- Event Handlers ------------
457 
458  //------------------------------------------------------------------------------------------------
459  override void HandlerAttached(Widget w)
460  {
461  m_wRoot = w;
462 
463  // Initialize effects
464  foreach (SCR_ButtonEffectBase effect : m_aEffects)
465  {
466  effect.Init(this);
467  effect.OnHandlerAttached(w);
468  }
469 
471 
472  m_bFocus = GetGame().GetWorkspace().GetFocusedWidget() == m_wRoot;
473 
474  // Iterate all effects, make sure that there are no effects which are affecting same widget,
475  // have same type and receive same event types
476  array<ref Tuple3<Widget, typename, int>> widgetEffectEventMasks = {};
477  foreach (SCR_ButtonEffectBase effect : m_aEffects)
478  {
479  SCR_ButtonEffectWidgetBase widgetEffect = SCR_ButtonEffectWidgetBase.Cast(effect);
480  if (effect.GetEnabled() && widgetEffect)
481  {
482  // Find entry with this widget, effect type, and event mask which intersects with event mask of this effect
483  bool disabled = false;
484  foreach (Tuple3<Widget, typename, int> i : widgetEffectEventMasks)
485  {
486  if (i.param1 == widgetEffect.GetTargetWidget() &&
487  i.param2 == widgetEffect.Type() &&
488  (i.param3 & widgetEffect.m_eEvents))
489  {
490  disabled = true;
491  widgetEffect.SetEnabled(false);
492  break;
493  }
494  }
495 
496  // If this effect is enabled, record what events it listens to.
497  if (!disabled)
498  {
499  // Find entry with this widget and effect type
500  Tuple3<Widget, typename, int> entry;
501  foreach (Tuple3<Widget, typename, int> i : widgetEffectEventMasks)
502  {
503  if (i.param1 == widgetEffect.GetTargetWidget() &&
504  i.param2 == widgetEffect.Type())
505  {
506  entry = i;
507  break;
508  }
509  }
510 
511  if (!entry)
512  {
513  entry = new Tuple3<Widget, typename, int>(widgetEffect.GetTargetWidget(), widgetEffect.Type(), 0);
514  widgetEffectEventMasks.Insert(entry);
515  }
516 
517  entry.param3 = entry.param3 | widgetEffect.m_eEvents;
518  }
519  }
520  }
521 
522  // Invoke effects at start
523  InvokeAllEnabledEffects(instant : true);
524  }
525 
526  //------------------------------------------------------------------------------------------------
527  override bool OnClick(Widget w, int x, int y, int button)
528  {
529  #ifdef DEBUG_MODULAR_BUTTON
530  _print("OnClick");
531  #endif
532 
533  // Auto focus is focusable
534  if (m_wRoot.IsFocusable())
535  {
536  WorkspaceWidget workspace = GetGame().GetWorkspace();
537  Widget currentFocus = workspace.GetFocusedWidget();
538  if (currentFocus != m_wRoot)
539  workspace.SetFocusedWidget(m_wRoot);
540  }
541 
542  bool eventReturnValue = m_eEventReturnValue & EModularButtonEventHandler.CLICK;
543 
545  return eventReturnValue;
546 
549 
551 
553  InvokeEffectsEvent(state);
554 
555  m_OnClicked.Invoke(this);
556 
557  return eventReturnValue;
558  }
559 
560  //------------------------------------------------------------------------------------------------
561  override bool OnDoubleClick(Widget w, int x, int y, int button)
562  {
564  return m_eEventReturnValue & EModularButtonEventHandler.DOUBLE_CLICK;
565 
566  m_OnDoubleClicked.Invoke(this);
567  return m_eEventReturnValue & EModularButtonEventHandler.DOUBLE_CLICK;
568  }
569 
570  //------------------------------------------------------------------------------------------------
571  override bool OnMouseEnter(Widget w, int x, int y)
572  {
573  #ifdef DEBUG_MODULAR_BUTTON
574  _print("OnMouseEnter");
575  #endif
576 
578  return m_eEventReturnValue & EModularButtonEventHandler.MOUSE_ENTER;
579 
580  m_bMouseOver = true;
581 
583 
584  EInputDeviceType lastInput = GetGame().GetInputManager().GetLastUsedInputDevice();
585  bool mouseInput = lastInput == EInputDeviceType.MOUSE;
586 
588  {
589  if (mouseInput)
590  GetGame().GetWorkspace().SetFocusedWidget(m_wRoot);
591  }
592 
593  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_MOUSE_ENTER);
594 
595  m_OnMouseEnter.Invoke(this, mouseInput);
596 
597  return m_eEventReturnValue & EModularButtonEventHandler.MOUSE_ENTER;
598  }
599 
600  //------------------------------------------------------------------------------------------------
601  override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
602  {
603  #ifdef DEBUG_MODULAR_BUTTON
604  _print("OnMouseLeave");
605  #endif
606 
608  return m_eEventReturnValue & EModularButtonEventHandler.MOUSE_LEAVE;
609 
610  m_bMouseOver = false;
611 
613 
614  EInputDeviceType lastInput = GetGame().GetInputManager().GetLastUsedInputDevice();
615  bool mouseInput = lastInput == EInputDeviceType.MOUSE;
616 
617  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_MOUSE_LEAVE);
618 
619  m_OnMouseLeave.Invoke(this, mouseInput);
620 
621  return m_eEventReturnValue & EModularButtonEventHandler.MOUSE_LEAVE;
622  }
623 
624  //------------------------------------------------------------------------------------------------
625  override bool OnFocus(Widget w, int x, int y)
626  {
627  #ifdef DEBUG_MODULAR_BUTTON
628  _print("%1 OnFocus");
629  #endif
630 
632  return m_eEventReturnValue & EModularButtonEventHandler.FOCUS_GAINED;
633 
634  m_bFocus = true;
635 
636  m_OnFocus.Invoke(this);
637 
638  InvokeEffectsEvent(EModularButtonEventFlag.EVENT_FOCUS_GAINED);
639 
640  return m_eEventReturnValue & EModularButtonEventHandler.FOCUS_GAINED;
641  }
642 
643  //------------------------------------------------------------------------------------------------
644  override bool OnFocusLost(Widget w, int x, int y)
645  {
646  #ifdef DEBUG_MODULAR_BUTTON
647  _print("%1 OnFocusLost");
648  #endif
649 
651  return m_eEventReturnValue & EModularButtonEventHandler.FOCUS_LOST;
652 
653  m_bFocus = false;
654 
655  m_OnFocusLost.Invoke(this);
656 
658 
659  return m_eEventReturnValue & EModularButtonEventHandler.FOCUS_LOST;
660  }
661 
662  //------------------------------------------------------------------------------------------------
665  void _print(string s)
666  {
667  Print(string.Format("[SCR_ModularButtonComponent] %1: %2", GetRootWidget().GetName(), s), LogLevel.NORMAL);
668  }
669 
670  //------------------------------------------------------------------------------------------------
673  {
674  return m_bFocusOnMouseEnter;
675  }
676 
677  //------------------------------------------------------------------------------------------------
679  void SetIsFocusOnMouseEnter(bool focus)
680  {
681  m_bFocusOnMouseEnter = focus;
682  }
683 
684  //------------------------------------------------------------------------------------------------
687  {
688  return typename.EnumToString(EModularButtonState, m_eState);
689  }
690 }
SetEffectsEnabled
void SetEffectsEnabled(string tag, bool enable)
Definition: SCR_ModularButtonComponent.c:243
SetAllEffectsEnabled
void SetAllEffectsEnabled(bool enable)
Definition: SCR_ModularButtonComponent.c:280
HandlerAttached
override void HandlerAttached(Widget w)
Definition: SCR_ModularButtonComponent.c:459
InvokeEffectsEvent
protected void InvokeEffectsEvent(EModularButtonEventFlag eventFlag, bool instant=false)
Definition: SCR_ModularButtonComponent.c:388
GetName
string GetName()
Definition: SCR_ScenarioFrameworkLayerBase.c:85
OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition: SCR_ModularButtonComponent.c:527
GetToggled
bool GetToggled()
Definition: SCR_ModularButtonComponent.c:129
m_eEventReturnValue
protected EModularButtonEventHandler m_eEventReturnValue
Definition: SCR_ModularButtonComponent.c:50
FOCUS_GAINED
enum EModularButtonState FOCUS_GAINED
GetFocused
bool GetFocused()
Definition: SCR_ModularButtonComponent.c:136
m_bIgnoreStandardInputs
protected bool m_bIgnoreStandardInputs
Definition: SCR_ModularButtonComponent.c:56
_print
void _print(string s)
Definition: SCR_ModularButtonComponent.c:665
m_eState
protected EModularButtonState m_eState
Definition: SCR_ModularButtonComponent.c:77
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_bCanBeToggled
protected bool m_bCanBeToggled
Definition: SCR_ModularButtonComponent.c:41
STATE_ACTIVATED_HOVERED
STATE_ACTIVATED_HOVERED
Activated and hovered.
Definition: SCR_ModularButtonComponent.c:5
m_bFocusOnMouseEnter
protected bool m_bFocusOnMouseEnter
Definition: SCR_ModularButtonComponent.c:53
SetTogglableOnlyThroughApi
void SetTogglableOnlyThroughApi(bool newValue)
Definition: SCR_ModularButtonComponent.c:157
EModularButtonEventFlag
EModularButtonEventFlag
Definition: SCR_ButtonEffectBase.c:5
STATE_HOVERED
STATE_HOVERED
Hovered.
Definition: SCR_ModularButtonComponent.c:3
GetRootWidget
Widget GetRootWidget()
Definition: SCR_ModularButtonComponent.c:178
m_OnMouseEnter
ref ScriptInvoker m_OnMouseEnter
Definition: SCR_ModularButtonComponent.c:65
m_bToggled
protected bool m_bToggled
Definition: SCR_ModularButtonComponent.c:76
GetEnabled
bool GetEnabled()
Definition: SCR_ModularButtonComponent.c:107
UpdateCurrentState
protected void UpdateCurrentState()
Checks current state, invokes state change effects if state has changed.
Definition: SCR_ModularButtonComponent.c:318
m_OnFocusLost
ref ScriptInvoker m_OnFocusLost
Definition: SCR_ModularButtonComponent.c:64
FOCUS_LOST
enum EModularButtonState FOCUS_LOST
GetCurrentStateName
string GetCurrentStateName()
Definition: SCR_ModularButtonComponent.c:686
OnMouseEnter
override bool OnMouseEnter(Widget w, int x, int y)
Definition: SCR_ModularButtonComponent.c:571
SetToggleable
void SetToggleable(bool toggleable)
Definition: SCR_ModularButtonComponent.c:150
CLICK
enum EModularButtonState CLICK
Enum corresponding Enfusion native event types.
m_bToggledOnlyThroughApi
protected bool m_bToggledOnlyThroughApi
Definition: SCR_ModularButtonComponent.c:44
MOUSE_ENTER
enum EModularButtonState MOUSE_ENTER
Attribute
enum EModularButtonState Attribute()] protected ref array< ref SCR_ButtonEffectBase > m_aEffects
Post-process effect of scripted camera.
m_bMouseOver
protected bool m_bMouseOver
Definition: SCR_ModularButtonComponent.c:75
EModularButtonState
EModularButtonState
Definition: SCR_ModularButtonComponent.c:6
Internal_SetToggled
protected void Internal_SetToggled(bool newToggled, bool invokeOnToggled=true)
Definition: SCR_ModularButtonComponent.c:414
GetCurrentState
protected EModularButtonState GetCurrentState()
Definition: SCR_ModularButtonComponent.c:334
SetIsFocusOnMouseEnter
void SetIsFocusOnMouseEnter(bool focus)
Definition: SCR_ModularButtonComponent.c:679
SetEnabled
void SetEnabled(bool enabled)
Definition: SCR_ModularButtonComponent.c:95
m_OnDoubleClicked
ref ScriptInvoker m_OnDoubleClicked
Definition: SCR_ModularButtonComponent.c:61
DOUBLE_CLICK
enum EModularButtonState DOUBLE_CLICK
SetToggled
void SetToggled(bool toggled, bool invokeOnToggled=true)
Definition: SCR_ModularButtonComponent.c:115
m_bFocus
protected bool m_bFocus
Definition: SCR_ModularButtonComponent.c:74
SetVisible
bool SetVisible(bool visible)
Definition: SCR_ModularButtonComponent.c:186
STATE_DISABLED_ACTIVATED
STATE_DISABLED_ACTIVATED
Disabled and activated.
Definition: SCR_ModularButtonComponent.c:7
InvokeAllEnabledEffects
void InvokeAllEnabledEffects(bool instant)
Definition: SCR_ModularButtonComponent.c:295
Internal_OnMasterButtonEvent
void Internal_OnMasterButtonEvent(EModularButtonEventFlag eventFlag, bool instant)
Definition: SCR_ModularButtonComponent.c:408
GetMouseOver
bool GetMouseOver()
Definition: SCR_ModularButtonComponent.c:143
GetData
Managed GetData()
Definition: SCR_ModularButtonComponent.c:171
FindAllEffects
array< SCR_ButtonEffectBase > FindAllEffects(string tag)
Definition: SCR_ModularButtonComponent.c:214
GetIsFocusOnMouseEnter
bool GetIsFocusOnMouseEnter()
Definition: SCR_ModularButtonComponent.c:672
MOUSE_LEAVE
enum EModularButtonState MOUSE_LEAVE
FindEffect
SCR_ButtonEffectBase FindEffect(string tag)
Definition: SCR_ModularButtonComponent.c:200
Internal_OnEffectEnabled
void Internal_OnEffectEnabled(SCR_ButtonEffectBase effect)
Definition: SCR_ModularButtonComponent.c:436
OnDoubleClick
override bool OnDoubleClick(Widget w, int x, int y, int button)
Definition: SCR_ModularButtonComponent.c:561
m_bToggledAtStart
protected bool m_bToggledAtStart
Definition: SCR_ModularButtonComponent.c:47
SetData
void SetData(Managed data)
Definition: SCR_ModularButtonComponent.c:164
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
m_OnFocus
ref ScriptInvoker m_OnFocus
Definition: SCR_ModularButtonComponent.c:63
m_wRoot
protected Widget m_wRoot
Definition: SCR_ModularButtonComponent.c:71
STATE_DEFAULT
STATE_DEFAULT
Default state.
Definition: SCR_ModularButtonComponent.c:2
OnFocus
override bool OnFocus(Widget w, int x, int y)
Definition: SCR_ModularButtonComponent.c:625
m_aEffects
protected ref array< ref SCR_BaseEntitiesEditorUIEffect > m_aEffects
Definition: SCR_EntitiesEditorUIComponent.c:3
m_UserData
protected ref Managed m_UserData
Definition: SCR_ModularButtonComponent.c:80
STATE_DISABLED
STATE_DISABLED
Disabled.
Definition: SCR_ModularButtonComponent.c:6
OnFocusLost
override bool OnFocusLost(Widget w, int x, int y)
Definition: SCR_ModularButtonComponent.c:644
SetEffectsWithAnyTagEnabled
void SetEffectsWithAnyTagEnabled(notnull array< string > tags)
Definition: SCR_ModularButtonComponent.c:259
m_OnClicked
ref ScriptInvoker m_OnClicked
Definition: SCR_ModularButtonComponent.c:60
m_OnMouseLeave
ref ScriptInvoker m_OnMouseLeave
Definition: SCR_ModularButtonComponent.c:66
GetAllEffects
array< SCR_ButtonEffectBase > GetAllEffects()
Definition: SCR_ModularButtonComponent.c:228
STATE_ACTIVATED
STATE_ACTIVATED
Activated.
Definition: SCR_ModularButtonComponent.c:4
m_OnToggled
ref ScriptInvoker m_OnToggled
Definition: SCR_ModularButtonComponent.c:62
OnMouseLeave
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Definition: SCR_ModularButtonComponent.c:601