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
GUITransactionButton.cs
Go to the documentation of this file.
1using System;
2using Controller;
6using Terraria;
7using UnityEngine;
8
9// Token: 0x0200011C RID: 284
10public static class GUITransactionButton
11{
12 // Token: 0x06000720 RID: 1824 RVA: 0x000190D8 File Offset: 0x000172D8
25
26 // Token: 0x06000721 RID: 1825 RVA: 0x000190F8 File Offset: 0x000172F8
28 {
29 if (true)
30 {
32 return rectangle;
33 }
35 return rectangle2;
36 }
37
38 // Token: 0x06000722 RID: 1826 RVA: 0x0001910C File Offset: 0x0001730C
40 {
41 if (layout.overloadSize)
42 {
44 Microsoft.Xna.Framework.Vector2 location = layout.Location;
45 float x = layout.Location.X;
46 float y = layout.Location.Y;
47 float x2 = layout.overloadedSize.X;
48 float y2 = layout.overloadedSize.Y;
49 if (backing != null)
50 {
51 }
52 if (additionalBacking != null)
53 {
56 float y3 = layout.overloadedSize.Y;
57 float x3 = layout.overloadedSize.X;
60 }
61 if (border != null)
62 {
65 float y4 = layout.overloadedSize.Y;
66 float x4 = layout.overloadedSize.X;
69 float x5 = layout.Location.X;
70 float y5 = layout.Location.Y;
71 }
72 global::Cursor cursor;
73 if (layout.OverBackingHighlight.Texture != null && cursor != null)
74 {
76 Microsoft.Xna.Framework.Vector2 vector6 = layout.OverBackingHighlight.Texture.Size();
77 float y6 = layout.overloadedSize.Y;
78 float x6 = layout.overloadedSize.X;
81 float x7 = layout.Location.X;
82 float y7 = layout.Location.Y;
83 Microsoft.Xna.Framework.Graphics.Texture2D texture = layout.OverBackingHighlight.Texture;
84 return;
85 }
86 }
87 else
88 {
89 if (backing != null)
90 {
91 return;
92 }
95 if (location3 != null)
96 {
97 GraphicsDevice graphicsDevice = texture.graphicsDevice;
100 }
106 global::Cursor cursor2;
107 if (texture2D != null && cursor2 != null)
108 {
113 }
114 }
115 }
116
117 // Token: 0x06000723 RID: 1827 RVA: 0x00019348 File Offset: 0x00017548
119 {
120 if (layout.DrawControlsIconOnFocus)
121 {
123 int iconMaxSizeInset = layout.IconMaxSizeInset;
124 int width = backing.Width;
125 int arraySize = backing.ArraySize;
126 float x = layout.ControlIconOffset.X;
127 float y = layout.ControlIconOffset.Y;
128 return;
129 }
130 }
131
132 // Token: 0x06000724 RID: 1828 RVA: 0x0001940C File Offset: 0x0001760C
139
140 // Token: 0x06000725 RID: 1829 RVA: 0x00019428 File Offset: 0x00017628
142 {
143 int num = 1;
144 if (num == 0)
145 {
146 }
147 if (num == 0)
148 {
149 }
150 long num2 = 0L;
151 bool mouseLeft = Main.mouseLeft;
152 if (58 != 0)
153 {
155 bool mouseLeftRelease = Main.mouseLeftRelease;
156 }
160 if (texture2D != null)
161 {
163 if (texture2D2 != null)
164 {
165 long value = num2.m_value;
167 if (texture2D3 != null)
168 {
169 }
170 }
171 }
173 int width = texture2D4.Width;
174 int arraySize = texture2D4.ArraySize;
178 global::Cursor cursor;
179 if (texture2D5 == null || cursor != null)
180 {
181 }
182 int width2 = texture2D4.Width;
183 int arraySize2 = texture2D4.ArraySize;
185 int width3 = texture2D6.Width;
186 if (texture2D6.ArraySize == 0)
187 {
188 }
189 int num3 = 32640;
191 if (rectangle == null)
192 {
193 }
194 if (width3 == 0)
195 {
196 return;
197 }
198 if (rectangle == null)
199 {
200 }
201 if (rectangle == null)
202 {
203 }
204 int width4 = texture2D4.Width;
205 int height = texture2D4.Height;
208 if (rectangle == null)
209 {
210 }
211 if (num3 == 0)
212 {
213 return;
214 }
215 }
216
217 // Token: 0x06000726 RID: 1830 RVA: 0x00019528 File Offset: 0x00017728
219 {
220 if (!true)
221 {
222 }
224 return rectangle;
225 }
226
227 // Token: 0x06000727 RID: 1831 RVA: 0x0001953C File Offset: 0x0001773C
241
242 // Token: 0x06000728 RID: 1832 RVA: 0x00019564 File Offset: 0x00017764
249
250 // Token: 0x06000729 RID: 1833 RVA: 0x00019580 File Offset: 0x00017780
251 public static GUITransactionButton.InputState Draw(TransactionButton_Layout layout, Item item, string label, bool disabled, float scale, bool forcedPressed = false, bool hasControllerFocus = false, bool forceOver = false, bool disablePressedState = false)
252 {
253 /*
254An exception occurred when decompiling this method (06000729)
255
256ICSharpCode.Decompiler.DecompilerException: Error decompiling GUITransactionButton/InputState GUITransactionButton::Draw(TransactionButton_Layout,Terraria.Item,System.String,System.Boolean,System.Single,System.Boolean,System.Boolean,System.Boolean,System.Boolean)
257
258 ---> System.Exception: Basic block has to end with unconditional control flow.
259{
260 IL_021B:
261 brtrue(IL_0000, logicnot:bool(ldloc:Rectangle[exp:bool](var_112)))
262}
263
264 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
265 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
266 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
267 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
268 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
269 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
270 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
271 --- End of inner exception stack trace ---
272 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
273 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
274*/;
275 }
276
277 // Token: 0x0600072A RID: 1834 RVA: 0x000197B0 File Offset: 0x000179B0
279 {
280 if (itemTexture != null && layout.DrawItem)
281 {
282 float x = layout.ItemOffset.X;
283 int iconMaxSizeInset = layout.IconMaxSizeInset;
284 int width = backing.Width;
285 int arraySize = backing.ArraySize;
286 float y = layout.ItemOffset.Y;
287 int width2 = itemTexture.Width;
288 int arraySize2 = itemTexture.ArraySize;
289 return;
290 }
291 }
292
293 // Token: 0x0600072B RID: 1835 RVA: 0x0001987C File Offset: 0x00017A7C
295 {
296 if (layout != null)
297 {
298 }
299 if (layout != null)
300 {
301 int myPlayer = Main.myPlayer;
302 return;
303 }
304 }
305
306 // Token: 0x0600072C RID: 1836 RVA: 0x000198A4 File Offset: 0x00017AA4
324
325 // Token: 0x0600072D RID: 1837 RVA: 0x000198CC File Offset: 0x00017ACC
334
335 // Token: 0x0600072E RID: 1838 RVA: 0x000198E0 File Offset: 0x00017AE0
341
342 // Token: 0x0600072F RID: 1839 RVA: 0x000198F0 File Offset: 0x00017AF0
349
350 // Token: 0x06000730 RID: 1840 RVA: 0x0001990C File Offset: 0x00017B0C
352 {
353 bool drawLabel = layout.DrawLabel;
354 if (drawLabel)
355 {
356 if (!drawLabel)
357 {
358 }
359 bool mouseHoverFade = layout.MouseHoverFade;
360 if (mouseHoverFade)
361 {
362 if (!mouseHoverFade)
363 {
364 }
365 int tooltipTime = Main.tooltipTime;
366 if (17279 == 0)
367 {
368 }
369 return;
370 }
372 }
373 }
374
375 // Token: 0x06000731 RID: 1841 RVA: 0x00019958 File Offset: 0x00017B58
381
382 // Token: 0x06000732 RID: 1842 RVA: 0x00019968 File Offset: 0x00017B68
384 {
385 int num = 1;
386 if (num == 0)
387 {
388 }
389 if (num == 0)
390 {
391 }
392 bool mouseLeft = Main.mouseLeft;
393 int num2 = 67;
394 if (num2 != 0)
395 {
396 if (num2 == 0)
397 {
398 }
400 if (num2 == 0)
401 {
402 }
403 bool mouseLeftRelease = Main.mouseLeftRelease;
404 }
408 if (texture2D != null)
409 {
411 if (texture2D2 == null)
412 {
413 goto IL_005C;
414 }
416 if (texture2D3 != null)
417 {
418 }
419 }
420 long num3 = 0L;
421 IL_005C:
423 int width = texture2D4.Width;
424 int arraySize = texture2D4.ArraySize;
425 global::Cursor cursor;
426 if ((num3 == 0L && num3 == 0L) || cursor != null)
427 {
428 }
429 if (width == 0)
430 {
431 }
433 int num4;
434 int num6;
435 if (rectangle != null && rectangle == null)
436 {
438 global::Cursor cursor2;
439 if (texture2D5 == null || cursor2 != null)
440 {
441 }
442 int width2 = texture2D4.Width;
443 int arraySize2 = texture2D4.ArraySize;
444 num4 = 32640;
445 int num5 = 32768;
447 int width3 = texture2D6.Width;
448 int arraySize3 = texture2D6.ArraySize;
449 if (42190736 != 0)
450 {
451 }
452 if (42190736 == 0)
453 {
454 }
455 num6 = 32640;
456 if (num5 == 0)
457 {
458 }
459 }
461 if (rectangle2 == null)
462 {
463 }
464 if (num4 == 0)
465 {
466 return;
467 }
468 if (rectangle2 != null)
469 {
470 if (rectangle2 == null)
471 {
472 }
473 if (rectangle2 == null)
474 {
475 }
476 }
477 if (rectangle2 == null)
478 {
479 }
480 if (rectangle2 == null)
481 {
482 }
483 int width4 = texture2D4.Width;
484 int height = texture2D4.Height;
485 if (rectangle2 == null)
486 {
487 }
488 if (num6 == 0)
489 {
490 }
491 if (disabled)
492 {
493 return;
494 }
495 }
496
497 // Token: 0x04000594 RID: 1428
498 public static bool disableControllerInput;
499
500 // Token: 0x0200011D RID: 285
501 public sealed class DrawItemHandler : MulticastDelegate
502 {
503 // Token: 0x06000733 RID: 1843 RVA: 0x00019AA0 File Offset: 0x00017CA0
504 public DrawItemHandler(object @object, IntPtr method)
505 {
507 this.m_target = @object;
509 this.method_code = this;
510 }
511
512 // Token: 0x06000734 RID: 1844 RVA: 0x00019AF4 File Offset: 0x00017CF4
513 public void Invoke(Microsoft.Xna.Framework.Vector2 position, float itemScale)
514 {
517 IntPtr method = this.method;
518 }
519
520 // Token: 0x06000735 RID: 1845 RVA: 0x000021DB File Offset: 0x000003DB
521 public IAsyncResult BeginInvoke(Microsoft.Xna.Framework.Vector2 position, float itemScale, AsyncCallback callback, object @object)
522 {
523 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
524 }
525
526 // Token: 0x06000736 RID: 1846 RVA: 0x00019B18 File Offset: 0x00017D18
527 public void EndInvoke(IAsyncResult result)
528 {
529 }
530 }
531
532 // Token: 0x0200011E RID: 286
533 public enum InputState
534 {
535 // Token: 0x04000596 RID: 1430
536 Clicked,
537 // Token: 0x04000597 RID: 1431
538 Over,
539 // Token: 0x04000598 RID: 1432
540 Down,
541 // Token: 0x04000599 RID: 1433
542 None
543 }
544}
class f__AnonymousType0<< Count > j__TPar
static void SetButtonRegion(Rectangle region)
DrawItemHandler(object @object, IntPtr method)
void Invoke(Microsoft.Xna.Framework.Vector2 position, float itemScale)
IAsyncResult BeginInvoke(Microsoft.Xna.Framework.Vector2 position, float itemScale, AsyncCallback callback, object @object)
static Rectangle GetOverloadedPickingRegion(TransactionButton_Layout layout, float scale)
static Rectangle GetPickRegion(TransactionButton_Layout layout)
static GUITransactionButton.InputState HandleControllerAction(TransactionButton_Layout layout, ControllerActionButton action, string label, bool disabled, bool disablePressedState, bool hasControllerFocus)
static GUITransactionButton.InputState Draw(TransactionButton_Layout layout, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, Rectangle srcRect, string label, bool disabled, float scale, Microsoft.Xna.Framework.Graphics.Color? overloadedItemColour, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false)
static GUITransactionButton.InputState Draw(TransactionButton_Layout layout, Item item, string label, bool disabled, float scale, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false)
static GUITransactionButton.InputState DrawWithBanner(TransactionButton_Layout layout, GUIControlsBanner.ActionSource source, ControllerActionButton action, Item item, string label, bool disabled, float scale, bool forcedPressed=false, bool hasControllerFocus=true, bool forceOver=false, bool disablePressedState=false, bool drawWhenControllerConnected=false, bool addTouchBanner=false)
static GUITransactionButton.InputState DrawWithBanner(TransactionButton_Layout layout, GUIControlsBanner.ActionSource source, ControllerActionButton action, GUITransactionButton.DrawItemHandler itemHandler, Microsoft.Xna.Framework.Vector2 itemSize, string label, bool disabled, float scale, bool forcePressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false, bool drawWhenControllerConnected=false)
static void DrawLabel(TransactionButton_Layout layout, string label, Microsoft.Xna.Framework.Graphics.Color labelColour, bool over)
static GUITransactionButton.InputState DrawWithBanner(TransactionButton_Layout layout, GUIControlsBanner.ActionSource source, ControllerActionButton action, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, Rectangle srcRect, string label, bool disabled, float scale, Microsoft.Xna.Framework.Graphics.Color? overloadedItemColour, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false, bool drawWhenControllerConnected=false)
static void DrawControlIcon(TransactionButton_Layout layout, Microsoft.Xna.Framework.Graphics.Texture2D backing, Microsoft.Xna.Framework.Graphics.Color iconColour, float scale, bool hasControllerFocus)
static Rectangle LoadButtonRegion(TransactionButton_Layout layout, float scale)
static GUITransactionButton.InputState DrawWithBanner(TransactionButton_Layout layout, GUIControlsBanner.ActionSource source, ControllerActionButton action, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, string label, bool disabled, float scale, Microsoft.Xna.Framework.Graphics.Color? overloadedItemColour, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false, bool drawWhenControllerConnected=false)
static void DrawBacking(TransactionButton_Layout layout, Microsoft.Xna.Framework.Graphics.Texture2D backing, Microsoft.Xna.Framework.Graphics.Texture2D additionalBacking, Microsoft.Xna.Framework.Graphics.Color backingColour, Microsoft.Xna.Framework.Graphics.Color additionalbackingColour, Microsoft.Xna.Framework.Graphics.Texture2D border, Microsoft.Xna.Framework.Graphics.Color borderColour, float scale, bool over)
static GUITransactionButton.InputState Draw(TransactionButton_Layout layout, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, Rectangle srcRect, Microsoft.Xna.Framework.Graphics.Texture2D itemTextureHighlight, Rectangle srcRectHighlight, string label, bool disabled, float scale, Microsoft.Xna.Framework.Graphics.Color? overloadedItemColour, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false)
static void DrawItem(TransactionButton_Layout layout, Microsoft.Xna.Framework.Graphics.Texture2D backing, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, Microsoft.Xna.Framework.Graphics.Color itemColour, float scale)
static GUITransactionButton.InputState DrawWithBanner(TransactionButton_Layout layout, GUIControlsBanner.ActionSource source, ControllerActionButton action, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, Rectangle srcRect, Microsoft.Xna.Framework.Graphics.Texture2D itemTextureHighlight, Rectangle srcRectHighlight, string label, bool disabled, float scale, Microsoft.Xna.Framework.Graphics.Color? overloadedItemColour, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false, bool drawWhenControllerConnected=false)
static GUITransactionButton.InputState Draw(TransactionButton_Layout layout, GUITransactionButton.DrawItemHandler itemHandler, Microsoft.Xna.Framework.Vector2 itemSize, string label, bool disabled, float scale, bool forcePressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false)
static Rectangle GetRegion(TransactionButton_Layout layout)
static GUITransactionButton.InputState Draw(TransactionButton_Layout layout, Microsoft.Xna.Framework.Graphics.Texture2D itemTexture, string label, bool disabled, float scale, Microsoft.Xna.Framework.Graphics.Color? overloadedItemColour, bool forcedPressed=false, bool hasControllerFocus=false, bool forceOver=false, bool disablePressedState=false)
IntPtr method_code
Definition Delegate.cs:386
IntPtr invoke_impl
Definition Delegate.cs:371
static int myPlayer
Definition Main.cs:2337
static bool mouseLeftRelease
Definition Main.cs:2029
static int tooltipTime
Definition Main.cs:198
static bool mouseLeft
Definition Main.cs:671