DayZ 1.24
Loading...
Searching...
No Matches
ScriptConsoleNewPresetDialog.c
Go to the documentation of this file.
1class ScriptConsoleNewPresetDialog extends UIScriptedMenu
2{
7
11
12 override Widget Init()
13 {
14 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/script_console/script_console_dialog_preset.layout");
15 m_Editbox = EditBoxWidget.Cast(layoutRoot.FindAnyWidget("PrimaryEditBox"));
16 m_Label = TextWidget.Cast(layoutRoot.FindAnyWidget("WindowLabel"));
17 m_Label.SetText("NEW PRESET");
18
19 return layoutRoot;
20 }
21
22 override bool OnClick(Widget w, int x, int y, int button)
23 {
24 super.OnClick(w, x, y, button);
25
26 if (w.GetUserID() == IDC_OK)
27 {
28 UIScriptedMenu ui_menu = GetGame().GetUIManager().FindMenu(MENU_SCRIPTCONSOLE);
29 if (ui_menu != NULL && m_Editbox.GetText())
30 {
31 ScriptConsole scripted_console = ScriptConsole.Cast(ui_menu);
32 //scripted_console.NewPreset( m_Editbox.GetText());
33
35 if (tab)
36 tab.NewPreset(m_Editbox.GetText());
37 }
38
39 Close();
40 return true;
41 }
42 else if (w.GetUserID() == IDC_CANCEL)
43 {
44 Close();
45 return true;
46 }
47
48 return false;
49 }
50
54}
Icon x
Icon y
void Close()
override bool OnClick(Widget w, int x, int y, int button)
proto native CGame GetGame()
const int MENU_SCRIPTCONSOLE
Definition constants.c:175
const int IDC_CANCEL
Definition constants.c:128
const int IDC_OK
Definition constants.c:127