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

// Token: 0x020002AB RID: 683
[Token(Token = "0x20002AB")]
public class UITrade : GameCanvasBase
{
	// Token: 0x0600199D RID: 6557 RVA: 0x0003EE74 File Offset: 0x0003D074
	[Token(Token = "0x600199D")]
	[Address(RVA = "0xCB6FB0", Offset = "0xCB5FB0", VA = "0x180CB6FB0")]
	public void InitAndOpen(Action closedHandler, SavePoint savePointData)
	{
		this.InitDisplayInfo(savePointData);
		base.Open(closedHandler);
	}

	// Token: 0x0600199E RID: 6558 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600199E")]
	[Address(RVA = "0xCB7AD0", Offset = "0xCB6AD0", VA = "0x180CB7AD0", Slot = "11")]
	public override void Init()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600199F RID: 6559 RVA: 0x0003EE90 File Offset: 0x0003D090
	[Token(Token = "0x600199F")]
	[Address(RVA = "0xCB6C10", Offset = "0xCB5C10", VA = "0x180CB6C10", Slot = "12")]
	protected override void Appear(Action completeHandler)
	{
		this.returnNavigation.HideImmediate();
		this.tradeNavigation.HideImmediate();
		UITradeHandler[] array = this.handlers;
		UINavigator navigator = this.navigator;
		UITradeHandler uitradeHandler = array[0];
		navigator.SetDefaultHandler(uitradeHandler);
		GameObject gameObject = this.buttonSelectionIcon.gameObject;
		int num = 0;
		gameObject.SetActive(num != 0);
		base.Appear(completeHandler);
	}

	// Token: 0x060019A0 RID: 6560 RVA: 0x0003EEF4 File Offset: 0x0003D0F4
	[Token(Token = "0x60019A0")]
	[Address(RVA = "0xCB6CC0", Offset = "0xCB5CC0", VA = "0x180CB6CC0", Slot = "13")]
	protected override void Hide(Action completeHandler)
	{
		UITradeHandler uitradeHandler = this.currentTradeHandler;
		int num = 0;
		if (uitradeHandler != num)
		{
			this.currentTradeHandler.CancelTrade();
		}
		base.Hide(completeHandler);
	}

	// Token: 0x060019A1 RID: 6561 RVA: 0x0003EF2C File Offset: 0x0003D12C
	[Token(Token = "0x60019A1")]
	[Address(RVA = "0x94CB50", Offset = "0x94BB50", VA = "0x18094CB50", Slot = "18")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x060019A2 RID: 6562 RVA: 0x0003EF4C File Offset: 0x0003D14C
	[Token(Token = "0x60019A2")]
	[Address(RVA = "0xCB8660", Offset = "0xCB7660", VA = "0x180CB8660", 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: 0x060019A3 RID: 6563 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019A3")]
	[Address(RVA = "0xCB6D60", Offset = "0xCB5D60", VA = "0x180CB6D60", Slot = "22")]
	public override void Hold(bool isHolding)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019A4 RID: 6564 RVA: 0x0003EFCC File Offset: 0x0003D1CC
	[Token(Token = "0x60019A4")]
	[Address(RVA = "0xCB7BA0", Offset = "0xCB6BA0", VA = "0x180CB7BA0", Slot = "25")]
	public override void Localize(LocalizationData data)
	{
		Text text = this.title;
		string text2 = data.systemText.GetText(181);
		text.text = text2;
		GameTextData systemText = data.systemText;
		Text text3 = this.hold;
		string text4 = systemText.GetText(184);
		text3.text = text4;
		GameTextData systemText2 = data.systemText;
		UILabelHandler uilabelHandler = this.backHandler;
		string text5 = systemText2.GetText(12);
		uilabelHandler.SetLabel(text5);
		GameTextData systemText3 = data.systemText;
		UILabelHandler uilabelHandler2 = this.confirmHandler;
		string text6 = systemText3.GetText(13);
		uilabelHandler2.SetLabel(text6);
		GameFontPack fontPack = data.fontPack;
		Text text7 = this.title;
		Font light = fontPack.light;
		text7.font = light;
		UITradeHandler[] array = this.handlers;
		int num = 0;
		int length = array.Length;
		if (num < length)
		{
			UITradeHandler uitradeHandler = array[num];
			GameFontPack fontPack2 = data.fontPack;
			Text number = uitradeHandler.number;
			Font regular = fontPack2.regular;
			number.font = regular;
			Text cost = uitradeHandler.cost;
			Font regular2 = fontPack2.regular;
			cost.font = regular2;
			num++;
		}
		GameFontPack fontPack3 = data.fontPack;
		Text text8 = this.hold;
		Font regular3 = fontPack3.regular;
		text8.font = regular3;
		GameFontPack fontPack4 = data.fontPack;
		Text text9 = this.keyboardText;
		Font regular4 = fontPack4.regular;
		text9.font = regular4;
		GameFontPack fontPack5 = data.fontPack;
		Text text10 = this.description;
		Font regular5 = fontPack5.regular;
		text10.font = regular5;
		GameFontPack fontPack6 = data.fontPack;
		UILabelHandler uilabelHandler3 = this.backHandler;
		Font medium = fontPack6.medium;
		uilabelHandler3.SetFont(medium);
		GameFontPack fontPack7 = data.fontPack;
		UILabelHandler uilabelHandler4 = this.confirmHandler;
		Font medium2 = fontPack7.medium;
		uilabelHandler4.SetFont(medium2);
	}

	// Token: 0x060019A5 RID: 6565 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019A5")]
	[Address(RVA = "0xCB71C0", Offset = "0xCB61C0", VA = "0x180CB71C0")]
	private void InitHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019A6 RID: 6566 RVA: 0x0003F1A0 File Offset: 0x0003D3A0
	[Token(Token = "0x60019A6")]
	[Address(RVA = "0xCB6FF0", Offset = "0xCB5FF0", VA = "0x180CB6FF0")]
	private void InitDisplayInfo(SavePoint savePointData)
	{
		int num = 0;
		if (!(savePointData != num))
		{
			Debug.Log("UIBuy-NULL");
			UITradeHandler[] array = this.handlers;
			int num2 = 0;
			if (num2 >= array.Length)
			{
				return;
			}
			UITradeHandler uitradeHandler = array[num2];
			int num3 = 0;
			uitradeHandler.UpdateItemInfo((ItemSystem.ItemType)num3);
			UITradeHandler[] array2 = this.handlers;
			num2++;
		}
		UITradeHandler[] array3 = this.handlers;
		int num4 = 0;
		if (num4 < array3.Length)
		{
			UITradeHandler uitradeHandler2 = array3[num4];
			ItemSystem.ItemType[] sellItem = savePointData.SellItem;
			if (num4 < sellItem.Length)
			{
			}
			uitradeHandler2.UpdateItemInfo((ItemSystem.ItemType)num4);
			UITradeHandler[] array4 = this.handlers;
			num4++;
			while (array4 != 0)
			{
			}
		}
	}

	// Token: 0x060019A7 RID: 6567 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019A7")]
	[Address(RVA = "0xCB8340", Offset = "0xCB7340", VA = "0x180CB8340")]
	private void RefreshActionTip(ControllerDevice device)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019A8 RID: 6568 RVA: 0x0003F24C File Offset: 0x0003D44C
	[Token(Token = "0x60019A8")]
	[Address(RVA = "0xCB7F10", Offset = "0xCB6F10", VA = "0x180CB7F10")]
	private void OnTradeFailed()
	{
		Text text = this.description;
		string text2 = Game.<UISystemText>k__BackingField.GetText(218);
		((ICanvasElement)text).GraphicUpdateComplete();
	}

	// Token: 0x060019A9 RID: 6569 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60019A9")]
	[Address(RVA = "0xCB80F0", Offset = "0xCB70F0", VA = "0x180CB80F0")]
	private void OnTradeHandlerSelected(UIHandlerBase handler)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060019AA RID: 6570 RVA: 0x0003F27C File Offset: 0x0003D47C
	[Token(Token = "0x60019AA")]
	[Address(RVA = "0xCB7FF0", Offset = "0xCB6FF0", VA = "0x180CB7FF0")]
	private void OnTradeHandlerDeselected(UIHandlerBase handler)
	{
		this.tradeNavigation.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>>();
		UITradeHandler uitradeHandler = this.currentTradeHandler;
		int num2 = 0;
		if (uitradeHandler != num2)
		{
			this.currentTradeHandler.CancelTrade();
			return;
		}
	}

	// Token: 0x060019AB RID: 6571 RVA: 0x0003F2E0 File Offset: 0x0003D4E0
	[Token(Token = "0x60019AB")]
	[Address(RVA = "0xCB7E30", Offset = "0xCB6E30", VA = "0x180CB7E30")]
	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.backHandler;
		uinavigationEffect2.UpdateArrowPos(uilabelHandler);
		this.returnNavigation.Appear();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060019AC RID: 6572 RVA: 0x0003F340 File Offset: 0x0003D540
	[Token(Token = "0x60019AC")]
	[Address(RVA = "0x95C060", Offset = "0x95B060", VA = "0x18095C060")]
	private void OnHandlerButtonDeselected(UIHandlerBase handler)
	{
		this.returnNavigation.Hide();
	}

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

	// Token: 0x060019AE RID: 6574 RVA: 0x0003F360 File Offset: 0x0003D560
	[Token(Token = "0x60019AE")]
	[Address(RVA = "0x94D9C0", Offset = "0x94C9C0", VA = "0x18094D9C0")]
	public UITrade()
	{
	}

	// Token: 0x04002402 RID: 9218
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002402")]
	[SerializeField]
	private Text title;

	// Token: 0x04002403 RID: 9219
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4002403")]
	[SerializeField]
	private UITradeHandler[] handlers;

	// Token: 0x04002404 RID: 9220
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002404")]
	[SerializeField]
	private UILabelHandler backHandler;

	// Token: 0x04002405 RID: 9221
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002405")]
	[SerializeField]
	private UILabelHandler confirmHandler;

	// Token: 0x04002406 RID: 9222
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002406")]
	[SerializeField]
	private Text description;

	// Token: 0x04002407 RID: 9223
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002407")]
	[SerializeField]
	private RectTransform buttonSelectionIcon;

	// Token: 0x04002408 RID: 9224
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002408")]
	[SerializeField]
	private UINavigationEffect returnNavigation;

	// Token: 0x04002409 RID: 9225
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4002409")]
	[SerializeField]
	private UINavigationEffect tradeNavigation;

	// Token: 0x0400240A RID: 9226
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x400240A")]
	[SerializeField]
	private Image controllerImg;

	// Token: 0x0400240B RID: 9227
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x400240B")]
	[SerializeField]
	private Image keyboardImg;

	// Token: 0x0400240C RID: 9228
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x400240C")]
	[SerializeField]
	private Text hold;

	// Token: 0x0400240D RID: 9229
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x400240D")]
	[SerializeField]
	private Text keyboardText;

	// Token: 0x0400240E RID: 9230
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x400240E")]
	private UITradeHandler currentTradeHandler;

	// Token: 0x0400240F RID: 9231
	[Token(Token = "0x400240F")]
	private const int BACK_HANDLER_INDEX = 998;

	// Token: 0x04002410 RID: 9232
	[Token(Token = "0x4002410")]
	private const int CONFIRM_HANDLER_INDEX = 999;
}
