Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_MenuToolsLib.c
Go to the documentation of this file.
1
4
5
class
SCR_MenuToolsLib
6
{
7
protected
static
const
int
MENU_CLOSE_FALLBACK
= 10;
8
9
protected
static
MenuManager
m_MenuMgr
;
10
11
//------------------------------------------------------------------------------------------------
12
// Invokers
13
//------------------------------------------------------------------------------------------------
14
15
protected
static
ref
ScriptInvoker<>
Event_OnAllMenuClosed
;
16
17
//------------------------------------------------------------------------------------------------
18
protected
static
void
InvokeEventOnAllMenuClosed
()
19
{
20
if
(
Event_OnAllMenuClosed
)
21
Event_OnAllMenuClosed
.Invoke();
22
}
23
24
//------------------------------------------------------------------------------------------------
25
static
ScriptInvoker
GetEventOnAllMenuClosed
()
26
{
27
if
(!
Event_OnAllMenuClosed
)
28
Event_OnAllMenuClosed
=
new
ScriptInvoker
();
29
30
return
Event_OnAllMenuClosed
;
31
}
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
44
CloseTopMenu
(menus,
MENU_CLOSE_FALLBACK
);
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
{
88
InvokeEventOnAllMenuClosed
();
89
}
90
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
MenuManager
Definition
MenuManager.c:13
SCR_MenuToolsLib
Definition
SCR_MenuToolsLib.c:6
SCR_MenuToolsLib::InvokeEventOnAllMenuClosed
static void InvokeEventOnAllMenuClosed()
Definition
SCR_MenuToolsLib.c:18
SCR_MenuToolsLib::Event_OnAllMenuClosed
static ref ScriptInvoker Event_OnAllMenuClosed
Definition
SCR_MenuToolsLib.c:15
SCR_MenuToolsLib::GetEventOnAllMenuClosed
static ScriptInvoker GetEventOnAllMenuClosed()
Definition
SCR_MenuToolsLib.c:25
SCR_MenuToolsLib::MENU_CLOSE_FALLBACK
static const int MENU_CLOSE_FALLBACK
Definition
SCR_MenuToolsLib.c:7
SCR_MenuToolsLib::CloseTopMenu
static void CloseTopMenu(array< typename > menus, int calls)
Definition
SCR_MenuToolsLib.c:52
SCR_MenuToolsLib::AllMenuClosed
static void AllMenuClosed()
Definition
SCR_MenuToolsLib.c:86
SCR_MenuToolsLib::m_MenuMgr
static MenuManager m_MenuMgr
Definition
SCR_MenuToolsLib.c:9
SCR_MenuToolsLib::CloseAllMenus
static void CloseAllMenus(array< typename > menus)
Close all menus that are not of selected class.
Definition
SCR_MenuToolsLib.c:39
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
Menu
MainMenuHandling
SCR_MenuToolsLib.c
Generated by
1.17.0