using System;
using System.Xml;
using Cpp2IlInjected;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using MarsSDK;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x02000262 RID: 610
[Token(Token = "0x2000262")]
public class UIUpgrade : GameCanvasBase
{
	// Token: 0x0600178F RID: 6031 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600178F")]
	[Address(RVA = "0x18B7850", Offset = "0x18B6650", VA = "0x1818B7850", Slot = "11")]
	public override void Init()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001790 RID: 6032 RVA: 0x00039BF4 File Offset: 0x00037DF4
	[Token(Token = "0x6001790")]
	[Address(RVA = "0x18B6C90", Offset = "0x18B5A90", VA = "0x1818B6C90", Slot = "12")]
	protected override void Appear(Action completeHandler)
	{
		UIUpgradeHandler[] array = this.handlers;
		int num = 0;
		int num2 = 0;
		int length = array.Length;
		if (num2 < length)
		{
			array[num].InitDisplayInfo();
			num++;
		}
		this.returnNavigation.HideImmediate();
		this.upgradeNavigation.HideImmediate();
		UIUpgradeHandler[] array2 = this.handlers;
		UINavigator navigator = this.navigator;
		this.curNavIdx = (int)((ulong)0L);
		UIUpgradeHandler uiupgradeHandler = array2[0];
		navigator.SetDefaultHandler(uiupgradeHandler);
		GameObject gameObject = this.buttonSelectionIcon.gameObject;
		int num3 = 0;
		gameObject.SetActive(num3 != 0);
		base.Appear(completeHandler);
	}

	// Token: 0x06001791 RID: 6033 RVA: 0x00039C90 File Offset: 0x00037E90
	[Token(Token = "0x6001791")]
	[Address(RVA = "0x18B6DC0", Offset = "0x18B5BC0", VA = "0x1818B6DC0", Slot = "13")]
	protected override void Hide(Action completeHandler)
	{
		UIUpgradeHandler[] array = this.handlers;
		int num = this.curUpgradeTypeID;
		array[num].CancelUpgrade();
		base.Hide(completeHandler);
	}

	// Token: 0x06001792 RID: 6034 RVA: 0x00039CC4 File Offset: 0x00037EC4
	[Token(Token = "0x6001792")]
	[Address(RVA = "0x764EC0", Offset = "0x763CC0", VA = "0x180764EC0", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x06001793 RID: 6035 RVA: 0x00039CE4 File Offset: 0x00037EE4
	[Token(Token = "0x6001793")]
	[Address(RVA = "0x18B8360", Offset = "0x18B7160", VA = "0x1818B8360", Slot = "21")]
	public override void Submit()
	{
		UIHandlerBase currentHandler = this.navigator.currentHandler;
		int num = 0;
		bool flag = currentHandler == num;
		if (flag)
		{
			return;
		}
		if (this.navigator.currentHandler.index == 998)
		{
			this.PerformSubmitEffect();
			base.Close();
			Game.PlayHandlerScaleEffect(this.navigator.currentHandler);
			Game.PlayCanvasSE(UICanvasSFX.Close);
			return;
		}
		while (!flag)
		{
		}
		this.PerformSubmitEffect();
		Game.CloseStageUI();
		UINavigator navigator = this.navigator;
		throw new NullReferenceException();
	}

	// Token: 0x06001794 RID: 6036 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001794")]
	[Address(RVA = "0x18B6E30", Offset = "0x18B5C30", VA = "0x1818B6E30", Slot = "22")]
	public override void Hold(bool isHolding)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001795 RID: 6037 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001795")]
	[Address(RVA = "0x18B7950", Offset = "0x18B6750", VA = "0x1818B7950", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001796 RID: 6038 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001796")]
	[Address(RVA = "0x18B6FA0", Offset = "0x18B5DA0", VA = "0x1818B6FA0")]
	private void InitHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001797 RID: 6039 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001797")]
	[Address(RVA = "0x18B8040", Offset = "0x18B6E40", VA = "0x1818B8040")]
	private void RefreshActionTip(ControllerDevice device)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001798 RID: 6040 RVA: 0x00039D64 File Offset: 0x00037F64
	[Token(Token = "0x6001798")]
	[Address(RVA = "0x18B7D30", Offset = "0x18B6B30", VA = "0x1818B7D30")]
	private void OnUpgradeFailed()
	{
		Text text = this.description;
		string text2 = Game.<UISystemText>k__BackingField.GetText(218);
		bool dtdValidation = ((IDtdParserAdapterWithValidation)text).DtdValidation;
	}

	// Token: 0x06001799 RID: 6041 RVA: 0x00039D98 File Offset: 0x00037F98
	[Token(Token = "0x6001799")]
	[Address(RVA = "0x18B7ED0", Offset = "0x18B6CD0", VA = "0x1818B7ED0")]
	private void OnUpgradeHandlerSelected(UIHandlerBase handler)
	{
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
		UINavigationEffect uinavigationEffect = this.upgradeNavigation;
		RectTransform rectTransform = handler.rectTransform;
		uinavigationEffect.UpdateParent(rectTransform);
		UINavigationEffect uinavigationEffect2 = this.upgradeNavigation;
		Vector2 zero = Vector2.zero;
		uinavigationEffect2.UpdatePos(zero);
		this.upgradeNavigation.Appear();
		TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTweenModuleUI.DOFade(this.description, 1f, 0.5f).SetEase((Ease)((uint)3)).Play<TweenerCore<Color, Color, ColorOptions>>();
		string[] array = this.descriptionCache;
		Text text = this.description;
		int index = handler.index;
		bool dtdValidation = ((IDtdParserAdapterWithValidation)text).DtdValidation;
	}

	// Token: 0x0600179A RID: 6042 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600179A")]
	[Address(RVA = "0x18B7E10", Offset = "0x18B6C10", VA = "0x1818B7E10")]
	private void OnUpgradeHandlerDeselected(UIHandlerBase handler)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600179B RID: 6043 RVA: 0x00039E30 File Offset: 0x00038030
	[Token(Token = "0x600179B")]
	[Address(RVA = "0x18B7C50", Offset = "0x18B6A50", VA = "0x1818B7C50")]
	private void OnHandlerButtonSelected(UIHandlerBase handler)
	{
		UINavigationEffect uinavigationEffect = this.returnNavigation;
		Vector2 anchoredPosition = handler.rectTransform.anchoredPosition;
		uinavigationEffect.UpdatePos(anchoredPosition);
		UINavigationEffect uinavigationEffect2 = this.returnNavigation;
		if (handler.index == 998)
		{
		}
		UILabelHandler uilabelHandler = this.confirmHandler;
		uinavigationEffect2.UpdateArrowPos(uilabelHandler);
		this.returnNavigation.Appear();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x0600179C RID: 6044 RVA: 0x00039E90 File Offset: 0x00038090
	[Token(Token = "0x600179C")]
	[Address(RVA = "0x18A8CE0", Offset = "0x18A7AE0", VA = "0x1818A8CE0")]
	private void OnHandlerButtonDeselected(UIHandlerBase handler)
	{
		this.returnNavigation.Hide();
	}

	// Token: 0x0600179D RID: 6045 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600179D")]
	[Address(RVA = "0x18B6760", Offset = "0x18B5560", VA = "0x1818B6760")]
	private void PerformSubmitEffect()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600179E RID: 6046 RVA: 0x00039EB0 File Offset: 0x000380B0
	[Token(Token = "0x600179E")]
	[Address(RVA = "0x18B84B0", Offset = "0x18B72B0", VA = "0x1818B84B0")]
	public UIUpgrade()
	{
		string[] array = new string[6];
		this.descriptionCache = array;
		base..ctor();
	}

	// Token: 0x040021C1 RID: 8641
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x40021C1")]
	[SerializeField]
	private Text title;

	// Token: 0x040021C2 RID: 8642
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x40021C2")]
	[SerializeField]
	private UIUpgradeHandler[] handlers;

	// Token: 0x040021C3 RID: 8643
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x40021C3")]
	[SerializeField]
	private UILabelHandler backHandler;

	// Token: 0x040021C4 RID: 8644
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x40021C4")]
	[SerializeField]
	private UILabelHandler confirmHandler;

	// Token: 0x040021C5 RID: 8645
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x40021C5")]
	[SerializeField]
	private Text description;

	// Token: 0x040021C6 RID: 8646
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x40021C6")]
	[SerializeField]
	private RectTransform buttonSelectionIcon;

	// Token: 0x040021C7 RID: 8647
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x40021C7")]
	[SerializeField]
	private UINavigationEffect returnNavigation;

	// Token: 0x040021C8 RID: 8648
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x40021C8")]
	[SerializeField]
	private UINavigationEffect upgradeNavigation;

	// Token: 0x040021C9 RID: 8649
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x40021C9")]
	[SerializeField]
	private Image controllerImg;

	// Token: 0x040021CA RID: 8650
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x40021CA")]
	[SerializeField]
	private Image keyboardImg;

	// Token: 0x040021CB RID: 8651
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x40021CB")]
	[SerializeField]
	private Text hold;

	// Token: 0x040021CC RID: 8652
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x40021CC")]
	[SerializeField]
	private Text keyboardText;

	// Token: 0x040021CD RID: 8653
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x40021CD")]
	private readonly string[] descriptionCache;

	// Token: 0x040021CE RID: 8654
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x40021CE")]
	private int curNavIdx;

	// Token: 0x040021CF RID: 8655
	[FieldOffset(Offset = "0xC4")]
	[Token(Token = "0x40021CF")]
	private int curUpgradeTypeID;

	// Token: 0x040021D0 RID: 8656
	[Token(Token = "0x40021D0")]
	private const int BACK_HANDLER_INDEX = 998;

	// Token: 0x040021D1 RID: 8657
	[Token(Token = "0x40021D1")]
	private const int CONFIRM_HANDLER_INDEX = 999;

	// Token: 0x040021D2 RID: 8658
	[FieldOffset(Offset = "0xC8")]
	[Token(Token = "0x40021D2")]
	private UpgradeMap upgradeMap;
}
