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

// Token: 0x02000226 RID: 550
[Token(Token = "0x2000226")]
public class UIPlayerDeathMenu : GameCanvasBase
{
	// Token: 0x0600152F RID: 5423 RVA: 0x0002FC64 File Offset: 0x0002DE64
	[Token(Token = "0x600152F")]
	[Address(RVA = "0x1027780", Offset = "0x1026580", VA = "0x181027780", 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: 0x06001530 RID: 5424 RVA: 0x0002FD3C File Offset: 0x0002DF3C
	[Token(Token = "0x6001530")]
	[Address(RVA = "0xCC9D30", Offset = "0xCC8B30", VA = "0x180CC9D30")]
	public void UpdateLostMoney(int value)
	{
		this.lostMoneyValue = value;
	}

	// Token: 0x06001531 RID: 5425 RVA: 0x0002FD50 File Offset: 0x0002DF50
	[Token(Token = "0x6001531")]
	[Address(RVA = "0x1027060", Offset = "0x1025E60", VA = "0x181027060", 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);
	}

	// Token: 0x06001532 RID: 5426 RVA: 0x0002FE04 File Offset: 0x0002E004
	[Token(Token = "0x6001532")]
	[Address(RVA = "0x764EC0", Offset = "0x763CC0", VA = "0x180764EC0", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x06001533 RID: 5427 RVA: 0x0002FE24 File Offset: 0x0002E024
	[Token(Token = "0x6001533")]
	[Address(RVA = "0x1027B70", Offset = "0x1026970", VA = "0x181027B70")]
	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: 0x06001534 RID: 5428 RVA: 0x0002FE90 File Offset: 0x0002E090
	[Token(Token = "0x6001534")]
	[Address(RVA = "0x76AA60", Offset = "0x769860", VA = "0x18076AA60")]
	private void OnHandlerDeselected(UIHandlerBase handler)
	{
		this.navigationEffect.Hide();
	}

	// Token: 0x06001535 RID: 5429 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001535")]
	[Address(RVA = "0x1027DD0", Offset = "0x1026BD0", VA = "0x181027DD0", Slot = "21")]
	public override void Submit()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001536 RID: 5430 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001536")]
	[Address(RVA = "0x1027C70", Offset = "0x1026A70", VA = "0x181027C70")]
	private void ReloadStage()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001537 RID: 5431 RVA: 0x0002FEB0 File Offset: 0x0002E0B0
	[Token(Token = "0x6001537")]
	[Address(RVA = "0x10272A0", Offset = "0x10260A0", VA = "0x1810272A0")]
	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
		{
			((IUIController)CS$<>8__locals1.<>4__this).SwitchLeftward();
		};
		MessageBoxConfig messageBoxConfig3 = messageBoxConfig2.BindCloseEvent(action3);
		CS$<>8__locals1.messageBox.OpenMsgBox(messageBoxConfig3);
	}

	// Token: 0x06001538 RID: 5432 RVA: 0x0002FFB8 File Offset: 0x0002E1B8
	[Token(Token = "0x6001538")]
	[Address(RVA = "0x1027990", Offset = "0x1026790", VA = "0x181027990", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		Text text = this.title;
		string text2 = data.systemText.GetText(18);
		text.text = 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: 0x06001539 RID: 5433 RVA: 0x000300CC File Offset: 0x0002E2CC
	[Token(Token = "0x6001539")]
	[Address(RVA = "0x769BF0", Offset = "0x7689F0", VA = "0x180769BF0")]
	public UIPlayerDeathMenu()
	{
	}

	// Token: 0x0400208E RID: 8334
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x400208E")]
	[SerializeField]
	private Text title;

	// Token: 0x0400208F RID: 8335
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x400208F")]
	[SerializeField]
	private Text lostMoney;

	// Token: 0x04002090 RID: 8336
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002090")]
	[SerializeField]
	private UILabelHandler[] handlers;

	// Token: 0x04002091 RID: 8337
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002091")]
	[SerializeField]
	private UINavigationEffect navigationEffect;

	// Token: 0x04002092 RID: 8338
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002092")]
	[SerializeField]
	private RectTransform submissionEffect;

	// Token: 0x04002093 RID: 8339
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002093")]
	[SerializeField]
	private int lostMoneyValue;
}
