40 {
41 string text = "";
42 bool center = false;
44 bool skip = false;
47 void Flush()
48 {
49 if (!text.IsEmpty())
50 {
52 text = "";
53 if (center)
54 {
55 uIItem.text1.alignment = TextAnchor.UpperCenter;
56 }
57 LayoutElement component = uIItem.GetComponent<LayoutElement>();
58 if ((bool)component)
59 {
60 component.enabled = false;
61 }
62 }
63 }
65 {
66 char c = 'a';
67 bool flag = false;
68 foreach (
string line
in lines)
69 {
70 string text2 =
Lang.
Parse(line,
"test1",
"test2");
71 if (text2.Length == 0)
72 {
73 if (!skip && (
idTopic.IsEmpty() || flag))
74 {
75 text += Environment.NewLine;
76 }
77 }
78 else
79 {
80 c = text2[0];
82 {
83 if (c == '$')
84 {
85 if (flag)
86 {
87 break;
88 }
89 if (text2.Split(
'$')[1] ==
idTopic)
90 {
91 flag = true;
92 continue;
93 }
94 }
95 if (!flag)
96 {
97 continue;
98 }
99 }
101 {
102 switch (c)
103 {
104 case '■':
105 Flush();
106 current.
AddHeader(
"HeaderPatch_header", line);
107 continue;
108 case '[':
109 text = text.TrimEnd(Environment.NewLine.ToCharArray());
110 Flush();
111 current.
AddHeader(
"HeaderPatch_category", line);
112 continue;
113 case '*':
114 Flush();
115 text = line.TrimStart('*').TrimStart(' ').TrimEnd(Environment.NewLine.ToCharArray());
116 current.
AddText(
"NoteText_list", text);
117 text = "";
118 continue;
119 }
120 }
121 if (c == '{')
122 {
123 Flush();
124 string[] array = text2.Split('}');
125 text = array[1];
126 string[] array2 = array[0].TrimStart('{').Split(array[0].Contains('|') ? '|' : ',');
127 if (!skip || !(array2[0] != "endif"))
128 {
129 switch (array2[0])
130 {
131 case "if":
132 {
133 string text5 = array2[1];
134 if (!(text5 == "cn"))
135 {
137 {
138 skip = true;
139 }
140 }
142 {
143 skip = true;
144 }
145 break;
146 }
147 case "endif":
148 skip = false;
149 break;
150 case "include":
151 case "load":
152 {
153 string text3 = "";
154 string text4 = "";
155 if (array2[0] == "include")
156 {
157 text3 = array2[1];
158 text4 = "include";
159 }
160 else
161 {
162 text4 = array2[1];
163 text3 = array2[2];
164 }
165 text4 += ".txt";
167 if (array3.IsEmpty())
168 {
170 }
171 if (array3.IsEmpty())
172 {
174 }
175 if (!array3.IsEmpty())
176 {
177 ParseLines(array3.ToList(), text3);
178 }
179 break;
180 }
181 case "center":
182 center = true;
183 break;
184 case "/center":
185 center = false;
186 break;
187 case "layout":
188 if (array2.Length == 1)
189 {
190 current = n;
191 }
192 else
193 {
194 current = n.
AddNote(STR(array2[1]));
195 }
196 break;
197 case "nerun":
198 current.
AddText(
"NoteText_nerun", STR(text));
199 break;
200 case "topic":
201 current.
AddHeader(
"HeaderHelpTopic", array2[1]);
202 break;
203 case "Q":
204 current.
AddText(
"NoteText_Q", STR(array2[1]));
205 break;
206 case "A":
207 current.
AddText(
"NoteText_A", STR(array2[1]));
208 break;
209 case "pair":
210 current.
AddTopic(
"TopicPair", STR(array2[1]), STR(array2[2]));
211 break;
212 case "image":
214 break;
215 case "link":
217 break;
218 case "button":
219 if (array2[1] == "close")
220 {
222 }
223 break;
224 }
225 text = "";
226 }
227 }
228 else if (!skip)
229 {
230 text = text + text2 + Environment.NewLine;
231 }
232 }
233 }
234 if (!text.IsEmpty())
235 {
236 text = text.Replace(
"#pc",
str_pc);
237 UIItem uIItem2 = current.
AddText(
"NoteText_help", STR(text));
238 if (center)
239 {
240 uIItem2.text1.alignment = TextAnchor.UpperCenter;
241 }
242 }
243 }
244 string STR(string s)
245 {
246 if (!hasSearchWord)
247 {
248 return s;
249 }
251 }
252 }
static string[] LoadTextArray(string _path)
static string Parse(string idLang, string val1, string val2=null, string val3=null, string val4=null, string val5=null)
UIButton AddButtonLink(string text, string url)
UINote AddNote(string id)
void AddImage(Sprite sprite)
UIItem AddHeader(string text, Sprite sprite=null)
UIItem AddTopic(string id, string text, string value=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)