using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using MarsSDK;
using MEC;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x0200025D RID: 605
[Token(Token = "0x200025D")]
public class UINewGameSetup : GameCanvasBase
{
	// Token: 0x06001754 RID: 5972 RVA: 0x00038C44 File Offset: 0x00036E44
	[Token(Token = "0x6001754")]
	[Address(RVA = "0x1022AA0", Offset = "0x10218A0", VA = "0x181022AA0", 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: 0x06001755 RID: 5973 RVA: 0x00038DF0 File Offset: 0x00036FF0
	[Token(Token = "0x6001755")]
	[Address(RVA = "0x4F8020", Offset = "0x4F6E20", VA = "0x1804F8020")]
	public void BindNewGameHandler(Action<GameDifficulty> newGameHandler)
	{
		/*
An exception occurred when decompiling this method (06001755)

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: 0x06001756 RID: 5974 RVA: 0x00038E04 File Offset: 0x00037004
	[Token(Token = "0x6001756")]
	[Address(RVA = "0x1022940", Offset = "0x1021740", VA = "0x181022940", 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: 0x06001757 RID: 5975 RVA: 0x00038E68 File Offset: 0x00037068
	[Token(Token = "0x6001757")]
	[Address(RVA = "0x764EC0", Offset = "0x763CC0", VA = "0x180764EC0", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x06001758 RID: 5976 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001758")]
	[Address(RVA = "0x10233D0", Offset = "0x10221D0", VA = "0x1810233D0")]
	private void OnDifficultyHandlerSelected(UIHandlerBase handler)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001759 RID: 5977 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001759")]
	[Address(RVA = "0x1023300", Offset = "0x1022100", VA = "0x181023300")]
	private void OnDifficultyHandlerDeselected(UIHandlerBase handler)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600175A RID: 5978 RVA: 0x00038E88 File Offset: 0x00037088
	[Token(Token = "0x600175A")]
	[Address(RVA = "0x1023290", Offset = "0x1022090", VA = "0x181023290")]
	private void OnBackHandlerSelected(UIHandlerBase handler)
	{
		this.backNavigationEffect.Appear();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x0600175B RID: 5979 RVA: 0x00038EAC File Offset: 0x000370AC
	[Token(Token = "0x600175B")]
	[Address(RVA = "0x1016F00", Offset = "0x1015D00", VA = "0x181016F00")]
	private void OnBackHandlerDeselected(UIHandlerBase handler)
	{
		this.backNavigationEffect.Hide();
	}

	// Token: 0x0600175C RID: 5980 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600175C")]
	[Address(RVA = "0x1022880", Offset = "0x1021680", VA = "0x181022880")]
	private void AppearTip()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600175D RID: 5981 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600175D")]
	[Address(RVA = "0x10229F0", Offset = "0x10217F0", VA = "0x1810229F0")]
	private void HideTip()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600175E RID: 5982 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600175E")]
	[Address(RVA = "0x1023570", Offset = "0x1022370", VA = "0x181023570")]
	private IEnumerator<float> ProcessFading(float value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600175F RID: 5983 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600175F")]
	[Address(RVA = "0x10237A0", Offset = "0x10225A0", VA = "0x1810237A0")]
	private void UpdateTipAlpha(float value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001760 RID: 5984 RVA: 0x00038ECC File Offset: 0x000370CC
	[Token(Token = "0x6001760")]
	[Address(RVA = "0x10235F0", Offset = "0x10223F0", VA = "0x1810235F0", 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: 0x06001761 RID: 5985 RVA: 0x00038F74 File Offset: 0x00037174
	[Token(Token = "0x6001761")]
	[Address(RVA = "0x1022F20", Offset = "0x1021D20", VA = "0x181022F20", 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: 0x06001762 RID: 5986 RVA: 0x00039124 File Offset: 0x00037324
	[Token(Token = "0x6001762")]
	[Address(RVA = "0x769BF0", Offset = "0x7689F0", VA = "0x180769BF0")]
	public UINewGameSetup()
	{
	}

	// Token: 0x04002198 RID: 8600
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002198")]
	[SerializeField]
	private Text title;

	// Token: 0x04002199 RID: 8601
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4002199")]
	[SerializeField]
	private Text tip;

	// Token: 0x0400219A RID: 8602
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x400219A")]
	[SerializeField]
	private UILabelHandler[] difficultyHandlers;

	// Token: 0x0400219B RID: 8603
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x400219B")]
	[SerializeField]
	private UILabelHandler backHandler;

	// Token: 0x0400219C RID: 8604
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x400219C")]
	[SerializeField]
	private UINavigationEffect difficultyNavigationEffect;

	// Token: 0x0400219D RID: 8605
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x400219D")]
	[SerializeField]
	private UINavigationEffect backNavigationEffect;

	// Token: 0x0400219E RID: 8606
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x400219E")]
	[SerializeField]
	private Image submissionEffect;

	// Token: 0x0400219F RID: 8607
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x400219F")]
	private CoroutineHandle tipProcessor;

	// Token: 0x040021A0 RID: 8608
	[FieldOffset(Offset = "0x94")]
	[Token(Token = "0x40021A0")]
	private float alpha;

	// Token: 0x040021A1 RID: 8609
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x40021A1")]
	private string[] tipText;

	// Token: 0x040021A2 RID: 8610
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x40021A2")]
	private Action<GameDifficulty> newGameHandler;
}
