terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
UserInterface.cs
Go to the documentation of this file.
1using System;
8
9namespace Terraria.UI
10{
11 // Token: 0x02000727 RID: 1831
12 public class UserInterface
13 {
14 // Token: 0x06003C95 RID: 15509 RVA: 0x00236C60 File Offset: 0x00234E60
20
21 // Token: 0x06003C96 RID: 15510 RVA: 0x00236C7C File Offset: 0x00234E7C
22 public void ResetLasts()
23 {
24 if (this._lastElementHover != null)
25 {
26 Vector2 mousePosition = this.MousePosition;
27 }
30 }
31
32 // Token: 0x06003C97 RID: 15511 RVA: 0x00236CA8 File Offset: 0x00234EA8
33 public void EscapeElements()
34 {
35 this.ResetLasts();
36 }
37
38 // Token: 0x17000768 RID: 1896
39 // (get) Token: 0x06003C98 RID: 15512 RVA: 0x00236CBC File Offset: 0x00234EBC
41 {
42 get
43 {
44 return this._currentState;
45 }
46 }
47
48 // Token: 0x06003C99 RID: 15513 RVA: 0x00236CD0 File Offset: 0x00234ED0
50 {
51 if (!true)
52 {
53 }
54 if (!true)
55 {
56 }
57 if (!true)
58 {
59 }
60 if (!true)
61 {
62 }
63 if (!true)
64 {
65 }
66 if (!true)
67 {
68 }
69 if (!true)
70 {
71 }
72 if (!true)
73 {
74 }
75 base..ctor();
76 }
77
78 // Token: 0x06003C9A RID: 15514 RVA: 0x00236CFC File Offset: 0x00234EFC
79 public void Use()
80 {
81 if (true)
82 {
83 return;
84 }
85 if (true)
86 {
87 return;
88 }
89 if (this._currentState != null)
90 {
91 return;
92 }
93 }
94
95 // Token: 0x06003C9B RID: 15515 RVA: 0x00236D1C File Offset: 0x00234F1C
97 {
99 if (!true)
100 {
101 }
102 bool mouseLeft = Main.mouseLeft;
103 leftMouse.WasDown = true;
105 bool mouseRight = Main.mouseRight;
106 rightMouse.WasDown = true;
107 }
108
109 // Token: 0x06003C9C RID: 15516 RVA: 0x00236D5C File Offset: 0x00234F5C
110 private void ResetState()
111 {
112 if (!true)
113 {
114 }
115 if (!true)
116 {
117 this.GetMousePosition();
119 if (this._lastElementHover != null)
120 {
121 Vector2 mousePosition = this.MousePosition;
122 }
123 }
127 if (rightMouse == null)
128 {
129 }
130 double num;
132 }
133
134 // Token: 0x06003C9D RID: 15517 RVA: 0x00236DB0 File Offset: 0x00234FB0
135 private void GetMousePosition()
136 {
137 if (!true)
138 {
139 }
140 int mouseX = Main.mouseX;
141 int mouseY = Main.mouseY;
143 }
144
145 // Token: 0x06003C9E RID: 15518 RVA: 0x00236DD8 File Offset: 0x00234FD8
146 public void Update(GameTime time)
147 {
148 UIState currentState = this._currentState;
149 if (currentState == null)
150 {
151 return;
152 }
153 this.GetMousePosition();
154 if (currentState == null)
155 {
156 }
157 if (currentState != null)
158 {
160 float x = this.MousePosition.X;
161 float y = this.MousePosition.Y;
162 return;
163 }
164 long num = 0L;
165 TimeSpan elapsedGameTime = time.elapsedGameTime;
167 if (elapsedGameTime == null)
168 {
169 }
171 double num2;
173 if (lastElementHover != null)
174 {
175 Vector2 mousePosition = this.MousePosition;
176 }
177 if (num != 0L)
178 {
180 }
183 bool mouseLeft = Main.mouseLeft;
184 }
185
186 // Token: 0x06003C9F RID: 15519 RVA: 0x00236EA4 File Offset: 0x002350A4
188 {
189 bool wasDown = cache.WasDown;
190 if (mouseElement != null && !wasDown)
191 {
193 UserInterface.MouseElementEvent mouseDownEvent = cache.MouseDownEvent;
194 Vector2 mousePosition = this.MousePosition;
195 IntPtr invoke_impl = mouseDownEvent.invoke_impl;
196 IntPtr method_code = mouseDownEvent.method_code;
197 IntPtr method = mouseDownEvent.method;
198 UIElement lastClicked = cache.LastClicked;
199 TimeSpan totalGameTime = time.totalGameTime;
200 double lastTimeDown = cache.LastTimeDown;
201 UserInterface.MouseElementEvent doubleClickEvent = cache.DoubleClickEvent;
207 double num;
208 cache.LastTimeDown = num;
209 return;
210 }
211 }
212
213 // Token: 0x06003CA0 RID: 15520 RVA: 0x00236FA8 File Offset: 0x002351A8
214 public void Draw(SpriteBatch spriteBatch, GameTime time)
215 {
216 this.Use();
217 if (this._currentState != null)
218 {
219 if (this._isStateDirty)
220 {
221 UIState currentState = this._currentState;
222 }
223 return;
224 }
225 }
226
227 // Token: 0x06003CA1 RID: 15521 RVA: 0x00236FD4 File Offset: 0x002351D4
229 {
230 }
231
232 // Token: 0x06003CA2 RID: 15522 RVA: 0x00236FE4 File Offset: 0x002351E4
233 public void SetState(UIState state)
234 {
235 for (;;)
236 {
237 UIState currentState = this._currentState;
238 if (state != null)
239 {
240 this.AddToHistory(state);
241 if (this._currentState == null)
242 {
243 goto IL_0033;
244 }
245 if (this._lastElementHover != null)
246 {
247 break;
248 }
249 }
250 }
251 Vector2 mousePosition = this.MousePosition;
253 IL_0033:
255 this.ResetState();
256 if (state != null)
257 {
258 this._isStateDirty = true;
259 state.Activate();
260 return;
261 }
262 }
263
264 // Token: 0x06003CA3 RID: 15523 RVA: 0x00237044 File Offset: 0x00235244
265 public void GoBack()
266 {
267 int size = this._history._size;
268 int size2 = this._history._size;
269 }
270
271 // Token: 0x06003CA4 RID: 15524 RVA: 0x000021DB File Offset: 0x000003DB
273 {
274 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
275 }
276
277 // Token: 0x06003CA5 RID: 15525 RVA: 0x0023706C File Offset: 0x0023526C
278 public void Recalculate()
279 {
280 if (this._currentState != null)
281 {
282 return;
283 }
284 }
285
286 // Token: 0x06003CA6 RID: 15526 RVA: 0x00237084 File Offset: 0x00235284
288 {
289 /*
290An exception occurred when decompiling this method (06003CA6)
291
292ICSharpCode.Decompiler.DecompilerException: Error decompiling Terraria.UI.CalculatedStyle Terraria.UI.UserInterface::GetDimensions()
293
294 ---> System.Exception: Basic block has to end with unconditional control flow.
295{
296 IL_0011:
297 brtrue(IL_0000, ldc.i4:bool(1))
298}
299
300 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
301 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
302 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
303 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
304 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
305 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
306 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
307 --- End of inner exception stack trace ---
308 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
309 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
310*/;
311 }
312
313 // Token: 0x06003CA7 RID: 15527 RVA: 0x002370A4 File Offset: 0x002352A4
314 internal void RefreshState()
315 {
316 UIState currentState = this._currentState;
317 if (currentState != null)
318 {
319 currentState.Deactivate();
320 }
321 this.ResetState();
322 this._currentState.Activate();
324 }
325
326 // Token: 0x06003CA8 RID: 15528 RVA: 0x002370DC File Offset: 0x002352DC
328 {
329 if (!this.IsVisible || this._lastElementHover != null)
330 {
331 return;
332 }
333 }
334
335 // Token: 0x06003CA9 RID: 15529 RVA: 0x002370FC File Offset: 0x002352FC
336 // Note: this type is marked as 'beforefieldinit'.
338 {
339 }
340
341 // Token: 0x04007BB6 RID: 31670
342 private const double DOUBLE_CLICK_TIME = 500.0;
343
344 // Token: 0x04007BB7 RID: 31671
345 private const double STATE_CHANGE_CLICK_DISABLE_TIME = 200.0;
346
347 // Token: 0x04007BB8 RID: 31672
348 private const int MAX_HISTORY_SIZE = 32;
349
350 // Token: 0x04007BB9 RID: 31673
351 private const int HISTORY_PRUNE_SIZE = 4;
352
353 // Token: 0x04007BBA RID: 31674
355
356 // Token: 0x04007BBB RID: 31675
358
359 // Token: 0x04007BBC RID: 31676
361
362 // Token: 0x04007BBD RID: 31677
364
365 // Token: 0x04007BBE RID: 31678
367
368 // Token: 0x04007BBF RID: 31679
370
371 // Token: 0x04007BC0 RID: 31680
373
374 // Token: 0x04007BC1 RID: 31681
375 private bool _isStateDirty;
376
377 // Token: 0x04007BC2 RID: 31682
378 public bool IsVisible;
379
380 // Token: 0x04007BC3 RID: 31683
382
383 // Token: 0x02000728 RID: 1832
385 {
386 // Token: 0x06003CAA RID: 15530 RVA: 0x0023710C File Offset: 0x0023530C
387 public MouseElementEvent(object @object, IntPtr method)
388 {
390 this.m_target = @object;
392 this.method_code = this;
393 }
394
395 // Token: 0x06003CAB RID: 15531 RVA: 0x0023716C File Offset: 0x0023536C
396 public void Invoke(UIElement element, UIMouseEvent evt)
397 {
400 IntPtr method = this.method;
401 }
402
403 // Token: 0x06003CAC RID: 15532 RVA: 0x000021DB File Offset: 0x000003DB
404 public IAsyncResult BeginInvoke(UIElement element, UIMouseEvent evt, AsyncCallback callback, object @object)
405 {
406 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
407 }
408
409 // Token: 0x06003CAD RID: 15533 RVA: 0x00237190 File Offset: 0x00235390
410 public void EndInvoke(IAsyncResult result)
411 {
412 }
413 }
414
415 // Token: 0x02000729 RID: 1833
416 private class InputPointerCache
417 {
418 // Token: 0x06003CAE RID: 15534 RVA: 0x002371A0 File Offset: 0x002353A0
419 public void Clear()
420 {
421 }
422
423 // Token: 0x06003CAF RID: 15535 RVA: 0x002371B0 File Offset: 0x002353B0
425 {
426 }
427
428 // Token: 0x04007BC4 RID: 31684
429 public double LastTimeDown;
430
431 // Token: 0x04007BC5 RID: 31685
432 public bool WasDown;
433
434 // Token: 0x04007BC6 RID: 31686
436
437 // Token: 0x04007BC7 RID: 31687
439
440 // Token: 0x04007BC8 RID: 31688
442
443 // Token: 0x04007BC9 RID: 31689
445
446 // Token: 0x04007BCA RID: 31690
448
449 // Token: 0x04007BCB RID: 31691
451 }
452
453 // Token: 0x0200072A RID: 1834
455 [Serializable]
456 private sealed class <>c
457 {
458 // Token: 0x06003CB0 RID: 15536 RVA: 0x002371C4 File Offset: 0x002353C4
459 // Note: this type is marked as 'beforefieldinit'.
460 static <>c()
461 {
462 }
463
464 // Token: 0x06003CB1 RID: 15537 RVA: 0x002371D4 File Offset: 0x002353D4
465 public <>c()
466 {
467 }
468
469 // Token: 0x06003CB2 RID: 15538 RVA: 0x002371E8 File Offset: 0x002353E8
470 internal void <.ctor>b__21_0(UIElement element, UIMouseEvent evt)
471 {
472 }
473
474 // Token: 0x06003CB3 RID: 15539 RVA: 0x002371F8 File Offset: 0x002353F8
475 internal void <.ctor>b__21_1(UIElement element, UIMouseEvent evt)
476 {
477 }
478
479 // Token: 0x06003CB4 RID: 15540 RVA: 0x00237208 File Offset: 0x00235408
480 internal void <.ctor>b__21_2(UIElement element, UIMouseEvent evt)
481 {
482 }
483
484 // Token: 0x06003CB5 RID: 15541 RVA: 0x00237218 File Offset: 0x00235418
485 internal void <.ctor>b__21_3(UIElement element, UIMouseEvent evt)
486 {
487 }
488
489 // Token: 0x06003CB6 RID: 15542 RVA: 0x00237228 File Offset: 0x00235428
490 internal void <.ctor>b__21_4(UIElement element, UIMouseEvent evt)
491 {
492 }
493
494 // Token: 0x06003CB7 RID: 15543 RVA: 0x00237238 File Offset: 0x00235438
495 internal void <.ctor>b__21_5(UIElement element, UIMouseEvent evt)
496 {
497 }
498
499 // Token: 0x06003CB8 RID: 15544 RVA: 0x00237248 File Offset: 0x00235448
500 internal void <.ctor>b__21_6(UIElement element, UIMouseEvent evt)
501 {
502 }
503
504 // Token: 0x06003CB9 RID: 15545 RVA: 0x00237258 File Offset: 0x00235458
505 internal void <.ctor>b__21_7(UIElement element, UIMouseEvent evt)
506 {
507 }
508
509 // Token: 0x04007BCC RID: 31692
510 public static readonly UserInterface.<>c <>9;
511
512 // Token: 0x04007BCD RID: 31693
514
515 // Token: 0x04007BCE RID: 31694
517
518 // Token: 0x04007BCF RID: 31695
520
521 // Token: 0x04007BD0 RID: 31696
523
524 // Token: 0x04007BD1 RID: 31697
526
527 // Token: 0x04007BD2 RID: 31698
529
530 // Token: 0x04007BD3 RID: 31699
532
533 // Token: 0x04007BD4 RID: 31700
535 }
536 }
537}
class f__AnonymousType0<< Count > j__TPar
IntPtr method_code
Definition Delegate.cs:386
IntPtr invoke_impl
Definition Delegate.cs:371
static bool mouseRight
Definition Main.cs:685
static int mouseY
Definition Main.cs:601
static int mouseX
Definition Main.cs:587
static bool mouseLeft
Definition Main.cs:671
UserInterface.MouseElementEvent DoubleClickEvent
UserInterface.MouseElementEvent MouseUpEvent
UserInterface.MouseElementEvent MouseDownEvent
UserInterface.MouseElementEvent ClickEvent
MouseElementEvent(object @object, IntPtr method)
IAsyncResult BeginInvoke(UIElement element, UIMouseEvent evt, AsyncCallback callback, object @object)
void Invoke(UIElement element, UIMouseEvent evt)
void Update(GameTime time)
void HandleClick(UserInterface.InputPointerCache cache, GameTime time, bool isDown, UIElement mouseElement)
void SetState(UIState state)
void DrawDebugHitbox(BasicDebugDrawer drawer)
const double STATE_CHANGE_CLICK_DISABLE_TIME
void AddToHistory(UIState state)
void Draw(SpriteBatch spriteBatch, GameTime time)
UserInterface.InputPointerCache RightMouse
UserInterface.InputPointerCache LeftMouse
static UserInterface ActiveInstance
CalculatedStyle GetDimensions()