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
GUIResearch.cs
Go to the documentation of this file.
1using System;
8using Terraria;
14using Terraria.Net;
15
16// Token: 0x0200016A RID: 362
17public class GUIResearch
18{
19 // Token: 0x06000A2C RID: 2604 RVA: 0x00030B40 File Offset: 0x0002ED40
20 public static void LoadContent()
21 {
22 if (!true)
23 {
24 }
25 }
26
27 // Token: 0x06000A2D RID: 2605 RVA: 0x00030B58 File Offset: 0x0002ED58
32
33 // Token: 0x06000A2E RID: 2606 RVA: 0x00030B78 File Offset: 0x0002ED78
35 {
36 /*
37An exception occurred when decompiling this method (06000A2E)
38
39ICSharpCode.Decompiler.DecompilerException: Error decompiling GUIResearch/ResearchState GUIResearch::CanBeResearched(Terraria.Item,System.Int32)
40
41 ---> System.Exception: Basic block has to end with unconditional control flow.
42{
43 IL_0008:
44 stloc:int32(var_0_0E, ldfld:int32(Item::type, ldloc:Item(item)))
45 stloc:ItemsSacrificedUnlocksTracker(var_3_1B, ldfld:ItemsSacrificedUnlocksTracker(CreativeUnlocksTracker::ItemSacrifices, callgetter:CreativeUnlocksTracker(Main::get_LocalPlayerCreativeTracker)))
46 stloc:int32(var_4_22, ldfld:int32(Item::type, ldloc:Item(item)))
47 stloc:int32(var_5_2C, call:int32(ItemsSacrificedUnlocksTracker::GetSacrificeCount, ldloc:ItemsSacrificedUnlocksTracker(var_3_1B), ldloc:int32(var_4_22)))
48 stfld:int32(int32::m_value, ldloc:int32[exp:int32&](percent), ldc.i4:int32(100))
49}
50
51 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
52 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
53 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
54 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
55 --- End of inner exception stack trace ---
56 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
57 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
58*/;
59 }
60
61 // Token: 0x06000A2F RID: 2607 RVA: 0x00030BC0 File Offset: 0x0002EDC0
63 {
64 if (!true)
65 {
66 }
69 }
70
71 // Token: 0x06000A30 RID: 2608 RVA: 0x00030C0C File Offset: 0x0002EE0C
96
97 // Token: 0x06000A31 RID: 2609 RVA: 0x00030D14 File Offset: 0x0002EF14
118
119 // Token: 0x06000A32 RID: 2610 RVA: 0x00030D90 File Offset: 0x0002EF90
139
140 // Token: 0x06000A33 RID: 2611 RVA: 0x00030DEC File Offset: 0x0002EFEC
141 public void Close()
142 {
143 if (!this.Displaying || this.PickingInterceptor != null)
144 {
145 }
146 }
147
148 // Token: 0x06000A34 RID: 2612 RVA: 0x00030E0C File Offset: 0x0002F00C
149 public void Draw()
150 {
151 if (!true)
152 {
153 }
155 GUIInputRegionExclusive pickingInterceptor = this.PickingInterceptor;
156 if (pickingInterceptor != null)
157 {
158 }
159 if (pickingInterceptor == null)
160 {
161 }
162 if (!true)
163 {
164 }
166 this.DrawResearchBacking();
167 this.DrawResearchCogs();
168 this.DrawItemProgress();
172 this.DrawMainButtons();
174 if (pickingInterceptor2 != null)
175 {
177 }
178 }
179
180 // Token: 0x06000A35 RID: 2613 RVA: 0x00030E94 File Offset: 0x0002F094
182 {
184 {
185 int size = this.ResearchParticles._size;
186 int size2 = this.ResearchParticles._size;
187 }
188 }
189
190 // Token: 0x06000A36 RID: 2614 RVA: 0x00030EC4 File Offset: 0x0002F0C4
191 private void DrawMainButtons()
192 {
193 int num = 1;
194 int openedFrame = this.OpenedFrame;
195 if (num == 0)
196 {
197 }
199 TransactionButton_Layout close = instance.Close;
202 {
204 string textValue = Language.GetTextValue("Mobile.Research");
207 {
208 this.ActionResearch();
209 while (inputState2 != GUITransactionButton.InputState.Clicked)
210 {
211 }
212 goto IL_004B;
213 }
214 }
216 {
217 return;
218 }
219 IL_004B:
220 this.Close();
221 }
222
223 // Token: 0x06000A37 RID: 2615 RVA: 0x000021DB File Offset: 0x000003DB
224 private void BeginResearchAnimation(int itemResearched, int amountStart, int amountSubmitted, bool completed)
225 {
226 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
227 }
228
229 // Token: 0x06000A38 RID: 2616 RVA: 0x00030F24 File Offset: 0x0002F124
230 private void ActionResearch()
231 {
232 int num = 1;
234 bool isAir = researchItem.IsAir;
235 if (num == 0)
236 {
237 }
238 int type = researchItem.type;
239 if (num == 0)
240 {
241 }
243 int type2 = researchItem.type;
245 int stack = researchItem.stack;
246 int type3 = researchItem.type;
247 if (stack == 0)
248 {
249 }
250 if (stack != 0)
251 {
253 if (stack == 0)
254 {
255 }
256 return;
257 }
258 if (stack == 0)
259 {
260 }
262 int type4 = researchItem.type;
264 int stack2 = researchItem.stack;
266 long num2 = 0L;
267 researchItem.TurnToAir(num2 != 0L);
268 if (stack2 == 0)
269 {
270 }
271 Recipe.FindRecipes(false);
272 }
273
274 // Token: 0x06000A39 RID: 2617 RVA: 0x00030FF0 File Offset: 0x0002F1F0
279
280 // Token: 0x06000A3A RID: 2618 RVA: 0x000021DB File Offset: 0x000003DB
282 {
283 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
284 }
285
286 // Token: 0x06000A3B RID: 2619 RVA: 0x00031014 File Offset: 0x0002F214
287 private void DrawResearchBacking()
288 {
292 int num = this.UpdateResearchAnimation();
293 this.DrawResearchItem();
294 if (!true)
295 {
296 }
297 Vector2 vector = rectangle.TopLeft();
298 Vector2 vector2 = rectangle.Size();
300 }
301
302 // Token: 0x06000A3C RID: 2620 RVA: 0x0003106C File Offset: 0x0002F26C
303 public Rectangle SetupFrame(Texture2D texture, int frameCountHorizontal, int frameCountVertical, int frameX, int frameY)
304 {
305 if (!true)
306 {
307 }
308 long num = 0L;
309 long num2 = 0L;
310 return texture.Frame(frameCountHorizontal, frameCountVertical, frameX, frameY, (int)num, (int)num2);
311 }
312
313 // Token: 0x06000A3D RID: 2621 RVA: 0x00031090 File Offset: 0x0002F290
334
335 // Token: 0x06000A3E RID: 2622 RVA: 0x00031124 File Offset: 0x0002F324
336 public void DrawTexture(Panel_Layout layout, Texture2D texture, float rotation)
337 {
339 if (!true)
340 {
341 }
342 Vector2 vector = rectangle.TopLeft();
343 Vector2 vector2 = rectangle.Size();
344 Color backingColor = layout.BackingColor;
345 }
346
347 // Token: 0x06000A3F RID: 2623 RVA: 0x00031150 File Offset: 0x0002F350
348 public void DrawTexture(Vector2 position, Vector2 size, Texture2D texture, Color color, float rotation)
349 {
350 if (!true)
351 {
352 }
353 if (!true)
354 {
355 }
356 if (!true)
357 {
358 }
359 }
360
361 // Token: 0x06000A40 RID: 2624 RVA: 0x00031170 File Offset: 0x0002F370
363 {
364 /*
365An exception occurred when decompiling this method (06000A40)
366
367ICSharpCode.Decompiler.DecompilerException: Error decompiling Terraria.Item GUIResearch::GetResearchItem()
368
369 ---> System.Exception: Basic block has to end with unconditional control flow.
370{
371 IL_0017:
372 stloc:int32(var_3_1E, callgetter:int32(Main::get_myPlayer))
373}
374
375 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
376 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
377 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
378 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
379 --- End of inner exception stack trace ---
380 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
381 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
382*/;
383 }
384
385 // Token: 0x06000A41 RID: 2625 RVA: 0x0003119C File Offset: 0x0002F39C
386 private void DrawItemProgress()
387 {
390 int stack = researchItem.stack;
392 string name = researchItem.Name;
394 String_Layout description = instance.Description;
395 string textValue = Language.GetTextValue("Mobile.ResearchDescription");
396 GUIString.Draw(description, textValue);
399 bool isAir = researchItem.IsAir;
400 int type = researchItem.type;
403 {
404 int researchFrame = this.ResearchFrame;
405 researchItemStart = this.ResearchItemStart;
406 int researchFrame2 = this.ResearchFrame;
407 return;
408 }
410 int type2 = researchItem.type;
412 if (researchItemStart == 0)
413 {
414 }
415 int stack2 = researchItem.stack;
416 }
417
418 // Token: 0x06000A42 RID: 2626 RVA: 0x000312B8 File Offset: 0x0002F4B8
419 private void DrawResearchItem()
420 {
424 int num = 32640;
425 float x = researchItem2.Size.X;
426 float y = researchItem2.Size.Y;
427 int num2 = 32768;
428 if (researchItem2 == null)
429 {
430 }
431 if (num2 == 0)
432 {
433 }
434 if (researchItem2.Size != null)
435 {
436 if (num == 0)
437 {
438 }
439 return;
440 }
441 }
442
443 // Token: 0x06000A43 RID: 2627 RVA: 0x000313B4 File Offset: 0x0002F5B4
444 public GUIResearch()
445 {
446 }
447
448 // Token: 0x04000A0A RID: 2570
449 private int OpenedFrame;
450
451 // Token: 0x04000A0B RID: 2571
452 public bool Displaying;
453
454 // Token: 0x04000A0C RID: 2572
456
457 // Token: 0x04000A0D RID: 2573
459
460 // Token: 0x04000A0E RID: 2574
462
463 // Token: 0x04000A0F RID: 2575
465
466 // Token: 0x04000A10 RID: 2576
468
469 // Token: 0x04000A11 RID: 2577
471
472 // Token: 0x04000A12 RID: 2578
474
475 // Token: 0x04000A13 RID: 2579
477
478 // Token: 0x04000A14 RID: 2580
479 private float closeScale;
480
481 // Token: 0x04000A15 RID: 2581
482 private float researchScale;
483
484 // Token: 0x04000A16 RID: 2582
486
487 // Token: 0x04000A17 RID: 2583
489
490 // Token: 0x04000A18 RID: 2584
491 private int ResearchItem;
492
493 // Token: 0x04000A19 RID: 2585
494 private int ResearchItemStart;
495
496 // Token: 0x04000A1A RID: 2586
497 private int ResearchItemCount;
498
499 // Token: 0x04000A1B RID: 2587
500 private int ResearchFrame;
501
502 // Token: 0x04000A1C RID: 2588
503 private bool ResearchCompleted;
504
505 // Token: 0x04000A1D RID: 2589
507
508 // Token: 0x04000A1E RID: 2590
510
511 // Token: 0x04000A1F RID: 2591
512 private float _smallRotation;
513
514 // Token: 0x04000A20 RID: 2592
515 private float _mediumRotation;
516
517 // Token: 0x04000A21 RID: 2593
518 private float _largeRotation;
519
520 // Token: 0x04000A22 RID: 2594
521 private float testProgress;
522
523 // Token: 0x0200016B RID: 363
524 public enum ResearchState
525 {
526 // Token: 0x04000A24 RID: 2596
527 Invalid,
528 // Token: 0x04000A25 RID: 2597
529 Valid,
530 // Token: 0x04000A26 RID: 2598
532 }
533}
class f__AnonymousType0<< Count > j__TPar
static Rectangle GetControlRegion(ControlAnchor.ControlId controlId)
static void SetGridItemRegion(Rectangle region)
static Rectangle Region(Panel_Layout layout)
Definition GUIPanel.cs:57
void DrawResearchItem()
static void LoadContent()
void DrawItemProgress()
Rectangle GetRegion()
void DrawResearchCogs()
int UpdateResearchAnimation()
GUIResearch.ResearchState CanBeResearched(Item item, [Out] int percent)
float closeScale
int selectedResearchItem
float _largeRotation
Item GetResearchItem()
float _mediumRotation
void BeginResearchAnimation(int itemResearched, int amountStart, int amountSubmitted, bool completed)
static Asset< Texture2D > pistonParticleAsset
float inventoryResearchScale
void DrawInventoryResearchBinding()
static Asset< Texture2D > pistonsAsset
float _smallRotation
Rectangle SetupFrame(Texture2D texture, int frameCountHorizontal, int frameCountVertical, int frameX, int frameY)
void DrawTexture(Panel_Layout layout, Texture2D texture, float rotation)
ParticleRendererSettings ResearchParticleSettings
float researchScale
void DrawTexture(Vector2 position, Vector2 size, Texture2D texture, Color color, float rotation)
void ActionResearch()
GUIInputRegionExclusive PickingInterceptor
bool IsOver(Vector2 cursorPosition)
void Open(int item)
bool ResearchAnimationInProgress
float testProgress
void DrawBacking()
static Asset< Texture2D > cogsMedium
bool ResearchCompleted
List< CreativeSacrificeParticle > ResearchParticles
void DrawResearchParticles()
static Asset< Texture2D > cogsLarge
static Asset< Texture2D > cogsSmall
void DrawResearchBacking()
void DrawMainButtons()
int ResearchItemCount
void DrawInventoryResearchButton()
int ResearchItemStart
DateTime ResearchAnimationTime
static void Draw(String_Layout layout, TextSnippet[] textSnippets, [Out] int snippetSelected, float maxWidth=-1f, int maxLines=100)
Definition GUIString.cs:12
static Rectangle GetRegion(TransactionButton_Layout layout)
GUIPageIconGrouping GetCategoryGrouping(GUIPageIcons.Category category, bool includeOptions=true)
static InterfaceProfile_Layout Active
Color BackingColor
TransactionButton_Layout Close
Panel_Layout ResearchCogLeft1
Panel_Layout ResearchCogRight2
Panel_Layout ResearchItemBacking
Panel_Layout ResearchItem
Panel_Layout Backing
Panel_Layout ResearchCogRight3
Panel_Layout ResearchCogLeft3
Panel_Layout ImageBacking
Panel_Layout Divider2
TransactionButton_Layout InventoryResearch
Panel_Layout ResearchCogRight1
Vector2 InventoryResearchControllerWiringOffset
TransactionButton_Layout ActionResearch
Panel_Layout Divider
String_Layout ItemName
TransactionButton_Layout InventoryResearchController
Panel_Layout BarBacking
static Research_Layout Instance
Panel_Layout ResearchCogLeft2
String_Layout Description
bool IsAir
Definition Item.cs:1820
static string GetTextValue(string key)
Definition Language.cs:54
static CreativeUnlocksTracker LocalPlayerCreativeTracker
Definition Main.cs:5295
static void FlushBatches()
Definition Main.cs:5092
static int myPlayer
Definition Main.cs:2337
static int GameMode
Definition Main.cs:4141
static void FindRecipes(bool canDelayCheck=false)
Definition Recipe.cs:204