DayZ 1.24
Loading...
Searching...
No Matches
menuManager.c
Go to the documentation of this file.
1#ifdef GAME_TEMPLATE
2
3enum DialogPriority
4{
5 INFORMATIVE,
8};
9
10enum DialogResult
11{
12 PENDING,
13 OK,
14 YES,
15 NO,
16 CANCEL,
17};
18
19enum ScriptMenuPresetEnum
20{
21
22};
23
24class 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
43class MenuBindAttribute
44{
45 string m_MenuItemName;
46
47 void MenuBindAttribute(string menuItemName = "")
48 {
49 m_MenuItemName = menuItemName;
50 }
51}
52
53class 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
77class MessageBox: MenuBase
78{
79 [MenuBindAttribute()]
80 void Ok()
81 {
82 Close();
83 }
84}
85
86#ifdef PLATFORM_WINDOWS
87class WorldEditorIngame: MenuBase
88{
89 proto native bool LoadWorld(string worldFilePath);
90 proto native bool SaveWorld();
91};
92#endif
93
94#endif
95
@ OK
0 - No error. Can be returned from any call.
@ CRITICAL
Definition EStatLevels.c:7
@ NO
Definition EnConvert.c:18
@ YES
Definition EnConvert.c:19
void Close()
@ PENDING
map: item x vector(index, width, height)
Definition EnWidgets.c:651
WARNING
Definition EnDebug.c:1