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
GUIAmmo.cs
Go to the documentation of this file.
1using System;
4using Terraria;
6using Terraria.UI;
7using UnityEngine;
8
9// Token: 0x02000122 RID: 290
10public class GUIAmmo
11{
12 // Token: 0x06000746 RID: 1862 RVA: 0x0001ACA4 File Offset: 0x00018EA4
13 public GUIAmmo()
14 {
15 }
16
17 // Token: 0x06000747 RID: 1863 RVA: 0x0001ACC8 File Offset: 0x00018EC8
29
30 // Token: 0x06000748 RID: 1864 RVA: 0x0001ACF0 File Offset: 0x00018EF0
32 {
33 int ammo = checkItem.ammo;
34 int bait = checkItem.bait;
35 if (checkItem.notAmmo)
36 {
37 int type = checkItem.type;
38 }
39 return true;
40 }
41
42 // Token: 0x06000749 RID: 1865 RVA: 0x0001AD1C File Offset: 0x00018F1C
43 public float ItemScale(int index)
44 {
45 /*
46An exception occurred when decompiling this method (06000749)
47
48ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Single GUIAmmo::ItemScale(System.Int32)
49
50 ---> System.Exception: Basic block has to end with unconditional control flow.
51{
52 Block_0:
53 stloc:bool(var_1_07, callgetter:bool(RightSideHUDAnchorUpdator::get_UseCollpasedCoinsAmmo))
54 stloc:!0(var_2_0D, callgetter:!0(PageControllerLayoutDefinition`1::get_Instance))
55}
56
57 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
58 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
59 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
60 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
61 --- End of inner exception stack trace ---
62 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
63 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
64*/;
65 }
66
67 // Token: 0x0600074A RID: 1866 RVA: 0x0001AD38 File Offset: 0x00018F38
68 public void ItemOver(int index)
69 {
70 int myPlayer = Main.myPlayer;
77 global::Cursor cursor;
78 if (cursor != null)
79 {
80 return;
81 }
82 long num = 0L;
83 global::Cursor cursor2;
84 if (cursor2 != null)
85 {
86 return;
87 }
88 bool flag = this.rightClickHeld;
89 int num3;
90 if (num == 0L && !flag)
91 {
92 float num2 = this.doubleClickTimer;
93 num3 = this.lastItemClicked;
95 }
96 if (flag)
97 {
98 int num4 = this.lastItemClicked;
99 int num5 = this.lastItemClicked;
100 if (num5 == 0)
101 {
102 }
103 bool mouseLeft = Main.mouseLeft;
104 int type;
105 if (num5 != 0)
106 {
107 if (num5 == 0)
108 {
109 }
110 if (Main.mouseItem != null)
111 {
112 if (num5 == 0)
113 {
114 }
115 type = Main.mouseItem.type;
116 if (type != 0)
117 {
118 }
119 }
120 }
121 if (type == 0)
122 {
123 }
125 int myPlayer7 = Main.myPlayer;
126 if (num3 == 0)
127 {
128 }
129 bool mouseRight = Main.mouseRight;
130 int myPlayer8 = Main.myPlayer;
131 return;
132 }
133 int myPlayer9 = Main.myPlayer;
136 if (num3 == 0)
137 {
138 }
139 Recipe.FindRecipes(false);
140 if (num3 == 0)
141 {
143 if (guicontrollerAmmo != null)
144 {
146 return;
147 }
148 return;
149 }
150 else
151 {
153 int type2;
154 if (Main.mouseItem == null || Main.mouseItem.type == 0)
155 {
156 int num6 = this.itemDragStart;
157 if (num6 == 0)
158 {
159 }
160 bool mouseLeftRelease = Main.mouseLeftRelease;
161 if (num6 == 0)
162 {
163 }
165 if (num6 == 0)
166 {
167 }
168 if (Main.mouseItem != null)
169 {
170 if (num6 == 0)
171 {
172 }
174 if (type2 != 0)
175 {
176 }
177 }
178 }
179 if (type2 == 0)
180 {
181 }
183 int cursorOverride = Main.cursorOverride;
184 int num7;
185 int num8;
186 if (num7 != 0)
187 {
188 if (type2 == 0)
189 {
190 }
192 if (num8 == 0)
193 {
194 }
195 if (type2 == 0)
196 {
197 }
198 Recipe.FindRecipes(false);
201 }
202 if (num8 != 0)
203 {
204 string textValue = Language.GetTextValue("ControllerMappings.TakeOne");
206 Recipe.FindRecipes(false);
207 return;
208 }
209 return;
210 }
211 }
212
213 // Token: 0x0600074B RID: 1867 RVA: 0x0001B074 File Offset: 0x00019274
214 public void ItemDraw(ItemGrid_Layout gridLayout, int index, Microsoft.Xna.Framework.Vector2 position, float scale)
215 {
216 this.ItemOver(index);
220 int num = this.cursorOver;
221 if (!true)
222 {
223 }
224 if (this.itemOver == 0)
225 {
226 }
229 if (60 == 0)
230 {
231 }
232 ItemSlot.SetSelectHighlight(true, scale);
233 if (instance == null)
234 {
235 }
236 Main.inventoryScale = scale;
237 int myPlayer = Main.myPlayer;
238 int num2 = 16256;
239 int myPlayer2 = Main.myPlayer;
240 if (num2 == 0)
241 {
242 }
243 }
244
245 // Token: 0x0600074C RID: 1868 RVA: 0x0001B194 File Offset: 0x00019394
246 public void Draw()
247 {
248 int num = 1;
249 float num2 = this.doubleClickTimer;
250 float deltaTime = Time.deltaTime;
252 if (num == 0)
253 {
254 }
255 if (num == 0)
256 {
257 }
260 this.itemOver = (int)deltaTime;
266 if (instance2 == null)
267 {
268 }
269 if (this.rightClickHeld)
270 {
271 int num3 = this.itemOver;
272 }
273 int num4 = this.itemDragStart;
274 if (num4 == 0)
275 {
276 }
277 bool mouseLeft = Main.mouseLeft;
278 if (num4 == 0)
279 {
280 }
281 if (Main.mouseItem != null)
282 {
283 if (num4 == 0)
284 {
285 }
286 int type = Main.mouseItem.type;
287 if (type != 0)
288 {
289 this.itemDragStart = type;
290 return;
291 }
292 }
293 int num5 = this.itemDragStart;
294 int num6 = this.itemOver;
295 int myPlayer = Main.myPlayer;
296 int num7 = this.itemDragStart;
297 if (num6 == 0)
298 {
299 }
300 Recipe.FindRecipes(false);
301 }
302
303 // Token: 0x040005AD RID: 1453
304 private int itemOver = 1;
305
306 // Token: 0x040005AE RID: 1454
307 private int cursorOver;
308
309 // Token: 0x040005AF RID: 1455
310 private int itemDragStart = 1;
311
312 // Token: 0x040005B0 RID: 1456
313 private int lastItemClicked;
314
315 // Token: 0x040005B1 RID: 1457
316 private float doubleClickTimer;
317
318 // Token: 0x040005B2 RID: 1458
319 private bool rightClickHeld;
320
321 // Token: 0x040005B3 RID: 1459
323
324 // Token: 0x040005B4 RID: 1460
326
327 // Token: 0x040005B5 RID: 1461
329}
class f__AnonymousType0<< Count > j__TPar
bool CanBeStored(Item checkItem)
Definition GUIAmmo.cs:31
int cursorOver
Definition GUIAmmo.cs:307
int lastItemClicked
Definition GUIAmmo.cs:313
float doubleClickTimer
Definition GUIAmmo.cs:316
int itemDragStart
Definition GUIAmmo.cs:310
Rectangle GetRegion()
Definition GUIAmmo.cs:18
float ItemScale(int index)
Definition GUIAmmo.cs:43
void ItemOver(int index)
Definition GUIAmmo.cs:68
GUIItemGrid.GetItemScaleHandler ItemScaleDelegate
Definition GUIAmmo.cs:322
void ItemDraw(ItemGrid_Layout gridLayout, int index, Microsoft.Xna.Framework.Vector2 position, float scale)
Definition GUIAmmo.cs:214
bool rightClickHeld
Definition GUIAmmo.cs:319
GUIItemGrid.DrawItemHandler itemDrawDelegate
Definition GUIAmmo.cs:328
GUIAmmo()
Definition GUIAmmo.cs:13
int itemOver
Definition GUIAmmo.cs:304
void Draw()
Definition GUIAmmo.cs:246
GUIItemGrid.CursorOver ItemOverDelegate
Definition GUIAmmo.cs:325
bool IsAir
Definition Item.cs:1820
static string GetTextValue(string key)
Definition Language.cs:54
static int myPlayer
Definition Main.cs:2337
static bool mouseRight
Definition Main.cs:685
static int cursorOverride
Definition Main.cs:3147
static bool mouseLeftRelease
Definition Main.cs:2029
static Item mouseItem
Definition Main.cs:2155
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 float deltaTime
Definition Time.cs:14