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: 0x0200023F RID: 575
[Token(Token = "0x200023F")]
public class UIKeyBindingPage : MonoBehaviour
{
	// Token: 0x170000DF RID: 223
	// (get) Token: 0x0600162B RID: 5675 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x170000DF")]
	public UIHandlerBase FirstHandler
	{
		[Token(Token = "0x600162B")]
		[Address(RVA = "0x788870", Offset = "0x787670", VA = "0x180788870")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x0600162C RID: 5676 RVA: 0x00033310 File Offset: 0x00031510
	[Token(Token = "0x600162C")]
	[Address(RVA = "0x1019320", Offset = "0x1018120", VA = "0x181019320")]
	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: 0x0600162D RID: 5677 RVA: 0x00033378 File Offset: 0x00031578
	[Token(Token = "0x600162D")]
	[Address(RVA = "0x10190E0", Offset = "0x1017EE0", VA = "0x1810190E0")]
	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: 0x0600162E RID: 5678 RVA: 0x000333DC File Offset: 0x000315DC
	[Token(Token = "0x600162E")]
	[Address(RVA = "0x10197C0", Offset = "0x10185C0", VA = "0x1810197C0")]
	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: 0x0600162F RID: 5679 RVA: 0x00033464 File Offset: 0x00031664
	[Token(Token = "0x600162F")]
	[Address(RVA = "0x1018F70", Offset = "0x1017D70", VA = "0x181018F70")]
	public void Active(bool isActive)
	{
		this.canvasGroup.blocksRaycasts = isActive;
		this.canvasGroup.alpha = isActive;
	}

	// Token: 0x06001630 RID: 5680 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001630")]
	[Address(RVA = "0x1019610", Offset = "0x1018410", VA = "0x181019610")]
	public void SetupKeyBindingInfo(bool isGamepad)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001631 RID: 5681 RVA: 0x00033490 File Offset: 0x00031690
	[Token(Token = "0x6001631")]
	[Address(RVA = "0x1019920", Offset = "0x1018720", VA = "0x181019920")]
	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: 0x06001632 RID: 5682 RVA: 0x000334C8 File Offset: 0x000316C8
	[Token(Token = "0x6001632")]
	[Address(RVA = "0x1019460", Offset = "0x1018260", VA = "0x181019460")]
	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: 0x06001633 RID: 5683 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001633")]
	[Address(RVA = "0x1018FC0", Offset = "0x1017DC0", VA = "0x181018FC0")]
	public void Appear()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001634 RID: 5684 RVA: 0x0003358C File Offset: 0x0003178C
	[Token(Token = "0x6001634")]
	[Address(RVA = "0x10191B0", Offset = "0x1017FB0", VA = "0x1810191B0")]
	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: 0x06001635 RID: 5685 RVA: 0x0003360C File Offset: 0x0003180C
	[Token(Token = "0x6001635")]
	[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
	public UIKeyBindingPage()
	{
	}

	// Token: 0x04002107 RID: 8455
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002107")]
	[SerializeField]
	private CanvasGroup canvasGroup;

	// Token: 0x04002108 RID: 8456
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002108")]
	[SerializeField]
	private UIKeyBindingHandler[] handlers;
}
