DayZ 1.24
Loading...
Searching...
No Matches
ScriptConsoleOutputTab.c
Go to the documentation of this file.
2{
6
8 {
9 m_ClientLogListbox = TextListboxWidget.Cast(root.FindAnyWidget("TextListbox"));
10 m_ClientLogClearButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonClear"));
11 m_ClientLogScrollCheckbox = CheckBoxWidget.Cast(root.FindAnyWidget("CheckBoxAutoScroll"));
13 }
14
16 {
17 }
18
19 override bool OnClick(Widget w, int x, int y, int button)
20 {
21 super.OnClick(w, x, y, button);
22
24 {
25 Clear(true);
26 return true;
27 }
28 return false;
29 }
30
31 override bool OnChange(Widget w, int x, int y, bool finished)
32 {
33 super.OnChange(w, x, y, finished);
34 return false;
35 }
36
37
38 protected void Clear(bool clearFile = false)
39 {
40 if (clearFile)
42 m_ClientLogListbox.ClearItems();
43 }
44
45 protected void Add(string message, bool isReload = false)
46 {
48 {
50
51 if (m_ClientLogScrollCheckbox.IsChecked())
52 m_ClientLogListbox.EnsureVisible(m_ClientLogListbox.GetNumItems());
53 }
54 }
55
56 protected void ReloadOutput()
57 {
58 Clear();
60
61 if (file_index)
62 {
63 string line_content;
64 while (FGets(file_index, line_content) != -1)
65 Add(line_content, true);
66
68 }
69 }
70
71}
Icon x
Icon y
Definition Debug.c:14
static string GetFileName()
Definition Debug.c:651
static void ClearLogs()
Definition Debug.c:638
void Add(string message, bool isReload=false)
void ScriptConsoleOutputTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
TextListboxWidget m_ClientLogListbox
override bool OnClick(Widget w, int x, int y, int button)
void Clear(bool clearFile=false)
CheckBoxWidget m_ClientLogScrollCheckbox
override bool OnChange(Widget w, int x, int y, bool finished)
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
Definition EnScript.c:338
FileMode
Definition EnSystem.c:383
proto void CloseFile(FileHandle file)
Close the File.
proto int FGets(FileHandle file, string var)
Get line from file, every next call of this function returns next line.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.