Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
pluginlocalhistorybase.c
Go to the documentation of this file.
2{
4 {
5 m_ReadOnly = false;
6 }
7
9 {
10 }
11
12 override void OnInit()
13 {
14 super.OnInit();
15 }
16
17 override string GetFileName()
18 {
19 Error( "Cannot call GetFileName on Base class PluginLocalHistoryBase" );
20 return STRING_EMPTY;
21 }
22
23 void AddNewLine(string text)
24 {
25 // replace newline to \\n
26 text.Replace("\n", "\\n" );
27 m_FileContent.Insert(text);
28 SaveFile();
29 }
30
32 {
33 // replace \\n to new line
34 TStringArray console_history = new TStringArray;
35 for ( int i = 0; i < m_FileContent.Count(); i++)
36 {
37 string history_record = m_FileContent.Get(i);
38 history_record.Replace("\\n", "\n");
39 console_history.Insert( history_record );
40 }
41 return console_history;
42 }
43
45 {
46 int count = m_FileContent.Count();
47 string ret = "";
48
49 if ( count > 0 )
50 {
51 ret = m_FileContent.Get(count - 1);
52 }
53
54 return NULL;
55 }
56}
override string GetFileName()
void AddNewLine(string text)
void Error(string err)
Messagebox with error message.
Definition endebug.c:90
array< string > TStringArray
Definition enscript.c:712
const string STRING_EMPTY
Definition constants.c:54
proto string Get(int index)
Gets n-th character from string.
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.