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

// Token: 0x02000232 RID: 562
[Token(Token = "0x2000232")]
public class UIPauseMenu : GameCanvasBase
{
	// Token: 0x06001590 RID: 5520 RVA: 0x00031318 File Offset: 0x0002F518
	[Token(Token = "0x6001590")]
	[Address(RVA = "0x1025680", Offset = "0x1024480", VA = "0x181025680", 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: 0x06001591 RID: 5521 RVA: 0x000313F0 File Offset: 0x0002F5F0
	[Token(Token = "0x6001591")]
	[Address(RVA = "0x1025420", Offset = "0x1024220", VA = "0x181025420", Slot = "12")]
	protected override void Appear(Action completeHandler)
	{
		Action action = delegate
		{
			Game.SwitchUIControlInput();
			Game.PauseVibration();
			Action completeHandler2 = completeHandler;
			if (completeHandler2 != 0)
			{
				completeHandler2();
				return;
			}
		};
		this.AppearRootCanvas(action);
	}

	// Token: 0x06001592 RID: 5522 RVA: 0x00031424 File Offset: 0x0002F624
	[Token(Token = "0x6001592")]
	[Address(RVA = "0x10255B0", Offset = "0x10243B0", VA = "0x1810255B0", Slot = "13")]
	protected override void Hide(Action completeHandler)
	{
		Action action = delegate
		{
			Game.SwitchGameplayInput();
			Game.ResumeVibration();
			Action completeHandler2 = completeHandler;
			if (completeHandler2 != 0)
			{
				completeHandler2();
			}
			this.OnMainPauseMenuAppeared();
		};
		this.HideRootCanvas(action);
	}

	// Token: 0x06001593 RID: 5523 RVA: 0x00031460 File Offset: 0x0002F660
	[Token(Token = "0x6001593")]
	[Address(RVA = "0x764EC0", Offset = "0x763CC0", VA = "0x180764EC0", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x06001594 RID: 5524 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001594")]
	[Address(RVA = "0x1026540", Offset = "0x1025340", VA = "0x181026540", Slot = "21")]
	public override void Submit()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001595 RID: 5525 RVA: 0x00031480 File Offset: 0x0002F680
	[Token(Token = "0x6001595")]
	[Address(RVA = "0x1025890", Offset = "0x1024690", VA = "0x181025890", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		Text text = this.title;
		string text2 = data.systemText.GetText(1);
		text.text = text2;
		UILabelHandler[] array = this.handlers;
		GameTextData systemText = data.systemText;
		UILabelHandler uilabelHandler = array[0];
		string text3 = systemText.GetText(2);
		uilabelHandler.SetLabel(text3);
		UILabelHandler[] array2 = this.handlers;
		GameTextData systemText2 = data.systemText;
		UILabelHandler uilabelHandler2 = array2[1];
		string text4 = systemText2.GetText(5);
		uilabelHandler2.SetLabel(text4);
		UILabelHandler[] array3 = this.handlers;
		GameTextData systemText3 = data.systemText;
		UILabelHandler uilabelHandler3 = array3[2];
		string text5 = systemText3.GetText(11);
		uilabelHandler3.SetLabel(text5);
		UILabelHandler[] array4 = this.handlers;
		GameTextData systemText4 = data.systemText;
		UILabelHandler uilabelHandler4 = array4[3];
		string text6 = systemText4.GetText(3);
		uilabelHandler4.SetLabel(text6);
		UILabelHandler[] array5 = this.handlers;
		GameTextData systemText5 = data.systemText;
		UILabelHandler uilabelHandler5 = array5[4];
		string text7 = systemText5.GetText(340);
		uilabelHandler5.SetLabel(text7);
		UILabelHandler[] array6 = this.handlers;
		GameTextData systemText6 = data.systemText;
		UILabelHandler uilabelHandler6 = array6[5];
		string text8 = systemText6.GetText(6);
		uilabelHandler6.SetLabel(text8);
		UILabelHandler[] array7 = this.handlers;
		GameTextData systemText7 = data.systemText;
		UILabelHandler uilabelHandler7 = array7[6];
		string text9 = systemText7.GetText(4);
		uilabelHandler7.SetLabel(text9);
		GameFontPack fontPack = data.fontPack;
		Text text10 = this.title;
		Font light = fontPack.light;
		text10.font = light;
		UILabelHandler[] array8 = this.handlers;
		int num = 0;
		int length = array8.Length;
		if (num < length)
		{
			GameFontPack fontPack2 = data.fontPack;
			Text label = array8[num].label;
			Font medium = fontPack2.medium;
			label.font = medium;
			num++;
		}
	}

	// Token: 0x06001596 RID: 5526 RVA: 0x00031658 File Offset: 0x0002F858
	[Token(Token = "0x6001596")]
	[Address(RVA = "0x1025D30", Offset = "0x1024B30", VA = "0x181025D30")]
	private void OnMainPauseMenuAppeared()
	{
		Game.MoveBackgroundDown();
		Game.SetHideMoneyFlag(false);
	}

	// Token: 0x06001597 RID: 5527 RVA: 0x00031674 File Offset: 0x0002F874
	[Token(Token = "0x6001597")]
	[Address(RVA = "0x1025D90", Offset = "0x1024B90", VA = "0x181025D90")]
	private void OnSubPauseMenuAppeared()
	{
		Game.MoveBackgroundUp();
		Game.SetHideMoneyFlag(true);
	}

	// Token: 0x06001598 RID: 5528 RVA: 0x00031690 File Offset: 0x0002F890
	[Token(Token = "0x6001598")]
	[Address(RVA = "0x1025360", Offset = "0x1024160", VA = "0x181025360")]
	private void AppearRootCanvas(Action completeHandler)
	{
		this.currentNavigatorIndex = (int)((ulong)0L);
		Game.MoveBackgroundDown();
		Game.SetHideMoneyFlag(false);
		UILabelHandler[] array = this.handlers;
		UINavigator navigator = this.navigator;
		UILabelHandler uilabelHandler = array[0];
		navigator.SetDefaultHandler(uilabelHandler);
		this.UpdateInteractionIconStatus();
		base.Appear(completeHandler);
	}

	// Token: 0x06001599 RID: 5529 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001599")]
	[Address(RVA = "0x10254E0", Offset = "0x10242E0", VA = "0x1810254E0")]
	private void HideRootCanvas([Optional] Action completeHandler)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600159A RID: 5530 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600159A")]
	[Address(RVA = "0xEBBAF0", Offset = "0xEBA8F0", VA = "0x180EBBAF0")]
	private void OpenCanvas<T>(Action closeHandler) where T : GameCanvasBase
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600159B RID: 5531 RVA: 0x000316E4 File Offset: 0x0002F8E4
	[Token(Token = "0x600159B")]
	[Address(RVA = "0x1025DF0", Offset = "0x1024BF0", VA = "0x181025DF0")]
	private void OpenMsgBox(string titleText, Action confirmHandler, int defaultHandlerIndex = 0)
	{
		MessageBoxConfig messageBoxConfig;
		MessageBoxHandlerData[] array;
		MessageBoxHandlerData messageBoxHandlerData2;
		for (;;)
		{
			UIMessageBox messageBox2 = Game.GetMessageBox(MessageBoxStyle.Universal);
			UIMessageBox messageBox = messageBox2;
			messageBoxConfig = new MessageBoxConfig(titleText, defaultHandlerIndex);
			array = new MessageBoxHandlerData[2];
			string text = Game.<UISystemText>k__BackingField.GetText(13);
			Action action = delegate
			{
				messageBox.ClearCloseEvent();
				messageBox.Close();
				Action confirmHandler2 = confirmHandler;
				if (confirmHandler2 != 0)
				{
					confirmHandler2();
					return;
				}
			};
			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
		{
			UIPauseMenu <>4__this = CS$<>8__locals1.<>4__this;
			int num = 0;
			<>4__this.AppearRootCanvas(num);
		};
		MessageBoxConfig messageBoxConfig3 = messageBoxConfig2.BindCloseEvent(action3);
		CS$<>8__locals1.messageBox.OpenMsgBox(messageBoxConfig3);
	}

	// Token: 0x0600159C RID: 5532 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600159C")]
	[Address(RVA = "0x1026340", Offset = "0x1025140", VA = "0x181026340")]
	private void ReloadStage()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600159D RID: 5533 RVA: 0x000317D8 File Offset: 0x0002F9D8
	[Token(Token = "0x600159D")]
	[Address(RVA = "0x1025C20", Offset = "0x1024A20", VA = "0x181025C20")]
	private void OnHandlerSelected(UIHandlerBase handler)
	{
		RectTransform root = this.navigationEffect.root;
		RectTransform rectTransform = handler.rectTransform;
		root.parentInternal = rectTransform;
		UINavigationEffect uinavigationEffect = this.navigationEffect;
		Vector2 zero = Vector2.zero;
		uinavigationEffect.root.anchoredPosition = zero;
		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: 0x0600159E RID: 5534 RVA: 0x00031860 File Offset: 0x0002FA60
	[Token(Token = "0x600159E")]
	[Address(RVA = "0x101A380", Offset = "0x1019180", VA = "0x18101A380")]
	private void OnHandlerDeselected(UIHandlerBase handler)
	{
		this.navigationEffect.Hide();
	}

	// Token: 0x0600159F RID: 5535 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600159F")]
	[Address(RVA = "0x1026D30", Offset = "0x1025B30", VA = "0x181026D30")]
	private void UpdateInteractionIconStatus()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015A0 RID: 5536 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015A0")]
	[Address(RVA = "0x10264A0", Offset = "0x10252A0", VA = "0x1810264A0")]
	private void ResetInteractionIconStatus()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015A1 RID: 5537 RVA: 0x00031880 File Offset: 0x0002FA80
	[Token(Token = "0x60015A1")]
	[Address(RVA = "0x1026250", Offset = "0x1025050", VA = "0x181026250")]
	private void PerformSubmitEffect()
	{
		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: 0x060015A2 RID: 5538 RVA: 0x000318E0 File Offset: 0x0002FAE0
	[Token(Token = "0x60015A2")]
	[Address(RVA = "0x769BF0", Offset = "0x7689F0", VA = "0x180769BF0")]
	public UIPauseMenu()
	{
	}

	// Token: 0x040020C3 RID: 8387
	[Cpp2IlInjected.FieldOffset(Offset = "0x58")]
	[Token(Token = "0x40020C3")]
	[SerializeField]
	private Text title;

	// Token: 0x040020C4 RID: 8388
	[Cpp2IlInjected.FieldOffset(Offset = "0x60")]
	[Token(Token = "0x40020C4")]
	[SerializeField]
	private UILabelHandler[] handlers;

	// Token: 0x040020C5 RID: 8389
	[Cpp2IlInjected.FieldOffset(Offset = "0x68")]
	[Token(Token = "0x40020C5")]
	[SerializeField]
	private UINavigationEffect navigationEffect;

	// Token: 0x040020C6 RID: 8390
	[Cpp2IlInjected.FieldOffset(Offset = "0x70")]
	[Token(Token = "0x40020C6")]
	[SerializeField]
	private Image submissionEffect;

	// Token: 0x040020C7 RID: 8391
	[Cpp2IlInjected.FieldOffset(Offset = "0x78")]
	[Token(Token = "0x40020C7")]
	[SerializeField]
	private Image[] hintEffects;

	// Token: 0x040020C8 RID: 8392
	[Cpp2IlInjected.FieldOffset(Offset = "0x80")]
	[Token(Token = "0x40020C8")]
	private int currentNavigatorIndex;
}
