Elin Modding Docs Doc
Loading...
Searching...
No Matches
MsgLog.cs
1using System;
2using System.Collections.Generic;
3using Newtonsoft.Json;
4
5// Token: 0x020005CB RID: 1483
6public class MsgLog : EClass
7{
8 // Token: 0x17000BCC RID: 3020
9 // (get) Token: 0x060028A1 RID: 10401 RVA: 0x000E6004 File Offset: 0x000E4204
10 public int maxLog
11 {
12 get
13 {
14 if (this.id == "chronicle")
15 {
16 return 9999;
17 }
18 return 50;
19 }
20 }
21
22 // Token: 0x060028A2 RID: 10402 RVA: 0x000E6020 File Offset: 0x000E4220
23 public void Add(MsgLog.Data data)
24 {
25 this.dict.Add(this.currentLogIndex, data);
26 this.currentLogIndex++;
27 if (this.currentLogIndex >= this.maxLog)
28 {
29 this.dict.Remove(this.currentLogIndex - this.maxLog);
30 }
31 }
32
33 // Token: 0x060028A3 RID: 10403 RVA: 0x000E6074 File Offset: 0x000E4274
34 public MsgLog.Data Add(string text, FontColor c)
35 {
36 return this.Add(text, c.ToString());
37 }
38
39 // Token: 0x060028A4 RID: 10404 RVA: 0x000E608C File Offset: 0x000E428C
40 public MsgLog.Data Add(string text, string col = null)
41 {
42 MsgLog.Data data = new MsgLog.Data
43 {
44 text = text,
45 col = col
46 };
47 data.date = (VirtualDate.current ?? EClass.world.date).Copy();
48 this.Add(data);
49 return data;
50 }
51
52 // Token: 0x060028A5 RID: 10405 RVA: 0x000E60D4 File Offset: 0x000E42D4
53 public List<MsgLog.Data> GetList(bool reverse = false)
54 {
55 List<MsgLog.Data> list = new List<MsgLog.Data>();
56 foreach (MsgLog.Data item in this.dict.Values)
57 {
58 list.Add(item);
59 }
60 list.Sort((MsgLog.Data a, MsgLog.Data b) => a.date.GetRaw(0) - b.date.GetRaw(0));
61 if (reverse)
62 {
63 list.Reverse();
64 }
65 return list;
66 }
67
68 // Token: 0x040016DE RID: 5854
69 [JsonProperty]
70 public Dictionary<int, MsgLog.Data> dict = new Dictionary<int, MsgLog.Data>();
71
72 // Token: 0x040016DF RID: 5855
73 [JsonProperty]
74 public int currentLogIndex;
75
76 // Token: 0x040016E0 RID: 5856
77 [JsonProperty]
78 public string id;
79
80 // Token: 0x02000B30 RID: 2864
81 public class Data : EClass
82 {
83 // Token: 0x04002D0A RID: 11530
84 [JsonProperty]
85 public string text;
86
87 // Token: 0x04002D0B RID: 11531
88 [JsonProperty]
89 public string col;
90
91 // Token: 0x04002D0C RID: 11532
92 [JsonProperty]
93 public Date date;
94 }
95}
Definition Date.cs:6