Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
menumanager.c
Go to the documentation of this file.
1 #ifdef GAME_TEMPLATE
2 
3 enum DialogPriority
4 {
5  INFORMATIVE,
6  WARNING,
7  CRITICAL
8 };
9 
10 enum DialogResult
11 {
12  PENDING,
13  OK,
14  YES,
15  NO,
16  CANCEL,
17 };
18 
19 enum ScriptMenuPresetEnum
20 {
21 
22 };
23 
24 class MenuManager
25 {
26  proto native MenuBase OpenMenu(ScriptMenuPresetEnum preset, int userId = 0, bool unique = false);
27  proto native MenuBase OpenDialog(ScriptMenuPresetEnum preset, int priority = DialogPriority.INFORMATIVE, int iUserId = 0, bool unique = false);
28  proto native MenuBase FindMenuByPreset(ScriptMenuPresetEnum preset);
29  proto native MenuBase FindMenuByUserId(int userId);
30  proto native MenuBase GetTopMenu();
31 
32  proto native bool IsAnyMenuOpen();
33  proto native bool IsAnyDialogOpen();
34 
35  proto native bool CloseMenuByPreset(ScriptMenuPresetEnum preset);
36  proto native bool CloseMenuByUserId(int userId);
37  proto native bool CloseMenu(MenuBase menu);
38 
39  protected void MenuManager();
40  protected void ~MenuManager();
41 };
42 
43 class MenuBindAttribute
44 {
45  string m_MenuItemName;
46 
47  void MenuBindAttribute(string menuItemName = "")
48  {
49  m_MenuItemName = menuItemName;
50  }
51 }
52 
53 class MenuBase: ScriptedWidgetEventHandler
54 {
55  proto native int GetUserId();
56  proto native Widget GetRootWidget();
57  proto external MenuBase BindItem(string menuItemName, func callback);
58  proto native MenuBase SetLabel(string menuItemName, string text);
59  proto native Widget GetItemWidget(string menuItemName);
60  proto native MenuManager GetManager();
61  proto native void Close();
62 
63  void OnMenuFocusGained() {}
64  void OnMenuFocusLost() {}
65  void OnMenuShow() {}
66  void OnMenuHide() {}
67  void OnMenuOpen() {}
68  void OnMenuClose() {}
69  void OnMenuInit() {}
70  void OnMenuUpdate(float tDelta) {}
71  void OnMenuItem(string menuItemName, bool changed, bool finished) {}
72 
73  protected void MenuBase();
74  protected void ~MenuBase();
75 };
76 
77 class MessageBox: MenuBase
78 {
79  [MenuBindAttribute()]
80  void Ok()
81  {
82  Close();
83  }
84 }
85 
86 #ifdef PLATFORM_WINDOWS
87 class WorldEditorIngame: MenuBase
88 {
89  proto native bool LoadWorld(string worldFilePath);
90  proto native bool SaveWorld();
91 };
92 #endif
93 
94 #endif
95 
YES
@ YES
Definition: enconvert.c:19
Close
void Close()
OK
@ OK
0 - No error. Can be returned from any call.
Definition: bioserrormodule.c:9
func
Definition: enconvert.c:10
PENDING
@ PENDING
Definition: testframework.c:5
WARNING
WARNING
Definition: endebug.c:61
CRITICAL
@ CRITICAL
Definition: estatlevels.c:7
NO
@ NO
Definition: enconvert.c:18
Widget
Definition: enwidgets.c:189
Ok
@ Ok
Definition: miscgameplayfunctions.c:204
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition: enwidgets.c:650