Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
scriptconsoletabbase.c
Go to the documentation of this file.
2{
3 protected int m_Id;
4 protected bool m_IsSelected;
5 protected bool m_IsShiftDown;
6 protected Widget m_ParentRoot;
7 protected Widget m_Root;
8 protected Widget m_Button;
9 protected ScriptConsole m_ScriptConsole;
10 protected ScriptConsoleTabBase m_Parent;//for subtabs
12 protected PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed;
13
14 void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent = null)
15 {
16 m_Button = button;
17 m_ScriptConsole = console;
18 m_Root = root;
19 if (parent)
20 m_ParentRoot = parent.GetRoot();
21 else
22 m_ParentRoot = console.layoutRoot;
24 m_ConfigDebugProfileFixed = PluginConfigDebugProfileFixed.Cast(GetPlugin(PluginConfigDebugProfileFixed));
25 }
26
27 void Init(int id)
28 {
29 m_Id = id;
30 }
31
32 int GetID()
33 {
34 return m_Id;
35 }
36
37 Widget GetRoot()
38 {
39 return m_Root;
40 }
41
43 {
44 return m_IsSelected;
45 }
46
47 void Select(bool select, ScriptConsoleTabBase selectedHandler)
48 {
49 m_IsSelected = select;
50 if (m_Root)
51 {
52 Show(select, selectedHandler);
53 ButtonWidget btn = ButtonWidget.Cast(m_Button);
54 if (btn)
55 btn.SetState(select);
56 }
57 if (select)
58 OnSelected();
59 }
60
61 void OnSelected();
62
63 void Show(bool show, ScriptConsoleTabBase selectedHandler)
64 {
65 m_Root.Show(show);
66 m_Root.Enable(show);
67 }
68
69 Widget GetButton()
70 {
71 return m_Button;
72 }
73
74 void Update(float timeslice)
75 {
76 m_IsShiftDown = KeyState(KeyCode.KC_LSHIFT) || KeyState(KeyCode.KC_RSHIFT);
77 }
78
79 bool OnChange(Widget w, int x, int y, bool finished);
80 bool OnClick(Widget w, int x, int y, int button);
81 bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn);
82 bool OnKeyDown(Widget w, int x, int y, int key);
83 bool OnDoubleClick(Widget w, int x, int y, int button);
84 void OnRPCEx(int rpc_type, ParamsReadContext ctx);
85 bool OnMouseButtonDown(Widget w, int x, int y, int button);
86 bool OnKeyPress(Widget w, int x, int y, int key);
87 bool OnMouseEnter(Widget w, int x, int y);
88 bool OnMouseLeave(Widget w, Widget enterW, int x, int y);
89
90 protected void AddItemToClipboard(TextListboxWidget text_listbox_widget)
91 {
92 int selected_row_index = text_listbox_widget.GetSelectedRow();
93 if (selected_row_index != -1)
94 {
95 string item_name;
96 text_listbox_widget.GetItemText(selected_row_index, 0, item_name);
97 GetGame().CopyToClipboard(item_name);
98 }
99 }
100}
bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
bool OnKeyDown(Widget w, int x, int y, int key)
PluginConfigDebugProfile m_ConfigDebugProfile
void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
bool OnDoubleClick(Widget w, int x, int y, int button)
bool OnMouseButtonDown(Widget w, int x, int y, int button)
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
bool OnMouseEnter(Widget w, int x, int y)
bool OnKeyPress(Widget w, int x, int y, int key)
void Select(bool select, ScriptConsoleTabBase selectedHandler)
ScriptConsoleTabBase m_Parent
void OnRPCEx(int rpc_type, ParamsReadContext ctx)
PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed
bool OnChange(Widget w, int x, int y, bool finished)
bool OnClick(Widget w, int x, int y, int button)
void Show(bool show, ScriptConsoleTabBase selectedHandler)
void Update(float timeslice)
Serialization general interface. Serializer API works with:
Definition serializer.c:56
void Show()
Definition dayzgame.c:162
proto native CGame GetGame()
KeyCode
Definition ensystem.c:157
proto native int KeyState(KeyCode key)
Icon x
Icon y
PluginBase GetPlugin(typename plugin_type)