DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ScriptConsoleOutputTab.c
См. документацию.
2{
3 protected TextListboxWidget m_ClientLogListbox;
4 protected ButtonWidget m_ClientLogClearButton;
5 protected CheckBoxWidget m_ClientLogScrollCheckbox;
6
7 void ScriptConsoleOutputTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent = null)
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 {
49 m_ClientLogListbox.AddItem(String(message), NULL, 0);
50
51 if (m_ClientLogScrollCheckbox.IsChecked())
52 {
53 m_ClientLogListbox.EnsureVisible(m_ClientLogListbox.GetNumItems());
54 }
55 }
56 }
57
58 protected void ReloadOutput()
59 {
60 Clear();
61 FileHandle file_index = OpenFile(Debug.GetFileName(), FileMode.READ);
62
63 if ( file_index )
64 {
65 string line_content;
66 while ( FGets( file_index, line_content ) != -1 )
67 {
68 Add(line_content, true);
69 }
70
71 CloseFile(file_index);
72 }
73 }
74
75}
Icon x
Icon y
static string GetFileName()
Определения Debug.c:570
static void ClearLogs()
Определения Debug.c:557
Определения Debug.c:2
void Add(string message, bool isReload=false)
Определения ScriptConsoleOutputTab.c:45
void ReloadOutput()
Определения ScriptConsoleOutputTab.c:58
void ScriptConsoleOutputTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
Определения ScriptConsoleOutputTab.c:7
TextListboxWidget m_ClientLogListbox
Определения ScriptConsoleOutputTab.c:3
override bool OnClick(Widget w, int x, int y, int button)
Определения ScriptConsoleOutputTab.c:19
void ~ScriptConsoleOutputTab()
Определения ScriptConsoleOutputTab.c:15
ButtonWidget m_ClientLogClearButton
Определения ScriptConsoleOutputTab.c:4
void Clear(bool clearFile=false)
Определения ScriptConsoleOutputTab.c:38
CheckBoxWidget m_ClientLogScrollCheckbox
Определения ScriptConsoleOutputTab.c:5
override bool OnChange(Widget w, int x, int y, bool finished)
Определения ScriptConsoleOutputTab.c:31
void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
Определения ScriptConsoleTabBase.c:14
Определения EnWidgets.c:190
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
Определения EnScript.c:339
FileMode
Определения 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.
int[] FileHandle
Определения EnSystem.c:390