Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
scriptconsolenewpresetdialog.c
Go to the documentation of this file.
1 class 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 }
GetGame
proto native CGame GetGame()
UIScriptedMenu
Definition: dayzgame.c:63
IDC_CANCEL
const int IDC_CANCEL
Definition: constants.c:128
EditBoxWidget
Definition: enwidgets.c:353
Close
void Close()
y
Icon y
MENU_SCRIPTCONSOLE
const int MENU_SCRIPTCONSOLE
Definition: constants.c:175
ScriptConsoleItemsTab
Definition: scriptconsoleitemstab.c:3
Init
class InventoryGridController extends ScriptedWidgetEventHandler Init
Definition: uihintpanel.c:46
TextWidget
Definition: enwidgets.c:219
x
Icon x
IDC_OK
const int IDC_OK
Definition: constants.c:127
Widget
Definition: enwidgets.c:189
OnClick
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition: dayzgame.c:146