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
GUIShop.cs
Go to the documentation of this file.
1using System;
2using Controller;
5using Terraria;
7using Terraria.UI;
8
9// Token: 0x02000172 RID: 370
10public class GUIShop
11{
12 // Token: 0x06000A78 RID: 2680 RVA: 0x00032B1C File Offset: 0x00030D1C
13 public void LoadPageRegion()
14 {
16 if (48 == 0)
17 {
18 }
21 }
22
23 // Token: 0x17000110 RID: 272
24 // (get) Token: 0x06000A79 RID: 2681 RVA: 0x00032B3C File Offset: 0x00030D3C
26 {
27 get
28 {
29 /*
30An exception occurred when decompiling this method (06000A79)
31
32ICSharpCode.Decompiler.DecompilerException: Error decompiling Terraria.Item GUIShop::get_SelectedItem()
33
34 ---> System.Exception: Basic block has to end with unconditional control flow.
35{
36 IL_0003:
37 stloc:int32(var_2_0A, callgetter:int32(Main::get_npcShop))
38}
39
40 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
41 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
42 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
43 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
44 --- End of inner exception stack trace ---
45 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
46 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
47*/;
48 }
49 }
50
51 // Token: 0x06000A7A RID: 2682 RVA: 0x00032B54 File Offset: 0x00030D54
52 private void PurchasePressedAndHeld(bool delayedPurchase = false)
53 {
54 if (!true)
55 {
56 }
57 int stackSplit = Main.stackSplit;
58 Item item;
59 int type = item.type;
60 if (type == 0)
61 {
62 }
63 Item item2;
64 bool flag = Main.mouseItem.IsTheSameAs(item2);
65 if (type == 0)
66 {
67 }
68 if (Main.mouseItem.type == 0)
69 {
70 int num = 20;
71 if (num == 0)
72 {
73 }
74 int num2 = 1;
76 int superFastStack = Main.superFastStack;
77 if (num == 0)
78 {
79 }
81 if (Main.mouseItem.maxStack == 0)
82 {
83 }
84 if (Main.mouseItem.type == 0)
85 {
86 return;
87 }
88 }
89 }
90
91 // Token: 0x06000A7B RID: 2683 RVA: 0x00032D68 File Offset: 0x00030F68
92 public void DrawPurchaseButton()
93 {
94 int num = 1;
95 if (num == 0)
96 {
97 }
98 if (Main.npcShop == 0)
99 {
100 return;
101 }
102 if (num == 0)
103 {
104 }
105 int myPlayer = Main.myPlayer;
106 Item selectedItem = this.SelectedItem;
107 int type = this.SelectedItem.type;
108 int stack = this.SelectedItem.stack;
109 if (stack == 0)
110 {
111 }
112 int myPlayer2 = Main.myPlayer;
113 if (!this._pendingPurchase)
114 {
115 }
116 int shopSpecialCurrency = this.SelectedItem.shopSpecialCurrency;
117 if (stack == 0)
118 {
119 }
120 Item mouseItem = Main.mouseItem;
122 bool flag = mouseItem.IsTheSameAs(selectedItem2);
123 if (stack == 0)
124 {
125 }
126 if (Main.mouseItem.type != 0)
127 {
128 return;
129 }
130 }
131
132 // Token: 0x06000A7C RID: 2684 RVA: 0x00033034 File Offset: 0x00031234
133 public void Draw()
134 {
135 int num = 1;
136 if (num == 0)
137 {
138 }
139 int npcShop = Main.npcShop;
140 if (num == 0)
141 {
142 }
143 bool playerInventory = Main.playerInventory;
144 if (num == 0)
145 {
146 }
147 int myPlayer = Main.myPlayer;
148 if (num == 0)
149 {
150 }
151 long num2 = 0L;
152 Main.npcShop = (int)num2;
153 if (num == 0)
154 {
155 }
156 int npcShop2 = Main.npcShop;
157 if (num == 0)
158 {
159 }
160 if (num == 0)
161 {
162 }
163 int num3 = 255;
165 if (num3 == 0)
166 {
167 }
168 if (num3 == 0)
169 {
170 }
174 if (num3 == 0)
175 {
176 }
182 {
183 }
185 string textValue = Language.GetTextValue("Mobile.Savings");
186 }
187
188 // Token: 0x06000A7D RID: 2685 RVA: 0x000330F0 File Offset: 0x000312F0
189 public float ItemScale(int index)
190 {
191 /*
192An exception occurred when decompiling this method (06000A7D)
193
194ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Single GUIShop::ItemScale(System.Int32)
195
196 ---> System.Exception: Basic block has to end with unconditional control flow.
197{
198 Block_0:
199 stloc:!0(var_0_05, callgetter:!0(PageControllerLayoutDefinition`1::get_Instance))
200}
201
202 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
203 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
204 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
205 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
206 --- End of inner exception stack trace ---
207 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
208 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
209*/;
210 }
211
212 // Token: 0x06000A7E RID: 2686 RVA: 0x00033104 File Offset: 0x00031304
214 {
216 if (pendingPurchase)
217 {
218 if (!pendingPurchase)
219 {
220 }
221 int myPlayer = Main.myPlayer;
222 }
223 }
224
225 // Token: 0x06000A7F RID: 2687 RVA: 0x00033128 File Offset: 0x00031328
226 public void CancelPendingItems()
227 {
228 if (this._pendingPurchase)
229 {
230 return;
231 }
232 }
233
234 // Token: 0x06000A80 RID: 2688 RVA: 0x00033140 File Offset: 0x00031340
235 public void ItemOver(int index)
236 {
240 Item mouseItem = Main.mouseItem;
241 int npcShop = Main.npcShop;
243 int num = this.itemDragStart;
245 if (this._selectedItem == 0)
246 {
247 }
248 if (Main.mouseItem.type == 0)
249 {
250 }
252 int npcShop2 = Main.npcShop;
253 long num2 = 0L;
254 this.PurchasePressedAndHeld(num2 != 0L);
255 }
256
257 // Token: 0x17000111 RID: 273
258 // (get) Token: 0x06000A81 RID: 2689 RVA: 0x00033264 File Offset: 0x00031464
259 public bool HasFocus
260 {
261 get
262 {
264 return true;
265 }
266 }
267
268 // Token: 0x06000A82 RID: 2690 RVA: 0x0003327C File Offset: 0x0003147C
269 public void ItemDraw(ItemGrid_Layout gridLayout, int index, Vector2 position, float scale)
270 {
271 int num = this.cursorOver;
272 if (!true)
273 {
274 }
275 int num2 = this.itemOver;
276 if (this._selectedItem == 0)
277 {
278 }
281 ItemSlot.SetSelectHighlight(true, scale);
282 if (instance == null)
283 {
284 }
285 Main.inventoryScale = scale;
286 int npcShop = Main.npcShop;
287 }
288
289 // Token: 0x06000A83 RID: 2691 RVA: 0x000332D4 File Offset: 0x000314D4
290 private void DrawSlots(SpriteBatch spriteBatch)
291 {
293 if (48 == 0)
294 {
295 }
296 int num = this.itemDragStart;
297 if (num == 0)
298 {
299 }
300 bool mouseLeft = Main.mouseLeft;
301 if (num == 0)
302 {
303 }
304 if (Main.mouseItem != null)
305 {
306 if (num == 0)
307 {
308 }
309 if (Main.mouseItem.type != 0)
310 {
311 goto IL_0061;
312 }
313 }
314 int num2 = this.itemDragStart;
315 int num3 = this.itemOver;
316 long num4 = 0L;
317 this.PurchasePressedAndHeld(num4 != 0L);
318 if (num2 == 0)
319 {
320 }
321 Recipe.FindRecipes(false);
322 IL_0061:
324 }
325
326 // Token: 0x06000A84 RID: 2692 RVA: 0x0003334C File Offset: 0x0003154C
327 public GUIShop()
328 {
329 }
330
331 // Token: 0x04000A67 RID: 2663
332 private int cursorOver;
333
334 // Token: 0x04000A68 RID: 2664
335 private int itemOver;
336
337 // Token: 0x04000A69 RID: 2665
338 private int itemDragStart;
339
340 // Token: 0x04000A6A RID: 2666
342
343 // Token: 0x04000A6B RID: 2667
344 private int _selectedItem;
345
346 // Token: 0x04000A6C RID: 2668
347 private float buyButtonScale = (float)16256;
348
349 // Token: 0x04000A6D RID: 2669
350 private bool _pendingPurchase;
351
352 // Token: 0x04000A6E RID: 2670
353 private int _pendingCost;
354
355 // Token: 0x04000A6F RID: 2671
356 private int multibuyDelay;
357
358 // Token: 0x04000A70 RID: 2672
359 public float hoverCraftDelay;
360
361 // Token: 0x04000A71 RID: 2673
363}
class f__AnonymousType0<< Count > j__TPar
static DrPlatform.DrPlatformType CurrentPlatform
Definition DrPlatform.cs:26
int itemOver
Definition GUIShop.cs:335
bool HasFocus
Definition GUIShop.cs:260
void CancelPendingItems()
Definition GUIShop.cs:226
int itemDragStart
Definition GUIShop.cs:338
float buyButtonScale
Definition GUIShop.cs:347
float hoverCraftDelay
Definition GUIShop.cs:359
void ItemOver(int index)
Definition GUIShop.cs:235
void Draw()
Definition GUIShop.cs:133
void PurchasePendingItems()
Definition GUIShop.cs:213
void PurchasePressedAndHeld(bool delayedPurchase=false)
Definition GUIShop.cs:52
void LoadPageRegion()
Definition GUIShop.cs:13
int _selectedItem
Definition GUIShop.cs:344
void ItemDraw(ItemGrid_Layout gridLayout, int index, Vector2 position, float scale)
Definition GUIShop.cs:269
int cursorOver
Definition GUIShop.cs:332
void DrawPurchaseButton()
Definition GUIShop.cs:92
Item SelectedItem
Definition GUIShop.cs:26
void DrawSlots(SpriteBatch spriteBatch)
Definition GUIShop.cs:290
int multibuyDelay
Definition GUIShop.cs:356
GUITransactionButton.InputState lastState
Definition GUIShop.cs:362
int _pendingCost
Definition GUIShop.cs:353
bool _pendingPurchase
Definition GUIShop.cs:350
float ItemScale(int index)
Definition GUIShop.cs:189
DateTime itemPurchaseDelayStart
Definition GUIShop.cs:341
GUIShop()
Definition GUIShop.cs:327
int maxStack
Definition Item.cs:2225
bool IsTheSameAs(Item compareItem)
Definition Item.cs:1768
int shopSpecialCurrency
Definition Item.cs:2379
static string GetTextValue(string key)
Definition Language.cs:54
static int myPlayer
Definition Main.cs:2337
static int superFastStack
Definition Main.cs:2127
static Item mouseItem
Definition Main.cs:2155
static int npcShop
Definition Main.cs:2547
static int stackSplit
Definition Main.cs:2071
static bool playerInventory
Definition Main.cs:2057
static bool mouseLeft
Definition Main.cs:671
static void FindRecipes(bool canDelayCheck=false)
Definition Recipe.cs:204
static void SetSelectHighlight(bool hasFocus, float highlightScale=-1f)
Definition ItemSlot.cs:702
static bool ControllerModeLocked