7 protected static const int MENU_CLOSE_FALLBACK = 10;
9 protected static MenuManager m_MenuMgr;
15 protected static ref ScriptInvoker<> Event_OnAllMenuClosed;
18 protected static void InvokeEventOnAllMenuClosed()
20 if (Event_OnAllMenuClosed)
21 Event_OnAllMenuClosed.Invoke();
25 static ScriptInvoker GetEventOnAllMenuClosed()
27 if (!Event_OnAllMenuClosed)
28 Event_OnAllMenuClosed =
new ScriptInvoker();
30 return Event_OnAllMenuClosed;
39 static void CloseAllMenus(array<typename> menus)
42 m_MenuMgr =
GetGame().GetMenuManager();
44 CloseTopMenu(menus, MENU_CLOSE_FALLBACK);
52 protected static void CloseTopMenu(array<typename> menus,
int calls)
57 bool excluded =
false;
60 for (
int i = 0, count = menus.Count(); i < count; i++)
62 typename menuType = m_MenuMgr.GetTopMenu().Type();
64 if (menuType == menus[i])
74 GetGame().GetCallqueue().CallLater(AllMenuClosed);
79 m_MenuMgr.GetTopMenu().Close();
82 GetGame().GetCallqueue().CallLater(CloseTopMenu, 0,
false, menus, calls);
86 protected static void AllMenuClosed()
88 InvokeEventOnAllMenuClosed();