Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ButtonEffectSlaveButton.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot : true), SCR_ButtonEffectTitleAttribute("SlaveButton", "m_sWidgetName")]
3 class SCR_ButtonEffectSlaveButton : SCR_ButtonEffectWidgetBase
4 {
5  protected SCR_ModularButtonComponent m_targetComponent;
6 
7  //------------------------------------------------------------------------------------------------
9  void SetTargetWidget(Widget targetWidget)
10  {
11  m_wTarget = targetWidget;
12  SCR_ModularButtonComponent targetComp = SCR_ModularButtonComponent.Cast(m_wTarget.FindHandler(SCR_ModularButtonComponent));
13  m_targetComponent = targetComp;
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override void OnHandlerAttached(Widget w)
18  {
19  super.OnHandlerAttached(w);
20 
21  if (m_wTarget)
22  m_targetComponent = SCR_ModularButtonComponent.Cast(m_wTarget.FindHandler(SCR_ModularButtonComponent));
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  override void OnStateDefault(bool instant)
27  {
28  if (!m_targetComponent)
29  return;
30 
31  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.STATE_DEFAULT, instant);
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  override void OnStateHovered(bool instant)
36  {
37  if (!m_targetComponent)
38  return;
39 
40  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.STATE_HOVERED, instant);
41  }
42 
43  //------------------------------------------------------------------------------------------------
44  override void OnStateActivated(bool instant)
45  {
46  if (!m_targetComponent)
47  return;
48 
49  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.STATE_ACTIVATED, instant);
50  }
51 
52  //------------------------------------------------------------------------------------------------
53  override void OnStateActivatedHovered(bool instant)
54  {
55  if (!m_targetComponent)
56  return;
57 
58  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.STATE_ACTIVATED_HOVERED, instant);
59  }
60 
61  //------------------------------------------------------------------------------------------------
62  override void OnStateDisabled(bool instant)
63  {
64  if (!m_targetComponent)
65  return;
66 
67  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.STATE_DISABLED, instant);
68  }
69 
70  //------------------------------------------------------------------------------------------------
71  override void OnStateDisabledActivated(bool instant)
72  {
73  if (!m_targetComponent)
74  return;
75 
76  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.STATE_DISABLED_ACTIVATED, instant);
77  }
78 
79  //------------------------------------------------------------------------------------------------
80  override void OnClicked(bool instant)
81  {
82  if (!m_targetComponent)
83  return;
84 
85  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.EVENT_CLICKED, instant);
86  }
87 
88  //------------------------------------------------------------------------------------------------
89  override void OnFocusGained(bool instant)
90  {
91  if (!m_targetComponent)
92  return;
93 
94  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.EVENT_FOCUS_GAINED, instant);
95  }
96 
97  //------------------------------------------------------------------------------------------------
98  override void OnFocusLost(bool instant)
99  {
100  if (!m_targetComponent)
101  return;
102 
103  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.EVENT_FOCUS_LOST, instant);
104  }
105 
106  //------------------------------------------------------------------------------------------------
107  override void OnToggledOn(bool instant)
108  {
109  if (!m_targetComponent)
110  return;
111 
112  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.EVENT_TOGGLED_ON, instant);
113  }
114 
115  //------------------------------------------------------------------------------------------------
116  override void OnToggledOff(bool instant)
117  {
118  if (!m_targetComponent)
119  return;
120 
121  m_targetComponent.Internal_OnMasterButtonEvent(EModularButtonEventFlag.EVENT_TOGGLED_OFF, instant);
122  }
123 }
EModularButtonEventFlag
EModularButtonEventFlag
Definition: SCR_ButtonEffectBase.c:5
SCR_ButtonEffectSlaveButton
Effect which passes all subscribed events to another modular button.
Definition: SCR_ButtonEffectSlaveButton.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