using System;
using Cpp2IlInjected;
using MarsSDK;
using Newtonsoft.Json.Converters;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x0200026E RID: 622
[Token(Token = "0x200026E")]
public class UIPlayerDeathMenu : GameCanvasBase
{
	// Token: 0x06001731 RID: 5937 RVA: 0x000348B4 File Offset: 0x00032AB4
	[Token(Token = "0x6001731")]
	[Address(RVA = "0xE81D20", Offset = "0xE80D20", VA = "0x180E81D20", 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++;
		}
		int num2 = 0;
		UINavigationSetter uinavigationSetter = UINavigationSetter.Get(UINavigationMode.Vertical, true, num2);
		UILabelHandler[] array3 = this.handlers;
		uinavigationSetter.Apply(array3);
		UINavigator navigator = this.navigator;
		UILabelHandler[] array4 = this.handlers;
		navigator.BindPointerEnterEvent(array4);
		UINavigator navigator2 = this.navigator;
		UILabelHandler[] array5 = this.handlers;
		navigator2.BindPointerExitEvent(array5);
	}

	// Token: 0x06001732 RID: 5938 RVA: 0x0003498C File Offset: 0x00032B8C
	[Token(Token = "0x6001732")]
	[Address(RVA = "0xE3A350", Offset = "0xE39350", VA = "0x180E3A350")]
	public void UpdateLostMoney(int value)
	{
		this.lostMoneyValue = value;
	}

	// Token: 0x06001733 RID: 5939 RVA: 0x000349A0 File Offset: 0x00032BA0
	[Token(Token = "0x6001733")]
	[Address(RVA = "0xE814D0", Offset = "0xE804D0", VA = "0x180E814D0", Slot = "12")]
	protected override void Appear(Action completeHandler)
	{
		base.Appear(completeHandler);
		Text text = this.lostMoney;
		GameObject gameObject = text.gameObject;
		string text2 = Game.<UISystemText>k__BackingField.GetText(20);
		int num = this.lostMoneyValue;
		string text3 = string.Format("{0} : {1}", text2, text2);
		text.text = text3;
		Text text4 = this.lostMoney;
		this.lostMoneyValue = (int)((ulong)0L);
		text4.gameObject.SetActive(true);
		GameObject gameObject2 = this.submissionEffect.gameObject;
		int num2 = 0;
		gameObject2.SetActive(num2 != 0);
		UILabelHandler[] array = this.handlers;
		UINavigator navigator = this.navigator;
		UILabelHandler uilabelHandler = array[0];
		navigator.SetDefaultHandler(uilabelHandler);
		Game.PlayCanvasSE(UICanvasSFX.Option);
		if (Game.GameSave.basic.difficulty == GameDifficulty.BossRush)
		{
			Game.GameSave.flags.stageBRFail = true;
		}
		if (Game.GameSave.basic.difficulty == GameDifficulty.BossRush && !Game.GameSave.flags.stageBRNobeta)
		{
			((ICanvasElement)this.title).GraphicUpdateComplete();
			return;
		}
		Text text5 = this.title;
		throw new NullReferenceException();
	}

	// Token: 0x06001734 RID: 5940 RVA: 0x00034AB8 File Offset: 0x00032CB8
	[Token(Token = "0x6001734")]
	[Address(RVA = "0x94CB50", Offset = "0x94BB50", VA = "0x18094CB50", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x06001735 RID: 5941 RVA: 0x00034AD8 File Offset: 0x00032CD8
	[Token(Token = "0x6001735")]
	[Address(RVA = "0xE82120", Offset = "0xE81120", VA = "0x180E82120")]
	private void OnHandlerSelected(UIHandlerBase handler)
	{
		UINavigationEffect uinavigationEffect = this.navigationEffect;
		Vector2 anchoredPosition = handler.rectTransform.anchoredPosition;
		uinavigationEffect.root.anchoredPosition = 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: 0x06001736 RID: 5942 RVA: 0x00034B44 File Offset: 0x00032D44
	[Token(Token = "0x6001736")]
	[Address(RVA = "0x94CE70", Offset = "0x94BE70", VA = "0x18094CE70")]
	private void OnHandlerDeselected(UIHandlerBase handler)
	{
		this.navigationEffect.Hide();
	}

	// Token: 0x06001737 RID: 5943 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001737")]
	[Address(RVA = "0xE82380", Offset = "0xE81380", VA = "0x180E82380", Slot = "21")]
	public override void Submit()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001738 RID: 5944 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001738")]
	[Address(RVA = "0xE82220", Offset = "0xE81220", VA = "0x180E82220")]
	private void ReloadStage()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001739 RID: 5945 RVA: 0x00034B64 File Offset: 0x00032D64
	[Token(Token = "0x6001739")]
	[Address(RVA = "0xE81840", Offset = "0xE80840", VA = "0x180E81840")]
	private void AskForSwitchingTitleScene()
	{
		MessageBoxConfig messageBoxConfig;
		MessageBoxHandlerData[] array;
		MessageBoxHandlerData messageBoxHandlerData2;
		for (;;)
		{
			int num = 0;
			this.Hide(num);
			UIMessageBox messageBox2 = Game.GetMessageBox(MessageBoxStyle.Universal);
			UIMessageBox messageBox = messageBox2;
			int num2;
			messageBoxConfig = new MessageBoxConfig(Game.<UISystemText>k__BackingField.GetText(40), num2);
			num2 = 0;
			array = new MessageBoxHandlerData[2];
			string text = Game.<UISystemText>k__BackingField.GetText(13);
			Action action = delegate
			{
				Game.sceneManager.UpdateGameSaveWithUIMenu();
				messageBox.ClearCloseEvent();
				messageBox.Close();
				Game.SwitchTitleScene(true);
			};
			UIHandlerSFX uihandlerSFX;
			MessageBoxHandlerData messageBoxHandlerData = new MessageBoxHandlerData(text, uihandlerSFX, action);
			if (messageBoxHandlerData == 0 || messageBoxHandlerData != 0)
			{
				array[0] = messageBoxHandlerData;
				string text2 = Game.<UISystemText>k__BackingField.GetText(14);
				Action action2 = new Action(messageBox.Close);
				UICanvasSFX uicanvasSFX;
				messageBoxHandlerData2 = new MessageBoxHandlerData(text2, uicanvasSFX, action2);
				if (messageBoxHandlerData2 == 0 || messageBoxHandlerData2 != 0)
				{
					break;
				}
			}
		}
		array[1] = messageBoxHandlerData2;
		MessageBoxConfig messageBoxConfig2 = messageBoxConfig.BindHandlerData(array);
		Action action3 = delegate
		{
			string name = ((IXmlDocumentType)CS$<>8__locals1.<>4__this).Name;
		};
		MessageBoxConfig messageBoxConfig3 = messageBoxConfig2.BindCloseEvent(action3);
		CS$<>8__locals1.messageBox.OpenMsgBox(messageBoxConfig3);
	}

	// Token: 0x0600173A RID: 5946 RVA: 0x00034C6C File Offset: 0x00032E6C
	[Token(Token = "0x600173A")]
	[Address(RVA = "0xE81F30", Offset = "0xE80F30", VA = "0x180E81F30", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		string text = data.systemText.GetText(17);
		this.titleNonota = text;
		string text2 = data.systemText.GetText(18);
		this.titleNobeta = text2;
		UILabelHandler[] array = this.handlers;
		GameTextData systemText = data.systemText;
		UILabelHandler uilabelHandler = array[0];
		string text3 = systemText.GetText(6);
		uilabelHandler.SetLabel(text3);
		UILabelHandler[] array2 = this.handlers;
		GameTextData systemText2 = data.systemText;
		UILabelHandler uilabelHandler2 = array2[1];
		string text4 = systemText2.GetText(4);
		uilabelHandler2.SetLabel(text4);
		GameFontPack fontPack = data.fontPack;
		Text text5 = this.title;
		Font light = fontPack.light;
		text5.font = light;
		GameFontPack fontPack2 = data.fontPack;
		Text text6 = this.lostMoney;
		Font light2 = fontPack2.light;
		text6.font = light2;
		UILabelHandler[] array3 = this.handlers;
		int num = 0;
		int length = array3.Length;
		if (num < length)
		{
			GameFontPack fontPack3 = data.fontPack;
			Text label = array3[num].label;
			Font medium = fontPack3.medium;
			label.font = medium;
			num++;
		}
	}

	// Token: 0x0600173B RID: 5947 RVA: 0x00034D90 File Offset: 0x00032F90
	[Token(Token = "0x600173B")]
	[Address(RVA = "0x94D9C0", Offset = "0x94C9C0", VA = "0x18094D9C0")]
	public UIPlayerDeathMenu()
	{
	}

	// Token: 0x040022BD RID: 8893
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x40022BD")]
	[SerializeField]
	private Text title;

	// Token: 0x040022BE RID: 8894
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x40022BE")]
	[SerializeField]
	private Text lostMoney;

	// Token: 0x040022BF RID: 8895
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x40022BF")]
	[SerializeField]
	private UILabelHandler[] handlers;

	// Token: 0x040022C0 RID: 8896
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x40022C0")]
	[SerializeField]
	private UINavigationEffect navigationEffect;

	// Token: 0x040022C1 RID: 8897
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x40022C1")]
	[SerializeField]
	private RectTransform submissionEffect;

	// Token: 0x040022C2 RID: 8898
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x40022C2")]
	[SerializeField]
	private int lostMoneyValue;

	// Token: 0x040022C3 RID: 8899
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x40022C3")]
	private string titleNobeta;

	// Token: 0x040022C4 RID: 8900
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x40022C4")]
	private string titleNonota;
}
