Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MenuToolsLib.c
Go to the documentation of this file.
1
4
6{
7 protected static const int MENU_CLOSE_FALLBACK = 10;
8
9 protected static MenuManager m_MenuMgr;
10
11 //------------------------------------------------------------------------------------------------
12 // Invokers
13 //------------------------------------------------------------------------------------------------
14
16
17 //------------------------------------------------------------------------------------------------
18 protected static void InvokeEventOnAllMenuClosed()
19 {
21 Event_OnAllMenuClosed.Invoke();
22 }
23
24 //------------------------------------------------------------------------------------------------
32
33 //------------------------------------------------------------------------------------------------
34 // Public
35 //------------------------------------------------------------------------------------------------
36
37 //------------------------------------------------------------------------------------------------
39 static void CloseAllMenus(array<typename> menus)
40 {
41 if (!m_MenuMgr)
42 m_MenuMgr = GetGame().GetMenuManager();
43
45 }
46
47 //------------------------------------------------------------------------------------------------
48 // Protected
49 //------------------------------------------------------------------------------------------------
50
51 //------------------------------------------------------------------------------------------------
52 protected static void CloseTopMenu(array<typename> menus, int calls)
53 {
54 //MainMenuUI mainMenu = MainMenuUI.Cast(GetGame().GetMenuManager().GetTopMenu());
55 //ContentBrowserUI workshopUI = ContentBrowserUI.Cast(GetGame().GetMenuManager().GetTopMenu());
56
57 bool excluded = false;
58
59 // Is top menu of excluded type?
60 for (int i = 0, count = menus.Count(); i < count; i++)
61 {
62 typename menuType = m_MenuMgr.GetTopMenu().Type();
63
64 if (menuType == menus[i])
65 {
66 excluded = true;
67 break;
68 }
69 }
70
71 // Current excluded = All non-excluded close
72 if (excluded)
73 {
74 GetGame().GetCallqueue().CallLater(AllMenuClosed);
75 //InvokeEventOnAllMenuClosed();
76 return;
77 }
78
79 m_MenuMgr.GetTopMenu().Close();
80
81 calls--;
82 GetGame().GetCallqueue().CallLater(CloseTopMenu, 0, false, menus, calls);
83 }
84
85 //------------------------------------------------------------------------------------------------
86 protected static void AllMenuClosed()
87 {
89 }
90}
ArmaReforgerScripted GetGame()
Definition game.c:1398
static void InvokeEventOnAllMenuClosed()
static ref ScriptInvoker Event_OnAllMenuClosed
static ScriptInvoker GetEventOnAllMenuClosed()
static const int MENU_CLOSE_FALLBACK
static void CloseTopMenu(array< typename > menus, int calls)
static void AllMenuClosed()
static MenuManager m_MenuMgr
static void CloseAllMenus(array< typename > menus)
Close all menus that are not of selected class.
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134