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

// Token: 0x02000289 RID: 649
[Token(Token = "0x2000289")]
public class UIKeyBindingPage : MonoBehaviour
{
	// Token: 0x170000EE RID: 238
	// (get) Token: 0x0600184A RID: 6218 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x170000EE")]
	public UIHandlerBase FirstHandler
	{
		[Token(Token = "0x600184A")]
		[Address(RVA = "0x7F6490", Offset = "0x7F5490", VA = "0x1807F6490")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x0600184B RID: 6219 RVA: 0x000383FC File Offset: 0x000365FC
	[Token(Token = "0x600184B")]
	[Address(RVA = "0xE72440", Offset = "0xE71440", VA = "0x180E72440")]
	public void Init(UIHandlerBase backHandler)
	{
		UIKeyBindingHandler[] array;
		int num;
		do
		{
			array = this.handlers;
			num = 0;
		}
		while (num >= array.Length);
		array[num].index = num;
		num++;
		List<UIHandlerBase> list = new List(this.handlers);
		list.Add(backHandler);
		int num2 = 0;
		UINavigationSetter uinavigationSetter = UINavigationSetter.Get(UINavigationMode.Vertical, true, num2);
		UIHandlerBase[] array2 = list.ToArray();
		uinavigationSetter.Apply(array2);
	}

	// Token: 0x0600184C RID: 6220 RVA: 0x00038464 File Offset: 0x00036664
	[Token(Token = "0x600184C")]
	[Address(RVA = "0xE72200", Offset = "0xE71200", VA = "0x180E72200")]
	public void BindSelectionEvents(UINavigator navigator, Action<UIHandlerBase> onSelected, Action<UIHandlerBase> onDeselected)
	{
		UIKeyBindingHandler[] array = this.handlers;
		int num = 0;
		int length = array.Length;
		if (num < length)
		{
			UIKeyBindingHandler uikeyBindingHandler = array[num];
			uikeyBindingHandler.onSelectedHandler = onSelected;
			uikeyBindingHandler.onDeselectedHandler = onDeselected;
			num++;
		}
		UIKeyBindingHandler[] array2 = this.handlers;
		navigator.BindPointerEnterEvent(array2);
		UIKeyBindingHandler[] array3 = this.handlers;
		navigator.BindPointerExitEvent(array3);
	}

	// Token: 0x0600184D RID: 6221 RVA: 0x000384C8 File Offset: 0x000366C8
	[Token(Token = "0x600184D")]
	[Address(RVA = "0xE728E0", Offset = "0xE718E0", VA = "0x180E728E0")]
	public void SetupNavigation(UIHandlerBase defaultHandler, UIHandlerBase backHandler)
	{
		UIKeyBindingHandler[] array = this.handlers;
		int num = array.Length - 1;
		UIKeyBindingHandler uikeyBindingHandler = array[num];
		defaultHandler.SetupNavigationHandler(Direction2D.Up, uikeyBindingHandler);
		UIKeyBindingHandler uikeyBindingHandler2 = this.handlers[0];
		defaultHandler.SetupNavigationHandler(Direction2D.Down, uikeyBindingHandler2);
		UIKeyBindingHandler[] array2 = this.handlers;
		int num2 = array2.Length - 1;
		UIKeyBindingHandler uikeyBindingHandler3 = array2[num2];
		backHandler.SetupNavigationHandler(Direction2D.Up, uikeyBindingHandler3);
		UIKeyBindingHandler uikeyBindingHandler4 = this.handlers[0];
		backHandler.SetupNavigationHandler(Direction2D.Down, uikeyBindingHandler4);
	}

	// Token: 0x0600184E RID: 6222 RVA: 0x00038550 File Offset: 0x00036750
	[Token(Token = "0x600184E")]
	[Address(RVA = "0xE72090", Offset = "0xE71090", VA = "0x180E72090")]
	public void Active(bool isActive)
	{
		this.canvasGroup.blocksRaycasts = isActive;
		this.canvasGroup.alpha = isActive;
	}

	// Token: 0x0600184F RID: 6223 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600184F")]
	[Address(RVA = "0xE72730", Offset = "0xE71730", VA = "0x180E72730")]
	public void SetupKeyBindingInfo(bool isGamepad)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001850 RID: 6224 RVA: 0x0003857C File Offset: 0x0003677C
	[Token(Token = "0x6001850")]
	[Address(RVA = "0xE72A40", Offset = "0xE71A40", VA = "0x180E72A40")]
	public void UpdateIcon(bool isGamepad)
	{
		UIKeyBindingHandler[] array = this.handlers;
		int num = 0;
		int length = array.Length;
		if (num < length)
		{
			array[num].UpdateIcon(isGamepad);
			num++;
		}
	}

	// Token: 0x06001851 RID: 6225 RVA: 0x000385B4 File Offset: 0x000367B4
	[Token(Token = "0x6001851")]
	[Address(RVA = "0xE72580", Offset = "0xE71580", VA = "0x180E72580")]
	public void Localize(LocalizationData data, Dictionary<string, int> keyCodeLabelMap)
	{
		UIKeyBindingHandler[] array = this.handlers;
		int num = 0;
		int length = array.Length;
		if (num < length)
		{
			UIKeyBindingHandler uikeyBindingHandler = array[num];
			string name = uikeyBindingHandler.name;
			if (!keyCodeLabelMap.TryGetValue(name, num))
			{
				string name2 = uikeyBindingHandler.name;
				string text = "Undefined Key: " + name2;
				uikeyBindingHandler.label.text = text;
			}
			string text2 = data.systemText.GetText(num);
			uikeyBindingHandler.label.text = text2;
			GameFontPack fontPack = data.fontPack;
			Text label = uikeyBindingHandler.label;
			Font regular = fontPack.regular;
			label.font = regular;
			Text value = uikeyBindingHandler.value;
			Font regular2 = fontPack.regular;
			value.font = regular2;
			num++;
		}
	}

	// Token: 0x06001852 RID: 6226 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001852")]
	[Address(RVA = "0xE720E0", Offset = "0xE710E0", VA = "0x180E720E0")]
	public void Appear()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001853 RID: 6227 RVA: 0x00038678 File Offset: 0x00036878
	[Token(Token = "0x6001853")]
	[Address(RVA = "0xE722D0", Offset = "0xE712D0", VA = "0x180E722D0")]
	public void Hide(Action onCompleted)
	{
		CanvasGroup canvasGroup = this.canvasGroup;
		int num = 0;
		canvasGroup.blocksRaycasts = num != 0;
		CanvasGroup canvasGroup2 = this.canvasGroup;
		int num2 = 0;
		TweenerCore<float, float, FloatOptions> tweenerCore = DOTweenModuleUI.DOFade(canvasGroup2, (float)num2, 0.25f);
		int num3 = 0;
		TweenerCore<float, float, FloatOptions> tweenerCore2 = TweenSettingsExtensions.From<float, float, FloatOptions>(tweenerCore, (float)num, true, num3 != 0).SetEase((Ease)((uint)9));
		TweenCallback tweenCallback = delegate
		{
			Action onCompleted2 = onCompleted;
			if (onCompleted2 != 0)
			{
				onCompleted2();
				return;
			}
		};
		TweenerCore<float, float, FloatOptions> tweenerCore3 = tweenerCore2.OnComplete(tweenCallback).Play<TweenerCore<float, float, FloatOptions>>();
	}

	// Token: 0x06001854 RID: 6228 RVA: 0x000386F8 File Offset: 0x000368F8
	[Token(Token = "0x6001854")]
	[Address(RVA = "0x328C40", Offset = "0x327C40", VA = "0x180328C40")]
	public UIKeyBindingPage()
	{
	}

	// Token: 0x04002354 RID: 9044
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002354")]
	[SerializeField]
	private CanvasGroup canvasGroup;

	// Token: 0x04002355 RID: 9045
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002355")]
	[SerializeField]
	private UIKeyBindingHandler[] handlers;
}
