Elin Modding Docs Doc
All Classes Namespaces
Msg.cs
1using System;
2using System.Runtime.CompilerServices;
3using UnityEngine;
4
5// Token: 0x020005CD RID: 1485
6public class Msg : EClass
7{
8 // Token: 0x17000BCD RID: 3021
9 // (get) Token: 0x060028AA RID: 10410 RVA: 0x000E640B File Offset: 0x000E460B
10 public static WidgetMainText mainText
11 {
12 get
13 {
14 return WidgetMainText.Instance;
15 }
16 }
17
18 // Token: 0x17000BCE RID: 3022
19 // (get) Token: 0x060028AB RID: 10411 RVA: 0x000E6412 File Offset: 0x000E4612
20 public static WidgetFeed feed
21 {
22 get
23 {
24 return WidgetFeed.Instance;
25 }
26 }
27
28 // Token: 0x17000BCF RID: 3023
29 // (get) Token: 0x060028AC RID: 10412 RVA: 0x000E6419 File Offset: 0x000E4619
30 public static MsgColors colors
31 {
32 get
33 {
34 return EClass.core.refs.msgColors;
35 }
36 }
37
38 // Token: 0x060028AD RID: 10413 RVA: 0x000E642A File Offset: 0x000E462A
39 public static void SetColor()
40 {
41 Msg.currentColor = Msg.colors.Default;
42 }
43
44 // Token: 0x060028AE RID: 10414 RVA: 0x000E643B File Offset: 0x000E463B
45 public static void SetColor(Color color)
46 {
47 Msg.currentColor = color;
48 }
49
50 // Token: 0x060028AF RID: 10415 RVA: 0x000E6443 File Offset: 0x000E4643
51 public static void SetColor(string id)
52 {
53 Msg.currentColor = Msg.colors.colors[id];
54 }
55
56 // Token: 0x060028B0 RID: 10416 RVA: 0x000E645A File Offset: 0x000E465A
57 public static string GetRawText(string idLang, string ref1, string ref2 = null, string ref3 = null, string ref4 = null)
58 {
59 Msg.thirdPerson1.Set(ref1);
60 Msg.thirdPerson2.Set(ref2);
61 return GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(ref1), ref1, ref2, ref3, ref4);
62 }
63
64 // Token: 0x060028B1 RID: 10417 RVA: 0x000E6488 File Offset: 0x000E4688
65 public static string GetRawText(string idLang, Card c1, Card c2, string ref1 = null, string ref2 = null)
66 {
67 Msg.thirdPerson1.Set(c1, false);
68 Msg.thirdPerson2.Set(c2, false);
69 return GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(c1), Msg.GetName(c1), Msg.GetName(c2), ref1, ref2);
70 }
71
72 // Token: 0x060028B2 RID: 10418 RVA: 0x000E64C2 File Offset: 0x000E46C2
73 public static string GetRawText(string idLang, Card c1, string ref1 = null, string ref2 = null, string ref3 = null)
74 {
75 Msg.thirdPerson1.Set(c1, false);
76 Msg.thirdPerson2.Set(ref1);
77 return GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(c1), Msg.GetName(c1), ref1, ref2, ref3);
78 }
79
80 // Token: 0x060028B3 RID: 10419 RVA: 0x000E64F6 File Offset: 0x000E46F6
81 public static string Say(string idLang, string ref1, string ref2 = null, string ref3 = null, string ref4 = null)
82 {
83 Msg.thirdPerson1.Set(ref1);
84 Msg.thirdPerson2.Set(ref2);
85 return Msg.SayRaw(GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(ref1), ref1, ref2, ref3, ref4));
86 }
87
88 // Token: 0x060028B4 RID: 10420 RVA: 0x000E6529 File Offset: 0x000E4729
89 public static string Say(string idLang, Card c1, Card c2, string ref1 = null, string ref2 = null)
90 {
91 Msg.thirdPerson1.Set(c1, false);
92 Msg.thirdPerson2.Set(c2, false);
93 return Msg.SayRaw(GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(c1), Msg.GetName(c1), Msg.GetName(c2), ref1, ref2));
94 }
95
96 // Token: 0x060028B5 RID: 10421 RVA: 0x000E6568 File Offset: 0x000E4768
97 public static string Say(string idLang, Card c1, string ref1 = null, string ref2 = null, string ref3 = null)
98 {
99 Msg.thirdPerson1.Set(c1, false);
100 Msg.thirdPerson2.Set(ref1);
101 return Msg.SayRaw(GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(c1), Msg.GetName(c1), ref1, ref2, ref3));
102 }
103
104 // Token: 0x060028B6 RID: 10422 RVA: 0x000E65A4 File Offset: 0x000E47A4
105 public static string Say(string idLang, Card c1, int i, string ref1 = null)
106 {
107 Msg.thirdPerson1.Set(c1, false);
108 Msg.thirdPerson2.Set(ref1);
109 return Msg.SayRaw(GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(i), Msg.GetName(c1), i.ToString() ?? "", ref1, null));
110 }
111
112 // Token: 0x060028B7 RID: 10423 RVA: 0x000E65F6 File Offset: 0x000E47F6
113 public static string Say(string idLang, int i, string ref1 = null, string ref2 = null)
114 {
115 return Msg.SayRaw(GameLang.Parse(Msg.GetGameText(idLang), Msg.IsThirdPerson(i), ref1, ref2, null, null));
116 }
117
118 // Token: 0x060028B8 RID: 10424 RVA: 0x000E6612 File Offset: 0x000E4812
119 public static string Say(string idLang)
120 {
121 return Msg.SayRaw(Msg.GetGameText(idLang));
122 }
123
124 // Token: 0x060028B9 RID: 10425 RVA: 0x000E661F File Offset: 0x000E481F
125 public static string SayNothingHappen()
126 {
127 return Msg.Say("nothingHappens");
128 }
129
130 // Token: 0x060028BA RID: 10426 RVA: 0x000E662B File Offset: 0x000E482B
131 public static void SayGod(string s, Card owner = null)
132 {
133 Msg.SetColor(Msg.colors.TalkGod);
134 Msg.Say(s.Bracket(0));
135 if (owner != null)
136 {
137 owner.SayRaw("@1" + s, null, null);
138 }
139 }
140
141 // Token: 0x060028BB RID: 10427 RVA: 0x000E6660 File Offset: 0x000E4860
142 public static string SayRaw(string text)
143 {
144 if (Msg.ignoreAll)
145 {
146 Msg.currentColor = Msg.colors.Default;
147 return "";
148 }
149 Msg.ToUpperFirst(text);
150 if (Msg.feed)
151 {
152 Msg.feed.System(text);
153 }
154 if (Msg.mainText)
155 {
156 Msg.mainText.Append(text, Msg.currentColor, null);
157 }
158 Msg.currentColor = Msg.colors.Default;
159 Msg.alwaysVisible = false;
160 EClass.game.log.Add(text, null);
161 return text;
162 }
163
164 // Token: 0x060028BC RID: 10428 RVA: 0x000E66EB File Offset: 0x000E48EB
165 public static void Append(Sprite sprite)
166 {
167 Msg.mainText.Append(sprite);
168 }
169
170 // Token: 0x060028BD RID: 10429 RVA: 0x000E66F8 File Offset: 0x000E48F8
171 public static void AquireItem(string itemName)
172 {
173 Msg.Say("getItem", itemName ?? "", null, null, null);
174 }
175
176 // Token: 0x060028BE RID: 10430 RVA: 0x000E6714 File Offset: 0x000E4914
177 public static void Nerun(string lang, string idPortrait = "UN_nerun")
178 {
179 string text = GameLang.Convert(lang.lang());
180 if (Msg.feed)
181 {
182 Msg.feed.Nerun(text, idPortrait);
183 return;
184 }
185 if (Msg.mainText)
186 {
187 Msg.mainText.Append(text.Bracket(1), Msg.colors.Talk, null);
188 }
189 }
190
191 // Token: 0x060028BF RID: 10431 RVA: 0x000E6770 File Offset: 0x000E4970
192 public static void SayHomeMember(string lang)
193 {
194 string text = GameLang.Convert(lang.lang());
195 if (Msg.feed)
196 {
197 Msg.feed.Nerun(text, "UN_nerun");
198 return;
199 }
200 if (Msg.mainText)
201 {
202 Msg.mainText.Append(text.Bracket(1), Msg.colors.Talk, null);
203 }
204 }
205
206 // Token: 0x060028C0 RID: 10432 RVA: 0x000E67D0 File Offset: 0x000E49D0
207 public static void SayPic(Card c, string lang)
208 {
209 if (c == null)
210 {
211 return;
212 }
213 string text = GameLang.Convert(lang.lang());
214 if (Msg.feed)
215 {
216 Msg.feed.SayRaw(c, text);
217 return;
218 }
219 if (Msg.mainText)
220 {
221 Msg.mainText.Append(text.Bracket(1), Msg.colors.Talk, null);
222 }
223 }
224
225 // Token: 0x060028C1 RID: 10433 RVA: 0x000E6830 File Offset: 0x000E4A30
226 public static void SayPic(string idPortrait, string lang, string _idPop = null)
227 {
228 string text = GameLang.Convert(lang.lang());
229 if (Msg.feed)
230 {
231 Msg.feed.SayRaw(idPortrait, text, _idPop);
232 return;
233 }
234 if (Msg.mainText)
235 {
236 Msg.mainText.Append(text.Bracket(1), Msg.colors.Talk, null);
237 }
238 }
239
240 // Token: 0x060028C2 RID: 10434 RVA: 0x000E688C File Offset: 0x000E4A8C
241 public static PopItem Talk(Card c, string id)
242 {
243 PopItem result = null;
244 if (c == null)
245 {
246 return null;
247 }
248 string text = GameLang.Convert(c.GetTalkText(id, true, true));
249 if (Msg.feed && c != null)
250 {
251 result = Msg.feed.SayRaw(c, text);
252 }
253 else if (Msg.mainText)
254 {
255 Msg.mainText.Append(text.Bracket(1), Msg.colors.Talk, null);
256 }
257 return result;
258 }
259
260 // Token: 0x060028C3 RID: 10435 RVA: 0x000E68F8 File Offset: 0x000E4AF8
261 public static PopItem TalkHomeMemeber(string id)
262 {
263 Chara chara = null;
264 if (EClass.Branch != null)
265 {
266 for (int i = 0; i < 99; i++)
267 {
268 chara = EClass.Branch.members.RandomItem<Chara>();
269 if (chara != EClass.pc)
270 {
271 break;
272 }
273 }
274 }
275 if (chara == null)
276 {
277 chara = EClass.pc;
278 }
279 return Msg.Talk(chara, id);
280 }
281
282 // Token: 0x060028C4 RID: 10436 RVA: 0x000E6944 File Offset: 0x000E4B44
283 public static PopItem TalkMaid(string id)
284 {
285 foreach (Chara chara in EClass._map.charas)
286 {
287 int uid = chara.uid;
288 FactionBranch branch = EClass.Branch;
289 int? num = (branch != null) ? new int?(branch.uidMaid) : null;
290 if (uid == num.GetValueOrDefault() & num != null)
291 {
292 return Msg.Talk(chara, id);
293 }
294 }
295 return Msg.TalkHomeMemeber(id);
296 }
297
298 // Token: 0x060028C5 RID: 10437 RVA: 0x000E69E0 File Offset: 0x000E4BE0
299 public static string GetGameText(string idLang)
300 {
301 LangGame.Row row = EClass.core.sources.langGame.map.TryGetValue(idLang, null);
302 if (row == null)
303 {
304 return idLang.lang();
305 }
306 if (!row.effect.IsEmpty() && row.effect == "destroy")
307 {
308 Msg.mainText.Append(Msg.mainText.spriteDestroy);
309 }
310 if (!row.color.IsEmpty())
311 {
312 Msg.SetColor(Msg.colors.colors[row.color]);
313 }
314 if (!row.sound.IsEmpty())
315 {
316 EClass.Sound.Play(row.sound);
317 }
318 return row.GetText("text", false).Split(Environment.NewLine.ToCharArray()).RandomItem<string>();
319 }
320
321 // Token: 0x060028C6 RID: 10438 RVA: 0x000E6AAC File Offset: 0x000E4CAC
322 public static string GetName(Card c)
323 {
324 if (c == null)
325 {
326 return "null";
327 }
328 if (c.IsPC)
329 {
330 return "you".lang();
331 }
332 if (!Msg.alwaysVisible && (EClass.pc.isBlind || !EClass.pc.CanSee(c)) && c.parent == EClass._zone)
333 {
334 return (c.isChara ? "someone" : "something").lang();
335 }
336 return c.Name;
337 }
338
339 // Token: 0x060028C7 RID: 10439 RVA: 0x000E6B22 File Offset: 0x000E4D22
340 public static bool IsThirdPerson(Card c)
341 {
342 return c != null && !c.IsPC && c.Num <= 1;
343 }
344
345 // Token: 0x060028C8 RID: 10440 RVA: 0x000E6B40 File Offset: 0x000E4D40
346 public static bool IsThirdPerson(string n)
347 {
348 int i;
349 return int.TryParse(n, out i) && Msg.IsThirdPerson(i);
350 }
351
352 // Token: 0x060028C9 RID: 10441 RVA: 0x000E6B5F File Offset: 0x000E4D5F
353 public static bool IsThirdPerson(int i)
354 {
355 return i <= 1;
356 }
357
358 // Token: 0x060028CA RID: 10442 RVA: 0x000E6B68 File Offset: 0x000E4D68
359 public static void NewLine()
360 {
361 if (Msg.mainText)
362 {
363 Msg.mainText.NewLine();
364 }
365 }
366
367 // Token: 0x060028CB RID: 10443 RVA: 0x000E6B80 File Offset: 0x000E4D80
368 public unsafe static void ToUpperFirst(string str)
369 {
370 if (str == null)
371 {
372 return;
373 }
374 fixed (string text = str)
375 {
376 char* ptr = text;
377 if (ptr != null)
378 {
379 ptr += RuntimeHelpers.OffsetToStringData / 2;
380 }
381 *ptr = char.ToUpper(*ptr);
382 }
383 }
384
385 // Token: 0x040016E8 RID: 5864
386 public static ThirstPersonInfo thirdPerson1 = new ThirstPersonInfo();
387
388 // Token: 0x040016E9 RID: 5865
389 public static ThirstPersonInfo thirdPerson2 = new ThirstPersonInfo();
390
391 // Token: 0x040016EA RID: 5866
392 public static Color currentColor = Msg.colors.Default;
393
394 // Token: 0x040016EB RID: 5867
395 public static bool alwaysVisible;
396
397 // Token: 0x040016EC RID: 5868
398 public static bool ignoreAll;
399}
Definition Card.cs:13
Definition Chara.cs:12
Definition Msg.cs:7