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

517 lines
18 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Cpp2IlInjected;
using DG.Tweening;
using MarsSDK;
using UnityEngine;
using UnityEngine.UI;
// Token: 0x02000256 RID: 598
[Token(Token = "0x2000256")]
public class UISkin : GameCanvasBase
{
// Token: 0x060016E1 RID: 5857 RVA: 0x000372BC File Offset: 0x000354BC
[Token(Token = "0x60016E1")]
[Address(RVA = "0xDE79E0", Offset = "0xDE61E0", VA = "0x180DE79E0", Slot = "11")]
public override void Init()
{
GameTextDataAdvance gameTextDataAdvance = Game.GetAchievementText();
this.achievementText = gameTextDataAdvance;
this.InitIcons();
this.InitHandlers();
this.switchPageTip.Init();
}
// Token: 0x060016E2 RID: 5858 RVA: 0x000372F8 File Offset: 0x000354F8
[Token(Token = "0x60016E2")]
[Address(RVA = "0xDE76B0", Offset = "0xDE5EB0", VA = "0x180DE76B0")]
private void InitIcons()
{
Dictionary<GameSkin, UISkinIcon> dictionary = new Dictionary();
this.iconMap = dictionary;
IGamePlatform <Platform>k__BackingField = Game.<Platform>k__BackingField;
int num = 0;
bool useAchievement = Game.useAchievement;
if (num < (useAchievement ? 1 : 0))
{
GameObject gameObject = Resources.Load<GameObject>(string.Format("SkinUI/{0}", num));
int num2 = 0;
if (gameObject == num2)
{
GameSkin gameSkin;
GameObject gameObject2 = Resources.Load<GameObject>(string.Format("SkinUI/{0}", gameSkin));
}
RectTransform rectTransform = this.skinIconRoot;
GameObject gameObject3 = UnityEngine.Object.Instantiate<GameObject>(gameObject, rectTransform).GetComponent<UISkinIcon>().gameObject;
int num3 = 0;
gameObject3.SetActive(num3 != 0);
Dictionary<GameSkin, UISkinIcon> dictionary2 = this.iconMap;
throw new NullReferenceException();
}
}
// Token: 0x060016E3 RID: 5859 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016E3")]
[Address(RVA = "0xDE6E60", Offset = "0xDE5660", VA = "0x180DE6E60")]
private void InitHandlers()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016E4 RID: 5860 RVA: 0x0003739C File Offset: 0x0003559C
[Token(Token = "0x60016E4")]
[Address(RVA = "0xDE6500", Offset = "0xDE4D00", VA = "0x180DE6500", Slot = "12")]
protected override void Appear(Action completeHandler)
{
this.UpdateActiveSkins();
GameSkin[] array = this.activeSkins;
int num = 0;
if (num < array.Length)
{
GameSkin gameSkin = array[num];
GameCollection collection = Game.Collection;
if (gameSkin != collection.currentSkin)
{
GameSkin[] array2 = this.activeSkins;
num++;
}
}
this.selectionIndex = num;
UISkinIcon[] array3 = this.activeIcons;
if (num < array3.Length)
{
UISkinIcon uiskinIcon = array3[num];
uiskinIcon.index = num;
int num2 = 0;
uiskinIcon.UpdatePosition(num2);
UISkinIcon[] array4 = this.activeIcons;
num++;
while (array4 != 0)
{
}
}
this.UpdateUnlockStats();
GameSkin[] array5 = this.activeSkins;
Func<GameSkin, string> func = new Func(this.GetUnlockConditionText);
string[] array6 = Enumerable.ToArray<string>(Enumerable.Select<GameSkin, string>(array5, func));
this.unlockConditionText = array6;
this.UpdateSkinText();
UINavigator navigator = this.navigator;
UILabelHandler uilabelHandler = this.cancel;
navigator.SetDefaultHandler(uilabelHandler);
GameObject gameObject = this.submissionEffect.gameObject;
int num3 = 0;
gameObject.SetActive(num3 != 0);
UISkinIcon[] array7 = this.activeIcons;
UISwitchArrowController uiswitchArrowController = this.arrowController;
int num4 = this.selectionIndex;
int length = array7.Length;
uiswitchArrowController.pageAmount = length;
uiswitchArrowController.UpdateArrowState(num4);
base.Appear(completeHandler);
}
// Token: 0x060016E5 RID: 5861 RVA: 0x000374DC File Offset: 0x000356DC
[Token(Token = "0x60016E5")]
[Address(RVA = "0xDE6E20", Offset = "0xDE5620", VA = "0x180DE6E20", Slot = "13")]
protected override void Hide(Action completeHandler)
{
Sequence sequence = this.sequence;
if (sequence != 0)
{
int num = 0;
sequence.Kill(num != 0);
}
base.Hide(completeHandler);
}
// Token: 0x060016E6 RID: 5862 RVA: 0x00037504 File Offset: 0x00035704
[Token(Token = "0x60016E6")]
[Address(RVA = "0xDE8590", Offset = "0xDE6D90", VA = "0x180DE8590", Slot = "19")]
public override void SwitchLeftward()
{
UISwitchArrowController uiswitchArrowController = this.arrowController;
Func<int> trySwitchLeftward = uiswitchArrowController.trySwitchLeftward;
if (trySwitchLeftward != 0)
{
int num = trySwitchLeftward();
if (num != -1)
{
uiswitchArrowController.switchArrows[0].PerformClickEffect();
uiswitchArrowController.UpdateArrowState(num);
}
}
}
// Token: 0x060016E7 RID: 5863 RVA: 0x0003754C File Offset: 0x0003574C
[Token(Token = "0x60016E7")]
[Address(RVA = "0xDE8930", Offset = "0xDE7130", VA = "0x180DE8930")]
private int TrySwitchLeftward()
{
int num = this.selectionIndex;
if (num != 0)
{
this.selectionIndex = num;
this.SwitchSkinPreviews();
return this.selectionIndex;
}
return -1;
}
// Token: 0x060016E8 RID: 5864 RVA: 0x0003757C File Offset: 0x0003577C
[Token(Token = "0x60016E8")]
[Address(RVA = "0xDE8630", Offset = "0xDE6E30", VA = "0x180DE8630", Slot = "20")]
public override void SwitchRightward()
{
UISwitchArrowController uiswitchArrowController = this.arrowController;
Func<int> trySwitchRightward = uiswitchArrowController.trySwitchRightward;
if (trySwitchRightward != 0)
{
int num = trySwitchRightward();
if (num != -1)
{
uiswitchArrowController.switchArrows[1].PerformClickEffect();
uiswitchArrowController.UpdateArrowState(num);
}
}
}
// Token: 0x060016E9 RID: 5865 RVA: 0x000375C4 File Offset: 0x000357C4
[Token(Token = "0x60016E9")]
[Address(RVA = "0xDE8970", Offset = "0xDE7170", VA = "0x180DE8970")]
private int TrySwitchRightward()
{
int length = this.activeSkins.Length;
int num = this.selectionIndex;
if (num != length)
{
int num2 = num + 1;
this.selectionIndex = num2;
this.SwitchSkinPreviews();
return this.selectionIndex;
}
return -1;
}
// Token: 0x060016EA RID: 5866 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016EA")]
[Address(RVA = "0xDE86D0", Offset = "0xDE6ED0", VA = "0x180DE86D0")]
private void SwitchSkinPreviews()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016EB RID: 5867 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016EB")]
[Address(RVA = "0xDE7A70", Offset = "0xDE6270", VA = "0x180DE7A70")]
private void JoinSelectionArrowEffect(Sequence sequence, float duration)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016EC RID: 5868 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016EC")]
[Address(RVA = "0xDE8120", Offset = "0xDE6920", VA = "0x180DE8120", Slot = "18")]
public override void Move(Direction2D direction)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016ED RID: 5869 RVA: 0x00037608 File Offset: 0x00035808
[Token(Token = "0x60016ED")]
[Address(RVA = "0xDE8150", Offset = "0xDE6950", VA = "0x180DE8150")]
private void OnHandlerSelected(UIHandlerBase handler)
{
UINavigationEffect uinavigationEffect = this.navigationEffect;
Vector2 anchoredPosition = handler.rectTransform.anchoredPosition;
uinavigationEffect.UpdatePos(anchoredPosition);
UINavigationEffect uinavigationEffect2 = this.navigationEffect;
if (handler.index != 0)
{
}
UILabelHandler uilabelHandler = this.cancel;
uinavigationEffect2.UpdateArrowPos(uilabelHandler);
this.navigationEffect.Appear();
Game.PlayHandlerSE(UIHandlerSFX.Navigation);
}
// Token: 0x060016EE RID: 5870 RVA: 0x00037664 File Offset: 0x00035864
[Token(Token = "0x60016EE")]
[Address(RVA = "0x7B5290", Offset = "0x7B3A90", VA = "0x1807B5290")]
private void OnHandlerDeselected(UIHandlerBase handler)
{
this.navigationEffect.Hide();
}
// Token: 0x060016EF RID: 5871 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016EF")]
[Address(RVA = "0xDE8330", Offset = "0xDE6B30", VA = "0x180DE8330", Slot = "21")]
public override void Submit()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016F0 RID: 5872 RVA: 0x00037684 File Offset: 0x00035884
[Token(Token = "0x60016F0")]
[Address(RVA = "0xDE8240", Offset = "0xDE6A40", VA = "0x180DE8240")]
private void PerformSubmissionEffect()
{
RectTransform rectTransform = this.submissionEffect.rectTransform;
Vector2 anchoredPosition = this.navigator.currentHandler.rectTransform.anchoredPosition;
rectTransform.anchoredPosition = anchoredPosition;
this.submissionEffect.gameObject.SetActive(true);
Game.PlayHandlerScaleEffect(this.navigator.currentHandler);
}
// Token: 0x060016F1 RID: 5873 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016F1")]
[Address(RVA = "0xDE7F20", Offset = "0xDE6720", VA = "0x180DE7F20", Slot = "25")]
public override void Localize(LocalizationData data)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016F2 RID: 5874 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016F2")]
[Address(RVA = "0xDE8A30", Offset = "0xDE7230", VA = "0x180DE8A30")]
private void UpdateActiveSkins()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016F3 RID: 5875 RVA: 0x000376E4 File Offset: 0x000358E4
[Token(Token = "0x60016F3")]
[Address(RVA = "0xDE8E60", Offset = "0xDE7660", VA = "0x180DE8E60")]
private void UpdateSelection()
{
GameSkin[] array = this.activeSkins;
int num = 0;
int num2 = 0;
if (num2 < array.Length)
{
GameSkin gameSkin = array[num];
GameCollection collection = Game.Collection;
if (gameSkin != collection.currentSkin)
{
GameSkin[] array2 = this.activeSkins;
num++;
}
this.selectionIndex = num;
return;
}
this.selectionIndex = (int)((ulong)0L);
}
// Token: 0x060016F4 RID: 5876 RVA: 0x00037748 File Offset: 0x00035948
[Token(Token = "0x60016F4")]
[Address(RVA = "0xDE8F50", Offset = "0xDE7750", VA = "0x180DE8F50")]
private void UpdateSkinIndices()
{
UISkinIcon[] array = this.activeIcons;
int num = 0;
if (num < array.Length)
{
UISkinIcon uiskinIcon = array[num];
uiskinIcon.index = num;
int num2 = 0;
uiskinIcon.UpdatePosition(num2);
UISkinIcon[] array2 = this.activeIcons;
num++;
}
}
// Token: 0x060016F5 RID: 5877 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016F5")]
[Address(RVA = "0xDE9220", Offset = "0xDE7A20", VA = "0x180DE9220")]
private void UpdateUnlockStats()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016F6 RID: 5878 RVA: 0x00037794 File Offset: 0x00035994
[Token(Token = "0x60016F6")]
[Address(RVA = "0xDE9150", Offset = "0xDE7950", VA = "0x180DE9150")]
private void UpdateUnlockConditionText()
{
/*
An exception occurred when decompiling this method (060016F6)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void UISkin::UpdateUnlockConditionText()
---> System.Exception: Basic block has to end with unconditional control flow.
{; Block_0:; stloc:valuetype GameSkin[](var_0_06, ldfld:valuetype GameSkin[](UISkin::activeSkins, ldloc:UISkin(this))); stloc:class [mscorlib]System.Func`2<valuetype GameSkin, string>(var_1_13, newobj:Func`2[exp:class [mscorlib]System.Func`2<valuetype GameSkin, string>](Func`2::.ctor, ldloc:UISkin[exp:object](this), ldftn:native int(UISkin::GetUnlockConditionText))); stloc:string[](var_2_20, call:string[](Enumerable::ToArray, call:IEnumerable`1(Enumerable::Select, ldloc:valuetype GameSkin[][exp:IEnumerable`1](var_0_06), ldloc:class [mscorlib]System.Func`2<valuetype GameSkin, string>[exp:Func`2](var_1_13)))); stfld:string[](UISkin::unlockConditionText, ldloc:UISkin(this), ldloc:string[](var_2_20)); };
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: 0x060016F7 RID: 5879 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016F7")]
[Address(RVA = "0xDE8FE0", Offset = "0xDE77E0", VA = "0x180DE8FE0")]
private void UpdateSkinText()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016F8 RID: 5880 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016F8")]
[Address(RVA = "0xDE6B90", Offset = "0xDE5390", VA = "0x180DE6B90")]
private bool HasSkinUnlocked(GameSkin skin)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016F9 RID: 5881 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x60016F9")]
[Address(RVA = "0xDE67B0", Offset = "0xDE4FB0", VA = "0x180DE67B0")]
private string GetUnlockConditionText(GameSkin skin)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060016FA RID: 5882 RVA: 0x000377C8 File Offset: 0x000359C8
[Token(Token = "0x60016FA")]
[Address(RVA = "0x7B6570", Offset = "0x7B4D70", VA = "0x1807B6570")]
public UISkin()
{
}
// Token: 0x04002170 RID: 8560
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4002170")]
[SerializeField]
private Text title;
// Token: 0x04002171 RID: 8561
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4002171")]
[SerializeField]
private Text skinName;
// Token: 0x04002172 RID: 8562
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4002172")]
[SerializeField]
private Text unlockCondition;
// Token: 0x04002173 RID: 8563
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4002173")]
[SerializeField]
private UISwitchPageTip switchPageTip;
// Token: 0x04002174 RID: 8564
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x4002174")]
[SerializeField]
private RectTransform skinIconRoot;
// Token: 0x04002175 RID: 8565
[FieldOffset(Offset = "0x80")]
[Token(Token = "0x4002175")]
[SerializeField]
private int selectionIndex;
// Token: 0x04002176 RID: 8566
[FieldOffset(Offset = "0x88")]
[Token(Token = "0x4002176")]
[SerializeField]
private GameSkin[] activeSkins;
// Token: 0x04002177 RID: 8567
[FieldOffset(Offset = "0x90")]
[Token(Token = "0x4002177")]
[SerializeField]
private UISkinIcon[] activeIcons;
// Token: 0x04002178 RID: 8568
[FieldOffset(Offset = "0x98")]
[Token(Token = "0x4002178")]
[SerializeField]
private CanvasGroup selectionTransparency;
// Token: 0x04002179 RID: 8569
[FieldOffset(Offset = "0xA0")]
[Token(Token = "0x4002179")]
[SerializeField]
private Image[] selectionArrows;
// Token: 0x0400217A RID: 8570
[FieldOffset(Offset = "0xA8")]
[Token(Token = "0x400217A")]
[SerializeField]
private UISwitchArrowController arrowController;
// Token: 0x0400217B RID: 8571
[FieldOffset(Offset = "0xB0")]
[Token(Token = "0x400217B")]
[SerializeField]
private UILabelHandler cancel;
// Token: 0x0400217C RID: 8572
[FieldOffset(Offset = "0xB8")]
[Token(Token = "0x400217C")]
[SerializeField]
private UILabelHandler confirm;
// Token: 0x0400217D RID: 8573
[FieldOffset(Offset = "0xC0")]
[Token(Token = "0x400217D")]
[SerializeField]
private UINavigationEffect navigationEffect;
// Token: 0x0400217E RID: 8574
[FieldOffset(Offset = "0xC8")]
[Token(Token = "0x400217E")]
[SerializeField]
private Image submissionEffect;
// Token: 0x0400217F RID: 8575
[Token(Token = "0x400217F")]
private const int SKIN_NAME_INDEX = 600;
// Token: 0x04002180 RID: 8576
[Token(Token = "0x4002180")]
private const float DURATION = 0.3f;
// Token: 0x04002181 RID: 8577
[Token(Token = "0x4002181")]
private const float OFFSET = 55f;
// Token: 0x04002182 RID: 8578
[FieldOffset(Offset = "0xD0")]
[Token(Token = "0x4002182")]
private Vector2[] selectionArrowPos;
// Token: 0x04002183 RID: 8579
[FieldOffset(Offset = "0xD8")]
[Token(Token = "0x4002183")]
private Sequence sequence;
// Token: 0x04002184 RID: 8580
[FieldOffset(Offset = "0xE0")]
[Token(Token = "0x4002184")]
private bool[] unlockFlags;
// Token: 0x04002185 RID: 8581
[FieldOffset(Offset = "0xE8")]
[Token(Token = "0x4002185")]
private string[] unlockConditionText;
// Token: 0x04002186 RID: 8582
[FieldOffset(Offset = "0xF0")]
[Token(Token = "0x4002186")]
private GameTextDataAdvance achievementText;
// Token: 0x04002187 RID: 8583
[FieldOffset(Offset = "0xF8")]
[Token(Token = "0x4002187")]
private Dictionary<GameSkin, UISkinIcon> iconMap;
}