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

// Token: 0x020002AC RID: 684
[Token(Token = "0x20002AC")]
public class UIUpgrade : GameCanvasBase
{
	// Token: 0x060019AF RID: 6575 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019AF")]
	[Address(RVA = "0xCBA8E0", Offset = "0xCB98E0", VA = "0x180CBA8E0", Slot = "11")]
	public override void Init()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019B0 RID: 6576 RVA: 0x0003F374 File Offset: 0x0003D574
	[Token(Token = "0x60019B0")]
	[Address(RVA = "0xCB9C20", Offset = "0xCB8C20", VA = "0x180CB9C20", Slot = "12")]
	protected override void Appear(Action completeHandler)
	{
		UIUpgradeHandler[] array = this.handlers;
		int num = 0;
		int num2 = 0;
		int length = array.Length;
		if (num < length)
		{
			UIUpgradeHandler uiupgradeHandler = array[num2];
			int num3 = 0;
			int num4 = 0;
			uiupgradeHandler.UpdateHandlerInfo((float)num4, (float)num3);
			num2++;
		}
		this.returnNavigation.HideImmediate();
		this.upgradeNavigation.HideImmediate();
		UIUpgradeHandler[] array2 = this.handlers;
		UINavigator navigator = this.navigator;
		this.curNavIdx = (int)((ulong)0L);
		UIUpgradeHandler uiupgradeHandler2 = array2[0];
		navigator.SetDefaultHandler(uiupgradeHandler2);
		GameObject gameObject = this.buttonSelectionIcon.gameObject;
		int num5 = 0;
		gameObject.SetActive(num5 != 0);
		base.Appear(completeHandler);
	}

	// Token: 0x060019B1 RID: 6577 RVA: 0x0003F420 File Offset: 0x0003D620
	[Token(Token = "0x60019B1")]
	[Address(RVA = "0xCB9D50", Offset = "0xCB8D50", VA = "0x180CB9D50", Slot = "13")]
	protected override void Hide(Action completeHandler)
	{
		UIUpgradeHandler[] array = this.handlers;
		int num = this.curUpgradeTypeID;
		array[num].CancelUpgrade();
		base.Hide(completeHandler);
	}

	// Token: 0x060019B2 RID: 6578 RVA: 0x0003F454 File Offset: 0x0003D654
	[Token(Token = "0x60019B2")]
	[Address(RVA = "0x94CB50", Offset = "0x94BB50", VA = "0x18094CB50", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x060019B3 RID: 6579 RVA: 0x0003F474 File Offset: 0x0003D674
	[Token(Token = "0x60019B3")]
	[Address(RVA = "0xCBB4B0", Offset = "0xCBA4B0", VA = "0x180CBB4B0", 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: 0x060019B4 RID: 6580 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019B4")]
	[Address(RVA = "0xCB9DC0", Offset = "0xCB8DC0", VA = "0x180CB9DC0", Slot = "22")]
	public override void Hold(bool isHolding)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019B5 RID: 6581 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019B5")]
	[Address(RVA = "0xCBA9E0", Offset = "0xCB99E0", VA = "0x180CBA9E0", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019B6 RID: 6582 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019B6")]
	[Address(RVA = "0xCBA020", Offset = "0xCB9020", VA = "0x180CBA020")]
	private void InitHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019B7 RID: 6583 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019B7")]
	[Address(RVA = "0xCBB190", Offset = "0xCBA190", VA = "0x180CBB190")]
	private void RefreshActionTip(ControllerDevice device)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019B8 RID: 6584 RVA: 0x0003F4F4 File Offset: 0x0003D6F4
	[Token(Token = "0x60019B8")]
	[Address(RVA = "0xCBAE80", Offset = "0xCB9E80", VA = "0x180CBAE80")]
	private void OnUpgradeFailed()
	{
		Text text = this.description;
		string text2 = Game.<UISystemText>k__BackingField.GetText(218);
		((ICanvasElement)text).GraphicUpdateComplete();
	}

	// Token: 0x060019B9 RID: 6585 RVA: 0x0003F524 File Offset: 0x0003D724
	[Token(Token = "0x60019B9")]
	[Address(RVA = "0xCBB020", Offset = "0xCBA020", VA = "0x180CBB020")]
	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;
		((ICanvasElement)text).GraphicUpdateComplete();
	}

	// Token: 0x060019BA RID: 6586 RVA: 0x0003F5B8 File Offset: 0x0003D7B8
	[Token(Token = "0x60019BA")]
	[Address(RVA = "0xCBAF60", Offset = "0xCB9F60", VA = "0x180CBAF60")]
	private void OnUpgradeHandlerDeselected(UIHandlerBase handler)
	{
		this.upgradeNavigation.Hide();
		Text text = this.description;
		int num = 0;
		TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTweenModuleUI.DOFade(text, (float)num, 0.5f).SetEase((Ease)((uint)3)).Play<TweenerCore<Color, Color, ColorOptions>>();
		UIUpgradeHandler[] array = this.handlers;
		int num2 = this.curUpgradeTypeID;
		array[num2].CancelUpgrade();
	}

	// Token: 0x060019BB RID: 6587 RVA: 0x0003F614 File Offset: 0x0003D814
	[Token(Token = "0x60019BB")]
	[Address(RVA = "0xCBADA0", Offset = "0xCB9DA0", VA = "0x180CBADA0")]
	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: 0x060019BC RID: 6588 RVA: 0x0003F674 File Offset: 0x0003D874
	[Token(Token = "0x60019BC")]
	[Address(RVA = "0x95C060", Offset = "0x95B060", VA = "0x18095C060")]
	private void OnHandlerButtonDeselected(UIHandlerBase handler)
	{
		this.returnNavigation.Hide();
	}

	// Token: 0x060019BD RID: 6589 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019BD")]
	[Address(RVA = "0xCB8280", Offset = "0xCB7280", VA = "0x180CB8280")]
	private void PerformSubmitEffect()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019BE RID: 6590 RVA: 0x0003F694 File Offset: 0x0003D894
	[Token(Token = "0x60019BE")]
	[Address(RVA = "0xCBB600", Offset = "0xCBA600", VA = "0x180CBB600")]
	public UIUpgrade()
	{
		string[] array = new string[6];
		this.descriptionCache = array;
		base..ctor();
	}

	// Token: 0x04002411 RID: 9233
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002411")]
	[SerializeField]
	private Text title;

	// Token: 0x04002412 RID: 9234
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4002412")]
	[SerializeField]
	private UIUpgradeHandler[] handlers;

	// Token: 0x04002413 RID: 9235
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002413")]
	[SerializeField]
	private UILabelHandler backHandler;

	// Token: 0x04002414 RID: 9236
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002414")]
	[SerializeField]
	private UILabelHandler confirmHandler;

	// Token: 0x04002415 RID: 9237
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002415")]
	[SerializeField]
	private Text description;

	// Token: 0x04002416 RID: 9238
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002416")]
	[SerializeField]
	private RectTransform buttonSelectionIcon;

	// Token: 0x04002417 RID: 9239
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002417")]
	[SerializeField]
	private UINavigationEffect returnNavigation;

	// Token: 0x04002418 RID: 9240
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4002418")]
	[SerializeField]
	private UINavigationEffect upgradeNavigation;

	// Token: 0x04002419 RID: 9241
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4002419")]
	[SerializeField]
	private Image controllerImg;

	// Token: 0x0400241A RID: 9242
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x400241A")]
	[SerializeField]
	private Image keyboardImg;

	// Token: 0x0400241B RID: 9243
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x400241B")]
	[SerializeField]
	private Text hold;

	// Token: 0x0400241C RID: 9244
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x400241C")]
	[SerializeField]
	private Text keyboardText;

	// Token: 0x0400241D RID: 9245
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x400241D")]
	private readonly string[] descriptionCache;

	// Token: 0x0400241E RID: 9246
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x400241E")]
	private int curNavIdx;

	// Token: 0x0400241F RID: 9247
	[FieldOffset(Offset = "0xC4")]
	[Token(Token = "0x400241F")]
	private int curUpgradeTypeID;

	// Token: 0x04002420 RID: 9248
	[Token(Token = "0x4002420")]
	private const int BACK_HANDLER_INDEX = 998;

	// Token: 0x04002421 RID: 9249
	[Token(Token = "0x4002421")]
	private const int CONFIRM_HANDLER_INDEX = 999;

	// Token: 0x04002422 RID: 9250
	[FieldOffset(Offset = "0xC8")]
	[Token(Token = "0x4002422")]
	private UpgradeMap upgradeMap;
}
