Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MenuHelper.c
Go to the documentation of this file.
1 void ScriptInvokerActiveWidgetInteractionMethod(bool isActive, int delay);
4 typedef ScriptInvokerBase<ScriptInvokerActiveWidgetInteractionMethod> ScriptInvokerActiveWidgetInteraction;
5 
8 typedef ScriptInvokerBase<ScriptInvokerDialogMethod> ScriptInvokerDialog;
9 
12 typedef ScriptInvokerBase<ScriptInvokerMenuMethod> ScriptInvokerMenu;
13 
14 //------------------------------------------------------------------------------------------------
16 {
17  protected static ref ScriptInvokerActiveWidgetInteraction m_OnActiveWidgetInteraction;
18  protected static ref ScriptInvokerDialog m_OnDialogOpen;
19  protected static ref ScriptInvokerDialog m_OnDialogClose;
20  protected static ref ScriptInvokerMenu m_OnMenuOpen;
21  protected static ref ScriptInvokerMenu m_OnMenuOpened;
22  protected static ref ScriptInvokerMenu m_OnMenuClose;
23  protected static ref ScriptInvokerMenu m_OnMenuFocusGained;
24  protected static ref ScriptInvokerMenu m_OnMenuFocusLost;
25  protected static ref ScriptInvokerMenu m_OnMenuShow;
26  protected static ref ScriptInvokerMenu m_OnMenuHide;
27  protected static ref ScriptInvokerMenu m_OnTabChange;
28 
29  // ---- Invokers ----
30  //------------------------------------------------------------------------------------------------
31  static ScriptInvokerActiveWidgetInteraction GetOnActiveWidgetInteraction()
32  {
33  if (!m_OnActiveWidgetInteraction)
34  m_OnActiveWidgetInteraction = new ScriptInvokerActiveWidgetInteraction();
35 
36  return m_OnActiveWidgetInteraction;
37  }
38 
39  //------------------------------------------------------------------------------------------------
40  static ScriptInvokerDialog GetOnDialogOpen()
41  {
42  if (!m_OnDialogOpen)
43  m_OnDialogOpen = new ScriptInvokerDialog();
44 
45  return m_OnDialogOpen;
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  static ScriptInvokerDialog GetOnDialogClose()
50  {
51  if (!m_OnDialogClose)
52  m_OnDialogClose = new ScriptInvokerDialog();
53 
54  return m_OnDialogClose;
55  }
56 
57  //------------------------------------------------------------------------------------------------
58  static ScriptInvokerMenu GetOnMenuOpen()
59  {
60  if (!m_OnMenuOpen)
61  m_OnMenuOpen = new ScriptInvokerMenu();
62 
63  return m_OnMenuOpen;
64  }
65 
66  //------------------------------------------------------------------------------------------------
67  static ScriptInvokerMenu GetOnMenuOpened()
68  {
69  if (!m_OnMenuOpened)
70  m_OnMenuOpened = new ScriptInvokerMenu();
71 
72  return m_OnMenuOpened;
73  }
74 
75  //------------------------------------------------------------------------------------------------
76  static ScriptInvokerMenu GetOnMenuClose()
77  {
78  if (!m_OnMenuClose)
79  m_OnMenuClose = new ScriptInvokerMenu();
80 
81  return m_OnMenuClose;
82  }
83 
84  //------------------------------------------------------------------------------------------------
85  static ScriptInvokerMenu GetOnMenuFocusGained()
86  {
87  if (!m_OnMenuFocusGained)
88  m_OnMenuFocusGained = new ScriptInvokerMenu();
89 
90  return m_OnMenuFocusGained;
91  }
92 
93  //------------------------------------------------------------------------------------------------
94  static ScriptInvokerMenu GetOnMenuFocusLost()
95  {
96  if (!m_OnMenuFocusLost)
97  m_OnMenuFocusLost = new ScriptInvokerMenu();
98 
99  return m_OnMenuFocusLost;
100  }
101 
102  //------------------------------------------------------------------------------------------------
103  static ScriptInvokerMenu GetOnMenuShow()
104  {
105  if (!m_OnMenuShow)
106  m_OnMenuShow = new ScriptInvokerMenu();
107 
108  return m_OnMenuShow;
109  }
110 
111  //------------------------------------------------------------------------------------------------
112  static ScriptInvokerMenu GetOnMenuHide()
113  {
114  if (!m_OnMenuHide)
115  m_OnMenuHide = new ScriptInvokerMenu();
116 
117  return m_OnMenuHide;
118  }
119 
120  //------------------------------------------------------------------------------------------------
121  static ScriptInvokerMenu GetOnTabChange()
122  {
123  if (!m_OnTabChange)
125 
126  return m_OnTabChange;
127  }
128 
129  // ---- Methods ----
130  //------------------------------------------------------------------------------------------------
133  static void SetActiveWidgetInteractionState(bool isActive, int delay = 0)
134  {
135  if (m_OnActiveWidgetInteraction)
136  m_OnActiveWidgetInteraction.Invoke(isActive, delay);
137  }
138 
139  //------------------------------------------------------------------------------------------------
141  static bool IsInTopMenu(notnull Widget componentRoot)
142  {
143  MenuManager menuManager = GetGame().GetMenuManager();
144  if (!menuManager)
145  return false;
146 
147  return menuManager.GetOwnerMenu(componentRoot) == menuManager.GetTopMenu();
148  }
149 
150  // -- Calls --
151  //------------------------------------------------------------------------------------------------
156  static void OnDialogOpen(DialogUI dialog)
157  {
158  if (m_OnDialogOpen)
159  m_OnDialogOpen.Invoke(dialog);
160  }
161 
162  //------------------------------------------------------------------------------------------------
164  static void OnDialogClose(DialogUI dialog)
165  {
166  if (m_OnDialogClose)
167  m_OnDialogClose.Invoke(dialog);
168  }
169 
170  //------------------------------------------------------------------------------------------------
173  static void OnMenuOpen(ChimeraMenuBase menu)
174  {
175  if (m_OnMenuOpen)
176  m_OnMenuOpen.Invoke(menu);
177  }
178 
179  //------------------------------------------------------------------------------------------------
181  static void OnMenuOpened(ChimeraMenuBase menu)
182  {
183  if (m_OnMenuOpened)
184  m_OnMenuOpened.Invoke(menu);
185  }
186 
187  //------------------------------------------------------------------------------------------------
189  static void OnMenuClose(ChimeraMenuBase menu)
190  {
191  if (m_OnMenuClose)
192  m_OnMenuClose.Invoke(menu);
193  }
194 
195  //------------------------------------------------------------------------------------------------
197  static void OnMenuFocusGained(ChimeraMenuBase menu)
198  {
199  if (m_OnMenuFocusGained)
200  m_OnMenuFocusGained.Invoke(menu);
201  }
202 
203  //------------------------------------------------------------------------------------------------
205  static void OnMenuFocusLost(ChimeraMenuBase menu)
206  {
207  if (m_OnMenuFocusLost)
208  m_OnMenuFocusLost.Invoke(menu);
209  }
210 
211  //------------------------------------------------------------------------------------------------
213  static void OnMenuShow(ChimeraMenuBase menu)
214  {
215  if (m_OnMenuShow)
216  m_OnMenuShow.Invoke(menu);
217  }
218 
219  //------------------------------------------------------------------------------------------------
221  static void OnMenuHide(ChimeraMenuBase menu)
222  {
223  if (m_OnMenuHide)
224  m_OnMenuHide.Invoke(menu);
225  }
226 
227  //------------------------------------------------------------------------------------------------
229  static void OnTabChange(ChimeraMenuBase menu)
230  {
231  if (m_OnTabChange)
232  m_OnTabChange.Invoke(menu);
233  }
234 }
235 
236 //------------------------------------------------------------------------------------------------
237 enum SCR_EListMenuWidgetFocus
238 {
239  LIST = 0,
240  FILTERING = 1,
241  SORTING = 2,
242  FALLBACK = 3,
243  NULL = 4
244 }
ChimeraMenuBase
Constant variables used in various menus.
Definition: ChimeraMenuBase.c:70
ScriptInvokerMenu
ScriptInvokerBase< ScriptInvokerMenuMethod > ScriptInvokerMenu
Definition: SCR_MenuHelper.c:12
m_OnTabChange
protected ref ScriptInvokerTabView m_OnTabChange
Definition: SCR_TabViewComponent.c:70
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
func
func
Definition: SCR_AIThreatSystem.c:5
ScriptInvokerDialogMethod
func ScriptInvokerDialogMethod
Definition: SCR_MenuHelper.c:7
FALLBACK
class SCR_MenuHelper FALLBACK
NULL
PauseMenuUI NULL
LIST
class SCR_MenuHelper LIST
ScriptInvokerMenuMethod
func ScriptInvokerMenuMethod
Definition: SCR_MenuHelper.c:11
DialogUI
Definition: DialogUI.c:1
SCR_MenuHelper
Definition: SCR_MenuHelper.c:15
FILTERING
class SCR_MenuHelper FILTERING
SORTING
class SCR_MenuHelper SORTING
ScriptInvokerActiveWidgetInteractionMethod
func ScriptInvokerActiveWidgetInteractionMethod
Definition: SCR_MenuHelper.c:3
ScriptInvokerDialog
ScriptInvokerBase< ScriptInvokerDialogMethod > ScriptInvokerDialog
Definition: SCR_MenuHelper.c:8
ScriptInvokerActiveWidgetInteraction
ScriptInvokerBase< ScriptInvokerActiveWidgetInteractionMethod > ScriptInvokerActiveWidgetInteraction
Definition: SCR_MenuHelper.c:4