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
CreativeUI.cs
Go to the documentation of this file.
1using System;
11using Terraria.Net;
12using Terraria.UI;
13
15{
16 // Token: 0x02000A12 RID: 2578
17 public class CreativeUI
18 {
19 // Token: 0x17000874 RID: 2164
20 // (get) Token: 0x06004C15 RID: 19477 RVA: 0x0027100C File Offset: 0x0026F20C
21 // (set) Token: 0x06004C16 RID: 19478 RVA: 0x00271020 File Offset: 0x0026F220
22 public bool Enabled
23 {
25 get
26 {
27 return this.<Enabled>k__BackingField;
28 }
30 private set
31 {
32 }
33 }
34
35 // Token: 0x17000875 RID: 2165
36 // (get) Token: 0x06004C17 RID: 19479 RVA: 0x00271030 File Offset: 0x0026F230
37 public bool Blocked
38 {
39 get
40 {
41 if (!true)
42 {
43 }
44 int talkNPC = Main.LocalPlayer.talkNPC;
45 return true;
46 }
47 }
48
49 // Token: 0x06004C18 RID: 19480 RVA: 0x00271060 File Offset: 0x0026F260
50 public CreativeUI()
51 {
52 int num = 1;
54 base..ctor();
55 long entityId = this._itemSlotsForUI.entityId;
57 }
58
59 // Token: 0x06004C19 RID: 19481 RVA: 0x0027109C File Offset: 0x0026F29C
60 public void Initialize()
61 {
62 if (!true)
63 {
64 }
65 }
66
67 // Token: 0x06004C1A RID: 19482 RVA: 0x002710D4 File Offset: 0x0026F2D4
69 {
70 if (this.<Enabled>k__BackingField)
71 {
72 bool playerInventory = Main.playerInventory;
73 this._powersUI.Update(gameTime);
74 return;
75 }
76 }
77
78 // Token: 0x06004C1B RID: 19483 RVA: 0x00271100 File Offset: 0x0026F300
79 public void Draw(SpriteBatch spriteBatch)
80 {
81 bool initialized = this._initialized;
82 if (!initialized)
83 {
84 this.Initialize();
85 }
86 if (!initialized)
87 {
88 }
89 byte difficulty = Main.LocalPlayer.difficulty;
90 if (16968 == 0)
91 {
92 }
93 if (16968 == 0)
94 {
95 }
96 int screenHeight = Main.screenHeight;
97 bool flag = this.<Enabled>k__BackingField;
98 if (flag)
99 {
100 if (!flag)
101 {
102 }
103 float inventoryScale = Main.inventoryScale;
104 }
105 bool flag2 = this.<Enabled>k__BackingField;
106 if (flag2)
107 {
109 if (!flag2)
110 {
111 }
112 return;
113 }
114 }
115
116 // Token: 0x06004C1C RID: 19484 RVA: 0x0027117C File Offset: 0x0026F37C
118 {
119 /*
120An exception occurred when decompiling this method (06004C1C)
121
122ICSharpCode.Decompiler.DecompilerException: Error decompiling Terraria.UI.UIElement Terraria.GameContent.Creative.CreativeUI::ProvideItemSlotElement(System.Int32)
123
124 ---> System.Exception: Basic block has to end with unconditional control flow.
125{
126 IL_0003:
127 stloc:class Terraria.Item[](var_0_09, ldfld:class Terraria.Item[](CreativeUI::_itemSlotsForUI, ldloc:CreativeUI(this)))
128}
129
130 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
131 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
132 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
133 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
134 --- End of inner exception stack trace ---
135 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
136 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
137*/;
138 }
139
140 // Token: 0x06004C1D RID: 19485 RVA: 0x00271194 File Offset: 0x0026F394
142 {
143 while (itemSlotContext == 0)
144 {
145 }
146 }
147
148 // Token: 0x06004C1E RID: 19486 RVA: 0x002711A8 File Offset: 0x0026F3A8
150 {
151 if (itemSlotContext == 0)
152 {
154 if (item != null && item == null)
155 {
156 throw new ArrayTypeMismatchException();
157 }
159 }
160 }
161
162 // Token: 0x06004C1F RID: 19487 RVA: 0x002711D4 File Offset: 0x0026F3D4
164 {
166 if (!true)
167 {
168 }
170 if (!true)
171 {
172 }
173 if (this._buttonTexture == null)
174 {
175 }
176 if (!true)
177 {
178 }
179 if (!true)
180 {
181 }
184 if (!true)
185 {
186 }
189 bool flag = this.<Enabled>k__BackingField;
190 if (!true)
191 {
192 }
193 if (this._buttonBorderTexture == null)
194 {
195 }
196 if (!true)
197 {
198 }
199 if (!true)
200 {
201 }
202 bool mouseLeft = Main.mouseLeft;
203 if (!true)
204 {
205 }
206 bool mouseLeftRelease = Main.mouseLeftRelease;
207 this.ToggleMenu();
208 }
209
210 // Token: 0x06004C20 RID: 19488 RVA: 0x00271278 File Offset: 0x0026F478
211 public void SwapItem(Item item)
212 {
213 int num = 1;
215 if (num == 0)
216 {
217 }
218 }
219
220 // Token: 0x06004C21 RID: 19489 RVA: 0x00271294 File Offset: 0x0026F494
221 public void CloseMenu()
222 {
224 Vector2 position = itemSlotsForUI.position;
226 int myPlayer = Main.myPlayer;
228 Item item;
229 if (item != null && item == null)
230 {
231 throw new ArrayTypeMismatchException();
232 }
235 if (uiState != null)
236 {
238 return;
239 }
240 }
241
242 // Token: 0x06004C22 RID: 19490 RVA: 0x002712F8 File Offset: 0x0026F4F8
243 public void ToggleMenu()
244 {
245 bool flag = this.<Enabled>k__BackingField;
247 this.<Enabled>k__BackingField = flag;
248 powersUI.EscapeElements();
250 if (this.<Enabled>k__BackingField)
251 {
252 Recipe.FindRecipes(false);
255 return;
256 }
258 if (itemSlotsForUI.position == null)
259 {
260 }
262 int myPlayer = Main.myPlayer;
263 Vector2 position = this._itemSlotsForUI.position;
264 Item item;
265 if (item != null && item == null)
266 {
267 throw new ArrayTypeMismatchException();
268 }
271 if (uiState != null)
272 {
274 return;
275 }
276 }
277
278 // Token: 0x06004C23 RID: 19491 RVA: 0x002713A8 File Offset: 0x0026F5A8
280 {
281 if (!this.<Enabled>k__BackingField)
282 {
283 return;
284 }
286 if (uiState != null)
287 {
289 }
290 }
291
292 // Token: 0x06004C24 RID: 19492 RVA: 0x002713D0 File Offset: 0x0026F5D0
294 {
296 if (uiState != null)
297 {
299 return;
300 }
301 }
302
303 // Token: 0x06004C25 RID: 19493 RVA: 0x002713F0 File Offset: 0x0026F5F0
305 {
307 if (uiState != null)
308 {
310 return;
311 }
312 }
313
314 // Token: 0x06004C26 RID: 19494 RVA: 0x00271410 File Offset: 0x0026F610
316 {
318 Vector2 position = itemSlotsForUI.position;
319 if (itemSlotsForUI == null)
320 {
321 }
322 Item mouseItem = Main.mouseItem;
323 bool isAir = mouseItem.IsAir;
324 if (itemSlotsForUI == null)
325 {
326 }
327 int type = mouseItem.type;
328 if (itemSlotsForUI == null)
329 {
330 }
332 int type2 = mouseItem.type;
333 int sacrificeCount = itemSacrifices.GetSacrificeCount(type2);
334 return true;
335 }
336
337 // Token: 0x06004C27 RID: 19495 RVA: 0x00271478 File Offset: 0x0026F678
338 public bool GetSacrificeNumbers([Out] int itemIdChecked, [Out] int amountWeHave, [Out] int amountNeededTotal)
339 {
341 Vector2 position = itemSlotsForUI.position;
342 if (itemSlotsForUI == null)
343 {
344 }
345 return Main.LocalPlayerCreativeTracker.ItemSacrifices.TryGetSacrificeNumbers(itemIdChecked, amountWeHave, amountNeededTotal);
346 }
347
348 // Token: 0x06004C28 RID: 19496 RVA: 0x002714AC File Offset: 0x0026F6AC
350 {
351 Vector2 position = this._itemSlotsForUI.position;
353 long num = 0L;
354 int num2 = Math.Min(1073741824, (int)num);
356 if (-2147483648 == 0)
357 {
358 }
359 return (CreativeUI.ItemSacrificeResult)(-2147483648);
360 }
361
362 // Token: 0x06004C29 RID: 19497 RVA: 0x00271570 File Offset: 0x0026F770
375
376 // Token: 0x06004C2A RID: 19498 RVA: 0x002715B4 File Offset: 0x0026F7B4
377 public void Reset()
378 {
380 long entityId = itemSlotsForUI.entityId;
381 Vector2 position = itemSlotsForUI.position;
383 }
384
385 // Token: 0x0400863D RID: 34365
386 public const int ItemSlotIndexes_SacrificeItem = 0;
387
388 // Token: 0x0400863E RID: 34366
389 public const int ItemSlotIndexes_Count = 1;
390
391 // Token: 0x0400863F RID: 34367
393 private bool <Enabled>k__BackingField;
394
395 // Token: 0x04008640 RID: 34368
396 private bool _initialized;
397
398 // Token: 0x04008641 RID: 34369
400
401 // Token: 0x04008642 RID: 34370
403
404 // Token: 0x04008643 RID: 34371
406
407 // Token: 0x04008644 RID: 34372
409
410 // Token: 0x04008645 RID: 34373
412
413 // Token: 0x04008646 RID: 34374
415
416 // Token: 0x04008647 RID: 34375
418
419 // Token: 0x04008648 RID: 34376
421
422 // Token: 0x02000A13 RID: 2579
424 {
425 // Token: 0x0400864A RID: 34378
427 // Token: 0x0400864B RID: 34379
429 // Token: 0x0400864C RID: 34380
431 }
432 }
433}
class f__AnonymousType0<< Count > j__TPar
static byte Min(byte val1, byte val2)
Definition Math.cs:152
Vector2 position
Definition Entity.cs:460
void Draw(SpriteBatch spriteBatch)
Definition CreativeUI.cs:79
void DrawToggleButton(SpriteBatch spritebatch, Vector2 location)
bool GetSacrificeNumbers([Out] int itemIdChecked, [Out] int amountWeHave, [Out] int amountNeededTotal)
CreativeUI.ItemSacrificeResult SacrificeItem([Out] int amountWeSacrificed)
Item GetItemByIndex(int itemSlotContext)
UIElement ProvideItemSlotElement(int itemSlotContext)
void SetItembyIndex(Item item, int itemSlotContext)
bool IsAir
Definition Item.cs:1820
static CreativeUnlocksTracker LocalPlayerCreativeTracker
Definition Main.cs:5295
static int myPlayer
Definition Main.cs:2337
static bool mouseLeftRelease
Definition Main.cs:2029
static int screenHeight
Definition Main.cs:2015
static Item mouseItem
Definition Main.cs:2155
static float inventoryScale
Definition Main.cs:2253
static Microsoft.Xna.Framework.Vector2 MouseScreen
Definition Main.cs:4441
static bool playerInventory
Definition Main.cs:2057
static Player LocalPlayer
Definition Main.cs:5267
static bool mouseLeft
Definition Main.cs:671
static void FindRecipes(bool canDelayCheck=false)
Definition Recipe.cs:204
void Update(GameTime time)
static Vector2 Size(this Asset< Texture2D > tex)
Definition Utils.cs:736