DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ScriptConsoleOutputTab.c
См. документацию.
2{
3 protected TextListboxWidget m_ClientLogListbox;
4 protected ButtonWidget m_ClientLogClearButton;
5 protected CheckBoxWidget m_ClientLogScrollCheckbox;
6
7 override void InitializeTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent = null)
8 {
9 super.InitializeTab(root, console, button, parent);
10
11 m_ClientLogListbox = TextListboxWidget.Cast(root.FindAnyWidget("TextListbox"));
12 m_ClientLogClearButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonClear"));
13 m_ClientLogScrollCheckbox = CheckBoxWidget.Cast(root.FindAnyWidget("CheckBoxAutoScroll"));
15 }
16
18 {
19 }
20
21 override bool OnClick(Widget w, int x, int y, int button)
22 {
23 super.OnClick(w,x,y,button);
24
26 {
27 Clear(true);
28 return true;
29 }
30 return false;
31 }
32
33 override bool OnChange(Widget w, int x, int y, bool finished)
34 {
35 super.OnChange(w, x, y, finished);
36 return false;
37 }
38
39
40 protected void Clear(bool clearFile = false)
41 {
42 if(clearFile)
44 m_ClientLogListbox.ClearItems();
45 }
46
47 protected void Add(string message, bool isReload = false)
48 {
50 {
51 m_ClientLogListbox.AddItem(String(message), NULL, 0);
52
53 if (m_ClientLogScrollCheckbox.IsChecked())
54 {
55 m_ClientLogListbox.EnsureVisible(m_ClientLogListbox.GetNumItems());
56 }
57 }
58 }
59
60 protected void ReloadOutput()
61 {
62 Clear();
63 FileHandle file_index = OpenFile(Debug.GetFileName(), FileMode.READ);
64
65 if ( file_index )
66 {
67 string line_content;
68 while ( FGets( file_index, line_content ) != -1 )
69 {
70 Add(line_content, true);
71 }
72
73 CloseFile(file_index);
74 }
75 }
76
77}
override void Clear()
Определения ConstructionInfoIcons.c:41
Icon x
Icon y
void ScriptConsole()
Определения ScriptConsole.c:114
static string GetFileName()
Определения 3_Game/DayZ/tools/Debug.c:679
static void ClearLogs()
Определения 3_Game/DayZ/tools/Debug.c:666
Определения 3_Game/DayZ/tools/Debug.c:2
void Add(string message, bool isReload=false)
Определения ScriptConsoleOutputTab.c:47
void ReloadOutput()
Определения ScriptConsoleOutputTab.c:60
TextListboxWidget m_ClientLogListbox
Определения ScriptConsoleOutputTab.c:3
override bool OnClick(Widget w, int x, int y, int button)
Определения ScriptConsoleOutputTab.c:21
override void InitializeTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
Определения ScriptConsoleOutputTab.c:7
void ~ScriptConsoleOutputTab()
Определения ScriptConsoleOutputTab.c:17
ButtonWidget m_ClientLogClearButton
Определения ScriptConsoleOutputTab.c:4
void Clear(bool clearFile=false)
Определения ScriptConsoleOutputTab.c:40
CheckBoxWidget m_ClientLogScrollCheckbox
Определения ScriptConsoleOutputTab.c:5
override bool OnChange(Widget w, int x, int y, bool finished)
Определения ScriptConsoleOutputTab.c:33
Определения 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