Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
scriptconsolenewpresetdialog.c
Go to the documentation of this file.
1class ScriptConsoleNewPresetDialog extends UIScriptedMenu
2{
3 void ScriptConsoleNewPresetDialog()
4 {
5
6 }
7
8 void ~ScriptConsoleNewPresetDialog()
9 {
10 }
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
34 ScriptConsoleItemsTab tab = ScriptConsoleItemsTab.Cast(scripted_console.GetTabHandler(ScriptConsoleItemsTab));
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
51 EditBoxWidget m_Editbox;
52 TextWidget m_Label;
53 TextWidget m_Message;
54}
void NewPreset(string preset_name)
override Widget Init()
Definition bookmenu.c:11
override bool OnClick(Widget w, int x, int y, int button)
Definition bookmenu.c:34
proto native CGame GetGame()
const int MENU_SCRIPTCONSOLE
Definition constants.c:185
const int IDC_CANCEL
Definition constants.c:136
const int IDC_OK
Definition constants.c:135
Icon x
Icon y
void Close()