Files
NobetaSource/Cpp2IL/Assembly-CSharp/UINewGameSetup.cs
2023-09-06 22:09:22 +02:00

348 lines
13 KiB
C#

using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using MarsSDK;
using MEC;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000265 RID: 613
[Token(Token = "0x2000265")]
public class UINewGameSetup : GameCanvasBase
{
// Token: 0x06001772 RID: 6002 RVA: 0x000393C8 File Offset: 0x000375C8
[Token(Token = "0x6001772")]
[Address(RVA = "0x10E9B90", Offset = "0x10E8390", VA = "0x1810E9B90", Slot = "11")]
public override void Init()
{
UINavigator navigator3;
UIHandlerBase[] array5;
UILabelHandler uilabelHandler6;
for (;;)
{
UILabelHandler[] array = this.difficultyHandlers;
int num = 0;
UILabelHandler[] array2;
if (num < array.Length)
{
array[num].index = num;
UILabelHandler uilabelHandler = this.difficultyHandlers[num];
Action<UIHandlerBase> action = new Action(this.OnDifficultyHandlerSelected);
uilabelHandler.onSelectedHandler = action;
UILabelHandler uilabelHandler2 = this.difficultyHandlers[num];
Action<UIHandlerBase> action2 = new Action(this.OnDifficultyHandlerDeselected);
uilabelHandler2.onDeselectedHandler = action2;
array2 = this.difficultyHandlers;
num++;
}
this.navigator.BindPointerEnterEvent(array2);
UINavigator navigator = this.navigator;
UILabelHandler[] array3 = this.difficultyHandlers;
navigator.BindPointerExitEvent(array3);
this.backHandler.index = (int)((ulong)4294967295L);
UILabelHandler uilabelHandler3 = this.backHandler;
Action<UIHandlerBase> action3 = new Action(this.OnBackHandlerSelected);
uilabelHandler3.onSelectedHandler = action3;
UILabelHandler uilabelHandler4 = this.backHandler;
Action<UIHandlerBase> action4 = new Action(this.OnBackHandlerDeselected);
uilabelHandler4.onDeselectedHandler = action4;
UINavigator navigator2 = this.navigator;
UIHandlerBase[] array4 = new UIHandlerBase[1];
UILabelHandler uilabelHandler5 = this.backHandler;
if (uilabelHandler5 == 0 || array4 != 0)
{
array4[0] = uilabelHandler5;
navigator2.BindPointerEnterEvent(array4);
navigator3 = this.navigator;
array5 = new UIHandlerBase[1];
uilabelHandler6 = this.backHandler;
if (uilabelHandler6 == 0 || array5 != 0)
{
break;
}
}
}
array5[0] = uilabelHandler6;
navigator3.BindPointerExitEvent(array5);
List<UIHandlerBase> list = new List(this.difficultyHandlers);
UILabelHandler uilabelHandler7 = this.backHandler;
list.Add(uilabelHandler7);
int num2 = 0;
UINavigationSetter uinavigationSetter = UINavigationSetter.Get(UINavigationMode.Vertical, true, num2);
UIHandlerBase[] array6 = list.ToArray();
uinavigationSetter.Apply(array6);
}
// Token: 0x06001773 RID: 6003 RVA: 0x00039574 File Offset: 0x00037774
[Token(Token = "0x6001773")]
[Address(RVA = "0x527810", Offset = "0x526010", VA = "0x180527810")]
public void BindNewGameHandler(Action<GameDifficulty> newGameHandler)
{
/*
An exception occurred when decompiling this method (06001773)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void UINewGameSetup::BindNewGameHandler(System.Action`1<GameDifficulty>)
---> System.Exception: Basic block has to end with unconditional control flow.
{; Block_0:; stfld:class [mscorlib]System.Action`1<valuetype GameDifficulty>(UINewGameSetup::newGameHandler, ldloc:UINewGameSetup(this), ldloc:class [mscorlib]System.Action`1<valuetype GameDifficulty>(newGameHandler)); };
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
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 344
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
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
--- End of inner exception stack trace ---
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
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 1618
*/;
}
// Token: 0x06001774 RID: 6004 RVA: 0x00039588 File Offset: 0x00037788
[Token(Token = "0x6001774")]
[Address(RVA = "0x10E9A30", Offset = "0x10E8230", VA = "0x1810E9A30", Slot = "12")]
protected override void Appear(Action completeHandler)
{
this.difficultyNavigationEffect.HideImmediate();
this.backNavigationEffect.HideImmediate();
GameObject gameObject = this.submissionEffect.gameObject;
int num = 0;
gameObject.SetActive(num != 0);
UILabelHandler[] array = this.difficultyHandlers;
UINavigator navigator = this.navigator;
UILabelHandler uilabelHandler = array[0];
navigator.SetDefaultHandler(uilabelHandler);
base.Appear(completeHandler);
}
// Token: 0x06001775 RID: 6005 RVA: 0x000395EC File Offset: 0x000377EC
[Token(Token = "0x6001775")]
[Address(RVA = "0x7B1840", Offset = "0x7B0040", VA = "0x1807B1840", Slot = "18")]
public override void Move(Direction2D direction)
{
this.navigator.Move(direction);
}
// Token: 0x06001776 RID: 6006 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001776")]
[Address(RVA = "0x10EA4C0", Offset = "0x10E8CC0", VA = "0x1810EA4C0")]
private void OnDifficultyHandlerSelected(UIHandlerBase handler)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001777 RID: 6007 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001777")]
[Address(RVA = "0x10EA3F0", Offset = "0x10E8BF0", VA = "0x1810EA3F0")]
private void OnDifficultyHandlerDeselected(UIHandlerBase handler)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001778 RID: 6008 RVA: 0x0003960C File Offset: 0x0003780C
[Token(Token = "0x6001778")]
[Address(RVA = "0x10EA380", Offset = "0x10E8B80", VA = "0x1810EA380")]
private void OnBackHandlerSelected(UIHandlerBase handler)
{
this.backNavigationEffect.Appear();
Game.PlayHandlerSE(UIHandlerSFX.Navigation);
}
// Token: 0x06001779 RID: 6009 RVA: 0x00039630 File Offset: 0x00037830
[Token(Token = "0x6001779")]
[Address(RVA = "0xDE5720", Offset = "0xDE3F20", VA = "0x180DE5720")]
private void OnBackHandlerDeselected(UIHandlerBase handler)
{
this.backNavigationEffect.Hide();
}
// Token: 0x0600177A RID: 6010 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600177A")]
[Address(RVA = "0x10E9970", Offset = "0x10E8170", VA = "0x1810E9970")]
private void AppearTip()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600177B RID: 6011 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600177B")]
[Address(RVA = "0x10E9AE0", Offset = "0x10E82E0", VA = "0x1810E9AE0")]
private void HideTip()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600177C RID: 6012 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600177C")]
[Address(RVA = "0x10EA660", Offset = "0x10E8E60", VA = "0x1810EA660")]
private IEnumerator<float> ProcessFading(float value)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600177D RID: 6013 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600177D")]
[Address(RVA = "0x10EA890", Offset = "0x10E9090", VA = "0x1810EA890")]
private void UpdateTipAlpha(float value)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600177E RID: 6014 RVA: 0x00039650 File Offset: 0x00037850
[Token(Token = "0x600177E")]
[Address(RVA = "0x10EA6E0", Offset = "0x10E8EE0", VA = "0x1810EA6E0", Slot = "21")]
public override void Submit()
{
if (this.navigator.currentHandler)
{
int index = this.navigator.currentHandler.index;
base.Close();
int num = 0;
Game.PlayCanvasSE(UICanvasSFX.Close);
Action<GameDifficulty> action = this.newGameHandler;
if (action != 0)
{
action(num);
}
Game.PlayHandlerSE(UIHandlerSFX.GamePlay);
int num2 = 0;
this.ForceClose(num2);
RectTransform rectTransform = this.submissionEffect.rectTransform;
Vector2 anchoredPosition = this.navigator.currentHandler.rectTransform.anchoredPosition;
rectTransform.anchoredPosition = anchoredPosition;
this.submissionEffect.gameObject.SetActive(true);
}
}
// Token: 0x0600177F RID: 6015 RVA: 0x000396F8 File Offset: 0x000378F8
[Token(Token = "0x600177F")]
[Address(RVA = "0x10EA010", Offset = "0x10E8810", VA = "0x1810EA010", Slot = "25")]
public override void Localize(LocalizationData data)
{
string[] array;
string text4;
for (;;)
{
Text text = this.title;
string text2 = data.systemText.GetText(7);
text.text = text2;
array = new string[2];
string text3 = data.systemText.GetText(8);
if (text3 == 0 || text3 != 0)
{
array[0] = text3;
text4 = data.systemText.GetText(9);
if (text4 == 0 || text4 != 0)
{
break;
}
}
}
array[1] = text4;
this.tipText = array;
UILabelHandler[] array2 = this.difficultyHandlers;
GameTextData systemText = data.systemText;
UILabelHandler uilabelHandler = array2[0];
string text5 = systemText.GetText(27);
uilabelHandler.SetLabel(text5);
UILabelHandler[] array3 = this.difficultyHandlers;
GameTextData systemText2 = data.systemText;
UILabelHandler uilabelHandler2 = array3[1];
string text6 = systemText2.GetText(28);
uilabelHandler2.SetLabel(text6);
GameTextData systemText3 = data.systemText;
UILabelHandler uilabelHandler3 = this.backHandler;
string text7 = systemText3.GetText(12);
uilabelHandler3.SetLabel(text7);
GameFontPack fontPack = data.fontPack;
Text text8 = this.title;
Font medium = fontPack.medium;
text8.font = medium;
GameFontPack fontPack2 = data.fontPack;
Text text9 = this.tip;
Font regular = fontPack2.regular;
text9.font = regular;
UILabelHandler[] array4 = this.difficultyHandlers;
int num = 0;
int length = array4.Length;
if (num < length)
{
GameFontPack fontPack3 = data.fontPack;
Text label = array4[num].label;
Font medium2 = fontPack3.medium;
label.font = medium2;
num++;
}
GameFontPack fontPack4 = data.fontPack;
Text label2 = this.backHandler.label;
Font medium3 = fontPack4.medium;
label2.font = medium3;
}
// Token: 0x06001780 RID: 6016 RVA: 0x000398A8 File Offset: 0x00037AA8
[Token(Token = "0x6001780")]
[Address(RVA = "0x7B6570", Offset = "0x7B4D70", VA = "0x1807B6570")]
public UINewGameSetup()
{
}
// Token: 0x040021CE RID: 8654
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x40021CE")]
[SerializeField]
private Text title;
// Token: 0x040021CF RID: 8655
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x40021CF")]
[SerializeField]
private Text tip;
// Token: 0x040021D0 RID: 8656
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x40021D0")]
[SerializeField]
private UILabelHandler[] difficultyHandlers;
// Token: 0x040021D1 RID: 8657
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x40021D1")]
[SerializeField]
private UILabelHandler backHandler;
// Token: 0x040021D2 RID: 8658
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x40021D2")]
[SerializeField]
private UINavigationEffect difficultyNavigationEffect;
// Token: 0x040021D3 RID: 8659
[FieldOffset(Offset = "0x80")]
[Token(Token = "0x40021D3")]
[SerializeField]
private UINavigationEffect backNavigationEffect;
// Token: 0x040021D4 RID: 8660
[FieldOffset(Offset = "0x88")]
[Token(Token = "0x40021D4")]
[SerializeField]
private Image submissionEffect;
// Token: 0x040021D5 RID: 8661
[FieldOffset(Offset = "0x90")]
[Token(Token = "0x40021D5")]
private CoroutineHandle tipProcessor;
// Token: 0x040021D6 RID: 8662
[FieldOffset(Offset = "0x94")]
[Token(Token = "0x40021D6")]
private float alpha;
// Token: 0x040021D7 RID: 8663
[FieldOffset(Offset = "0x98")]
[Token(Token = "0x40021D7")]
private string[] tipText;
// Token: 0x040021D8 RID: 8664
[FieldOffset(Offset = "0xA0")]
[Token(Token = "0x40021D8")]
private Action<GameDifficulty> newGameHandler;
}