Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MenuHelper.c
Go to the documentation of this file.
1//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
2// This class was a workaround for the lack of a scripted MenuManager
3
5void ScriptInvokerActiveWidgetInteractionMethod(bool isActive, int delay);
7typedef ScriptInvokerBase<ScriptInvokerActiveWidgetInteractionMethod> ScriptInvokerActiveWidgetInteraction;
8
11typedef ScriptInvokerBase<ScriptInvokerDialogMethod> ScriptInvokerDialog;
12
15typedef ScriptInvokerBase<ScriptInvokerMenuMethod> ScriptInvokerMenu;
16
17//------------------------------------------------------------------------------------------------
19{
21 protected static ref ScriptInvokerDialog m_OnDialogOpen;
23 protected static ref ScriptInvokerMenu m_OnMenuOpen;
24 protected static ref ScriptInvokerMenu m_OnMenuOpened;
25 protected static ref ScriptInvokerMenu m_OnMenuClose;
28 protected static ref ScriptInvokerMenu m_OnMenuShow;
29 protected static ref ScriptInvokerMenu m_OnMenuHide;
30 protected static ref ScriptInvokerTabView m_OnTabChange;
31
32 // ---- Invokers ----
33 //------------------------------------------------------------------------------------------------
41
42 //------------------------------------------------------------------------------------------------
50
51 //------------------------------------------------------------------------------------------------
59
60 //------------------------------------------------------------------------------------------------
62 {
63 if (!m_OnMenuOpen)
65
66 return m_OnMenuOpen;
67 }
68
69 //------------------------------------------------------------------------------------------------
77
78 //------------------------------------------------------------------------------------------------
80 {
81 if (!m_OnMenuClose)
83
84 return m_OnMenuClose;
85 }
86
87 //------------------------------------------------------------------------------------------------
95
96 //------------------------------------------------------------------------------------------------
104
105 //------------------------------------------------------------------------------------------------
107 {
108 if (!m_OnMenuShow)
110
111 return m_OnMenuShow;
112 }
113
114 //------------------------------------------------------------------------------------------------
116 {
117 if (!m_OnMenuHide)
119
120 return m_OnMenuHide;
121 }
122
123 //------------------------------------------------------------------------------------------------
125 {
126 if (!m_OnTabChange)
128
129 return m_OnTabChange;
130 }
131
132 // ---- Methods ----
133 //------------------------------------------------------------------------------------------------
136 static void SetActiveWidgetInteractionState(bool isActive, int delay = 0)
137 {
139 m_OnActiveWidgetInteraction.Invoke(isActive, delay);
140 }
141
142 //------------------------------------------------------------------------------------------------
144 static bool IsInTopMenu(notnull Widget componentRoot)
145 {
146 MenuManager menuManager = GetGame().GetMenuManager();
147 if (!menuManager)
148 return false;
149
150 return menuManager.GetOwnerMenu(componentRoot) == menuManager.GetTopMenu();
151 }
152
153 // -- Calls --
154 //------------------------------------------------------------------------------------------------
159 static void OnDialogOpen(DialogUI dialog)
160 {
161 if (m_OnDialogOpen)
162 m_OnDialogOpen.Invoke(dialog);
163 }
164
165 //------------------------------------------------------------------------------------------------
167 static void OnDialogClose(DialogUI dialog)
168 {
169 if (m_OnDialogClose)
170 m_OnDialogClose.Invoke(dialog);
171 }
172
173 //------------------------------------------------------------------------------------------------
176 static void OnMenuOpen(ChimeraMenuBase menu)
177 {
178 if (m_OnMenuOpen)
179 m_OnMenuOpen.Invoke(menu);
180 }
181
182 //------------------------------------------------------------------------------------------------
185 {
186 if (m_OnMenuOpened)
187 m_OnMenuOpened.Invoke(menu);
188 }
189
190 //------------------------------------------------------------------------------------------------
192 static void OnMenuClose(ChimeraMenuBase menu)
193 {
194 if (m_OnMenuClose)
195 m_OnMenuClose.Invoke(menu);
196 }
197
198 //------------------------------------------------------------------------------------------------
201 {
203 m_OnMenuFocusGained.Invoke(menu);
204 }
205
206 //------------------------------------------------------------------------------------------------
209 {
211 m_OnMenuFocusLost.Invoke(menu);
212 }
213
214 //------------------------------------------------------------------------------------------------
216 static void OnMenuShow(ChimeraMenuBase menu)
217 {
218 if (m_OnMenuShow)
219 m_OnMenuShow.Invoke(menu);
220 }
221
222 //------------------------------------------------------------------------------------------------
224 static void OnMenuHide(ChimeraMenuBase menu)
225 {
226 if (m_OnMenuHide)
227 m_OnMenuHide.Invoke(menu);
228 }
229
230 //------------------------------------------------------------------------------------------------
232 static void OnTabChange(SCR_TabViewComponent tabView, Widget widget)
233 {
234 if (m_OnTabChange)
235 m_OnTabChange.Invoke(tabView, widget);
236 }
237}
238
239//------------------------------------------------------------------------------------------------
240enum SCR_EListMenuWidgetFocus
241{
242 LIST = 0,
246 NULL = 4
247}
248
249//---- REFACTOR NOTE END ----
ArmaReforgerScripted GetGame()
Definition game.c:1398
ScriptInvokerBase< ScriptInvokerActiveWidgetInteractionMethod > ScriptInvokerActiveWidgetInteraction
class SCR_MenuHelper FILTERING
ScriptInvokerBase< ScriptInvokerDialogMethod > ScriptInvokerDialog
ScriptInvokerBase< ScriptInvokerMenuMethod > ScriptInvokerMenu
func ScriptInvokerMenuMethod
class SCR_MenuHelper FALLBACK
class SCR_MenuHelper SORTING
func ScriptInvokerDialogMethod
class SCR_MenuHelper LIST
func ScriptInvokerActiveWidgetInteractionMethod
ScriptInvokerBase< ScriptInvokerTabViewMethod > ScriptInvokerTabView
Constant variables used in various menus.
proto external MenuBase GetOwnerMenu(Widget w)
Return owner menu of Widget.
proto external MenuBase GetTopMenu()
Returns most top opened menu or nullptr when no menu is opened.
static ref ScriptInvokerMenu m_OnMenuOpen
static ScriptInvokerDialog GetOnDialogOpen()
static ScriptInvokerDialog GetOnDialogClose()
static ref ScriptInvokerDialog m_OnDialogClose
static void OnTabChange(SCR_TabViewComponent tabView, Widget widget)
Called by SCR_TabViewComponent.
static ScriptInvokerTabView GetOnTabChange()
static bool IsInTopMenu(notnull Widget componentRoot)
NB: This will return false if the widget is in a DIALOG on top of the MENU!!!
static void OnDialogClose(DialogUI dialog)
Called by DialogUI.
static void OnMenuFocusLost(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static ref ScriptInvokerMenu m_OnMenuHide
static ref ScriptInvokerMenu m_OnMenuFocusLost
static ScriptInvokerMenu GetOnMenuShow()
static ScriptInvokerMenu GetOnMenuFocusLost()
static ref ScriptInvokerMenu m_OnMenuClose
static void OnMenuFocusGained(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuClose(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static ref ScriptInvokerActiveWidgetInteraction m_OnActiveWidgetInteraction
static ScriptInvokerMenu GetOnMenuClose()
static ScriptInvokerMenu GetOnMenuOpen()
static ScriptInvokerMenu GetOnMenuHide()
static void OnMenuOpen(ChimeraMenuBase menu)
static ref ScriptInvokerMenu m_OnMenuOpened
static void OnMenuOpened(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void OnMenuShow(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static void SetActiveWidgetInteractionState(bool isActive, int delay=0)
static void OnDialogOpen(DialogUI dialog)
static ScriptInvokerMenu GetOnMenuFocusGained()
static ScriptInvokerActiveWidgetInteraction GetOnActiveWidgetInteraction()
static ref ScriptInvokerMenu m_OnMenuShow
static ref ScriptInvokerTabView m_OnTabChange
static ref ScriptInvokerDialog m_OnDialogOpen
static void OnMenuHide(ChimeraMenuBase menu)
Called by ChimeraMenuBase.
static ref ScriptInvokerMenu m_OnMenuFocusGained
static ScriptInvokerMenu GetOnMenuOpened()
@ NULL
Unknown type.
Definition DataVarType.c:21