Elin Modding Docs Doc
Loading...
Searching...
No Matches
WidgetDebug.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x020005FA RID: 1530
6public class WidgetDebug : Widget
7{
8 // Token: 0x06002A60 RID: 10848 RVA: 0x000EE908 File Offset: 0x000ECB08
9 public override void OnActivate()
10 {
11 this.UpdateText();
12 }
13
14 // Token: 0x06002A61 RID: 10849 RVA: 0x000EE910 File Offset: 0x000ECB10
15 private void OnEnable()
16 {
17 if (Timer.current)
18 {
19 this.timer = Timer.Start(0.1f, new Action(this.UpdateText), true);
20 }
21 }
22
23 // Token: 0x06002A62 RID: 10850 RVA: 0x000EE93B File Offset: 0x000ECB3B
24 private void OnDisable()
25 {
26 if (this.timer != null)
27 {
28 this.timer.Cancel();
29 }
30 }
31
32 // Token: 0x06002A63 RID: 10851 RVA: 0x000EE950 File Offset: 0x000ECB50
33 public void Refresh()
34 {
35 }
36
37 // Token: 0x06002A64 RID: 10852 RVA: 0x000EE952 File Offset: 0x000ECB52
38 public void ToggleProps()
39 {
40 this.showProps = !this.showProps;
41 }
42
43 // Token: 0x06002A65 RID: 10853 RVA: 0x000EE963 File Offset: 0x000ECB63
44 public void ToggleUpdates()
45 {
46 this.showUpdates = !this.showUpdates;
47 }
48
49 // Token: 0x06002A66 RID: 10854 RVA: 0x000EE974 File Offset: 0x000ECB74
50 public void ToggleOther()
51 {
52 this.showOther = !this.showOther;
53 }
54
55 // Token: 0x06002A67 RID: 10855 RVA: 0x000EE988 File Offset: 0x000ECB88
56 private void UpdateText()
57 {
58 this.deltaTime += (Time.unscaledDeltaTime - this.deltaTime) * 0.1f;
59 float num = this.deltaTime * 1000f;
60 float num2 = 1f / this.deltaTime;
61 string text = string.Format("{0:0.0} ms ({1:0.} fps)", num, num2);
62 this.textFPS.text = text + " avg delta: " + Core.avgDelta.ToString();
63 if (EMono.game == null || EMono.game.activeZone == null)
64 {
65 this.debugText.text = "";
66 return;
67 }
68 IPathfinder pathfinder = EMono.core.pathManager.pathfinder;
69 BaseTileMap tileMap = EMono.screen.tileMap;
70 PropsManager props = EMono._map.props;
71 int num3 = PathManager.requestCount - this.lastPathCount;
72 this.lastPathCount = PathManager.requestCount;
73 Point hitPoint = Scene.HitPoint;
74 text = "";
75 if (this.showOther)
76 {
77 text += WidgetDebug.output;
78 string[] array = new string[5];
79 array[0] = text;
80 int num4 = 1;
81 AIAct ai = EMono.pc.ai;
82 array[num4] = ((ai != null) ? ai.ToString() : null);
83 array[2] = "/";
84 array[3] = EMono.pc.ai.status.ToString();
85 array[4] = "\n";
86 text = string.Concat(array);
87 text = string.Concat(new string[]
88 {
89 text,
90 "time: ",
91 EMono.scene.timeRatio.ToString(),
92 " turn:",
93 EMono.pc.turn.ToString(),
94 " "
95 });
96 Vector3 mposWorld = EInput.mposWorld;
97 if (tileMap != null)
98 {
99 string[] array2 = new string[8];
100 array2[0] = text;
101 array2[1] = "mouse: ";
102 array2[2] = tileMap.mx.ToString();
103 array2[3] = "/";
104 array2[4] = tileMap.mz.ToString();
105 array2[5] = " hit: ";
106 int num5 = 6;
107 Point point = hitPoint;
108 array2[num5] = ((point != null) ? point.ToString() : null);
109 array2[7] = "\n";
110 text = string.Concat(array2);
111 if (EMono._zone.IsRegion)
112 {
113 Point point2 = hitPoint.Copy();
114 point2.x += EMono.scene.elomapActor.elomap.minX;
115 point2.z += EMono.scene.elomapActor.elomap.minY;
116 string[] array3 = new string[8];
117 array3[0] = text;
118 array3[1] = "mouse: ";
119 array3[2] = (tileMap.mx + EMono.scene.elomapActor.elomap.minX).ToString();
120 array3[3] = "/";
121 array3[4] = (tileMap.mz + EMono.scene.elomapActor.elomap.minY).ToString();
122 array3[5] = " hit: ";
123 int num6 = 6;
124 Point point3 = point2;
125 array3[num6] = ((point3 != null) ? point3.ToString() : null);
126 array3[7] = "\n";
127 text = string.Concat(array3);
128 }
129 }
130 CharaActorPCC charaActorPCC = EMono.pc.renderer.actor as CharaActorPCC;
131 float num7 = (charaActorPCC != null) ? charaActorPCC.provider.angle : 0f;
132 text = string.Concat(new string[]
133 {
134 text,
135 "path:",
136 num3.ToString(),
137 "/",
138 PathManager.requestCount.ToString(),
139 "/",
140 PathManager.Instance._pathfinder.total.ToString(),
141 " syncList:",
142 EMono.scene.syncList.Count.ToString(),
143 "\n"
144 });
145 text = string.Concat(new string[]
146 {
147 text,
148 "events:",
149 EMono._zone.events.list.Count.ToString(),
150 " roundTimer:",
151 EMono.pc.roundTimer.ToString(),
152 " seed:",
153 EMono._map.seed.ToString(),
154 "\n"
155 });
156 text = string.Concat(new string[]
157 {
158 text,
159 "details:",
160 CellDetail.count.ToString(),
161 "(",
162 CellDetail.cache.Count.ToString(),
163 " pointAnimes:",
164 EMono._map.pointAnimes.Count.ToString(),
165 ") pccCache:",
166 PCCManager.current.pccCache.Count.ToString(),
167 "\n"
168 });
169 if (hitPoint.IsValid)
170 {
171 string[] array4 = new string[12];
172 array4[0] = text;
173 array4[1] = "GatAngle: ";
174 array4[2] = Util.GetAngle((float)(hitPoint.x - EMono.pc.pos.x), (float)(hitPoint.z - EMono.pc.pos.z)).ToString();
175 array4[3] = " dir: ";
176 array4[4] = EMono.pc.dir.ToString();
177 array4[5] = " actor dir: ";
178 int num8 = 6;
179 CardActor actor = EMono.pc.renderer.actor;
180 array4[num8] = ((actor != null) ? new int?(actor.currentDir) : null).ToString();
181 array4[7] = " angle:";
182 array4[8] = EMono.pc.angle.ToString();
183 array4[9] = "/";
184 array4[10] = num7.ToString();
185 array4[11] = "\n";
186 text = string.Concat(array4);
187 string[] array5 = new string[7];
188 array5[0] = text;
189 array5[1] = "room: ";
190 int num9 = 2;
191 Room room = hitPoint.cell.room;
192 array5[num9] = ((room != null) ? room.ToString() : null);
193 array5[3] = " objVal:";
194 array5[4] = hitPoint.cell.objVal.ToString();
195 array5[5] = " ";
196 array5[6] = hitPoint.cell.CanGrow(hitPoint.cell.sourceObj, new VirtualDate(1)).ToString();
197 text = string.Concat(array5);
198 }
199 }
200 if (this.showUpdates)
201 {
202 text += EMono.game.updater.GetText();
203 text += "\n";
204 }
205 if (this.showProps)
206 {
207 text = text + "roaming: " + props.roaming.Count.ToString() + "\n";
208 text = text + "installed: " + props.installed.Count.ToString() + "\n";
209 text = text + "charas: " + EMono._map.charas.Count.ToString() + "\n";
210 text = text + "global charas: " + EMono.game.cards.globalCharas.Count.ToString() + "\n";
211 text += "\n";
212 }
213 if (hitPoint.IsValid && hitPoint.FirstChara != null)
214 {
215 text += "\n";
216 Chara firstChara = hitPoint.FirstChara;
217 text = string.Concat(new string[]
218 {
219 text,
220 firstChara.id,
221 " uid:",
222 firstChara.uid.ToString(),
223 " skin:",
224 firstChara.idSkin.ToString(),
225 " dir:",
226 firstChara.dir.ToString()
227 });
228 }
229 this.debugText.text = text;
230 }
231
232 // Token: 0x040017E3 RID: 6115
233 public static string output;
234
235 // Token: 0x040017E4 RID: 6116
236 public Text debugText;
237
238 // Token: 0x040017E5 RID: 6117
239 public Text textFPS;
240
241 // Token: 0x040017E6 RID: 6118
242 public bool showUpdates;
243
244 // Token: 0x040017E7 RID: 6119
245 public bool showProps;
246
247 // Token: 0x040017E8 RID: 6120
248 public bool showOther;
249
250 // Token: 0x040017E9 RID: 6121
251 private Timer.TimerItem timer;
252
253 // Token: 0x040017EA RID: 6122
254 private float deltaTime;
255
256 // Token: 0x040017EB RID: 6123
257 private int lastPathCount;
258}
Definition AIAct.cs:7
Definition Chara.cs:12
Definition EMono.cs:6
Definition Point.cs:11
Definition Room.cs:6
Definition Scene.cs:10