using System;
using Cpp2IlInjected;
using MarsSDK;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x02000281 RID: 641
[Token(Token = "0x2000281")]
public class UISavePointMenu : GameCanvasBase
{
	// Token: 0x060017CF RID: 6095 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017CF")]
	[Address(RVA = "0x563EF0", Offset = "0x562EF0", VA = "0x180563EF0")]
	public void SetSavePointData(SavePoint data)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017D0 RID: 6096 RVA: 0x00036A08 File Offset: 0x00034C08
	[Token(Token = "0x60017D0")]
	[Address(RVA = "0x94C4C0", Offset = "0x94B4C0", VA = "0x18094C4C0", Slot = "11")]
	public override void Init()
	{
		UILabelHandler[] array = this.handlers;
		int num = 0;
		if (num < array.Length)
		{
			array[num].index = num;
			UILabelHandler uilabelHandler = this.handlers[num];
			Action<UIHandlerBase> action = new Action(this.OnHandlerSelected);
			uilabelHandler.onSelectedHandler = action;
			UILabelHandler uilabelHandler2 = this.handlers[num];
			Action<UIHandlerBase> action2 = new Action(this.OnHandlerDeselected);
			uilabelHandler2.onDeselectedHandler = action2;
			UILabelHandler[] array2 = this.handlers;
			num++;
		}
		bool flag = Game.GameSave.basic.difficulty != GameDifficulty.BossRush;
		this.showUpgradeButton = flag;
		GameObject gameObject = this.handlers[0].gameObject;
		bool flag2 = this.showUpgradeButton;
		gameObject.SetActive(flag2);
		bool showTeleportMenu = Game.GameSave.basic.showTeleportMenu;
		this.showTeleportButton = showTeleportMenu;
		GameObject gameObject2 = this.handlers[2].gameObject;
		bool flag3 = this.showTeleportButton;
		gameObject2.SetActive(flag3);
		bool flag4 = this.ShowSkinButton();
		this.showSkinButton = flag4;
		GameObject gameObject3 = this.handlers[3].gameObject;
		bool flag5 = this.showSkinButton;
		gameObject3.SetActive(flag5);
		this.UpdateHandlerNavigation();
		UINavigator navigator = this.navigator;
		UILabelHandler[] array3 = this.handlers;
		navigator.BindPointerEnterEvent(array3);
		UINavigator navigator2 = this.navigator;
		UILabelHandler[] array4 = this.handlers;
		navigator2.BindPointerExitEvent(array4);
	}

	// Token: 0x060017D1 RID: 6097 RVA: 0x00036B80 File Offset: 0x00034D80
	[Token(Token = "0x60017D1")]
	[Address(RVA = "0x94C390", Offset = "0x94B390", VA = "0x18094C390", Slot = "12")]
	protected override void Appear(Action completeHandler)
	{
		if (this.NeedUpdateNavigation())
		{
			this.UpdateHandlerNavigation();
		}
		GameDifficulty difficulty = Game.GameSave.basic.difficulty;
		UINavigator navigator = this.navigator;
		bool flag = difficulty != GameDifficulty.BossRush;
		this.showUpgradeButton = flag;
		UILabelHandler[] array = this.handlers;
		if (difficulty == GameDifficulty.BossRush)
		{
		}
		UILabelHandler uilabelHandler = array[0];
		navigator.SetDefaultHandler(uilabelHandler);
		GameObject gameObject = this.submissionEffect.gameObject;
		int num = 0;
		gameObject.SetActive(num != 0);
		base.Appear(completeHandler);
	}

	// Token: 0x060017D2 RID: 6098 RVA: 0x00036C08 File Offset: 0x00034E08
	[Token(Token = "0x60017D2")]
	[Address(RVA = "0x94CB70", Offset = "0x94BB70", VA = "0x18094CB70")]
	private bool NeedUpdateNavigation()
	{
		GameSaveBasicData basic = Game.GameSave.basic;
		UILabelHandler[] array = this.handlers;
		bool flag = basic.difficulty != GameDifficulty.BossRush;
		this.showUpgradeButton = flag;
		bool activeSelf = array[0].gameObject.activeSelf;
		if (flag != activeSelf)
		{
			GameObject gameObject = this.handlers[0].gameObject;
			bool flag2 = this.showUpgradeButton;
			gameObject.SetActive(flag2);
		}
		GameSaveBasicData basic2 = Game.GameSave.basic;
		UILabelHandler[] array2 = this.handlers;
		bool flag3 = basic2.showTeleportMenu;
		this.showTeleportButton = flag3;
		bool activeSelf2 = array2[2].gameObject.activeSelf;
		if (flag3 != activeSelf2)
		{
			GameObject gameObject2 = this.handlers[2].gameObject;
			bool flag4 = this.showTeleportButton;
			gameObject2.SetActive(flag4);
		}
		bool flag5 = this.ShowSkinButton();
		flag3 = flag5;
		this.showSkinButton = flag5;
		bool activeSelf3 = this.handlers[3].gameObject.activeSelf;
		if (flag3 != activeSelf3)
		{
			GameObject gameObject3 = this.handlers[3].gameObject;
			bool flag6 = this.showSkinButton;
			gameObject3.SetActive(flag6);
		}
		return true;
	}

	// Token: 0x060017D3 RID: 6099 RVA: 0x00036D44 File Offset: 0x00034F44
	[Token(Token = "0x60017D3")]
	[Address(RVA = "0x94CB50", Offset = "0x94BB50", VA = "0x18094CB50", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x060017D4 RID: 6100 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017D4")]
	[Address(RVA = "0x94D1B0", Offset = "0x94C1B0", VA = "0x18094D1B0", Slot = "21")]
	public override void Submit()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017D5 RID: 6101 RVA: 0x00036D64 File Offset: 0x00034F64
	[Token(Token = "0x60017D5")]
	[Address(RVA = "0x94C880", Offset = "0x94B880", VA = "0x18094C880", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		Text text = this.title;
		string text2 = data.systemText.GetText(179);
		text.text = text2;
		UILabelHandler[] array = this.handlers;
		GameTextData systemText = data.systemText;
		UILabelHandler uilabelHandler = array[0];
		string text3 = systemText.GetText(180);
		uilabelHandler.SetLabel(text3);
		UILabelHandler[] array2 = this.handlers;
		GameTextData systemText2 = data.systemText;
		UILabelHandler uilabelHandler2 = array2[1];
		string text4 = systemText2.GetText(181);
		uilabelHandler2.SetLabel(text4);
		UILabelHandler[] array3 = this.handlers;
		GameTextData systemText3 = data.systemText;
		UILabelHandler uilabelHandler3 = array3[2];
		string text5 = systemText3.GetText(178);
		uilabelHandler3.SetLabel(text5);
		UILabelHandler[] array4 = this.handlers;
		GameTextData systemText4 = data.systemText;
		UILabelHandler uilabelHandler4 = array4[3];
		string text6 = systemText4.GetText(182);
		uilabelHandler4.SetLabel(text6);
		UILabelHandler[] array5 = this.handlers;
		GameTextData systemText5 = data.systemText;
		UILabelHandler uilabelHandler5 = array5[4];
		string text7 = systemText5.GetText(183);
		uilabelHandler5.SetLabel(text7);
		GameFontPack fontPack = data.fontPack;
		Text text8 = this.title;
		Font medium = fontPack.medium;
		text8.font = medium;
		UILabelHandler[] array6 = this.handlers;
		int num = 0;
		int length = array6.Length;
		if (num < length)
		{
			GameFontPack fontPack2 = data.fontPack;
			UILabelHandler uilabelHandler6 = array6[num];
			Font medium2 = fontPack2.medium;
			uilabelHandler6.SetFont(medium2);
			num++;
		}
	}

	// Token: 0x060017D6 RID: 6102 RVA: 0x00036EF0 File Offset: 0x000350F0
	[Token(Token = "0x60017D6")]
	[Address(RVA = "0x94CE90", Offset = "0x94BE90", VA = "0x18094CE90")]
	private void OnHandlerSelected(UIHandlerBase handler)
	{
		UINavigationEffect uinavigationEffect = this.navigationEffect;
		Vector2 anchoredPosition = handler.rectTransform.anchoredPosition;
		uinavigationEffect.UpdatePos(anchoredPosition);
		UILabelHandler[] array = this.handlers;
		UINavigationEffect uinavigationEffect2 = this.navigationEffect;
		int index = handler.index;
		UILabelHandler uilabelHandler = array[index];
		uinavigationEffect2.UpdateArrowPos(uilabelHandler);
		this.navigationEffect.Appear();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060017D7 RID: 6103 RVA: 0x00036F58 File Offset: 0x00035158
	[Token(Token = "0x60017D7")]
	[Address(RVA = "0x94CE70", Offset = "0x94BE70", VA = "0x18094CE70")]
	private void OnHandlerDeselected(UIHandlerBase handler)
	{
		this.navigationEffect.Hide();
	}

	// Token: 0x060017D8 RID: 6104 RVA: 0x00036F78 File Offset: 0x00035178
	[Token(Token = "0x60017D8")]
	[Address(RVA = "0x94CF90", Offset = "0x94BF90", VA = "0x18094CF90")]
	private void PerformSubmitEffect()
	{
		RectTransform rectTransform = this.submissionEffect.rectTransform;
		Vector2 anchoredPosition = this.navigator.currentHandler.rectTransform.anchoredPosition;
		rectTransform.anchoredPosition = anchoredPosition;
		this.submissionEffect.gameObject.SetActive(true);
	}

	// Token: 0x060017D9 RID: 6105 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017D9")]
	[Address(RVA = "0x94D7C0", Offset = "0x94C7C0", VA = "0x18094D7C0")]
	private void UpdateHandlerNavigation()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017DA RID: 6106 RVA: 0x00036FC8 File Offset: 0x000351C8
	[Token(Token = "0x60017DA")]
	[Address(RVA = "0x94D140", Offset = "0x94C140", VA = "0x18094D140")]
	private bool ShowUpgradeButton()
	{
		return Game.GameSave.basic.difficulty != GameDifficulty.BossRush;
	}

	// Token: 0x060017DB RID: 6107 RVA: 0x00036FF4 File Offset: 0x000351F4
	[Token(Token = "0x60017DB")]
	[Address(RVA = "0x94D0D0", Offset = "0x94C0D0", VA = "0x18094D0D0")]
	private bool ShowTeleportButton()
	{
		return Game.GameSave.basic.showTeleportMenu;
	}

	// Token: 0x060017DC RID: 6108 RVA: 0x00037018 File Offset: 0x00035218
	[Token(Token = "0x60017DC")]
	[Address(RVA = "0x94D020", Offset = "0x94C020", VA = "0x18094D020")]
	private bool ShowSkinButton()
	{
		return Game.GameSave.basic.difficulty != GameDifficulty.BossRush || Game.GameSave.flags.stageBRNobeta;
	}

	// Token: 0x060017DD RID: 6109 RVA: 0x00037054 File Offset: 0x00035254
	[Token(Token = "0x60017DD")]
	[Address(RVA = "0x94D9C0", Offset = "0x94C9C0", VA = "0x18094D9C0")]
	public UISavePointMenu()
	{
	}

	// Token: 0x0400231D RID: 8989
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x400231D")]
	[SerializeField]
	private Text title;

	// Token: 0x0400231E RID: 8990
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x400231E")]
	[SerializeField]
	private GridLayoutGroup layoutGroup;

	// Token: 0x0400231F RID: 8991
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x400231F")]
	[SerializeField]
	private UILabelHandler[] handlers;

	// Token: 0x04002320 RID: 8992
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002320")]
	[SerializeField]
	private UINavigationEffect navigationEffect;

	// Token: 0x04002321 RID: 8993
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002321")]
	[SerializeField]
	private Image submissionEffect;

	// Token: 0x04002322 RID: 8994
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002322")]
	private SavePoint currentSavePointData;

	// Token: 0x04002323 RID: 8995
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002323")]
	private bool showUpgradeButton;

	// Token: 0x04002324 RID: 8996
	[FieldOffset(Offset = "0x89")]
	[Token(Token = "0x4002324")]
	private bool showTeleportButton;

	// Token: 0x04002325 RID: 8997
	[FieldOffset(Offset = "0x8A")]
	[Token(Token = "0x4002325")]
	private bool showSkinButton;
}
