using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using MarsSDK;
using MEC;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x02000283 RID: 643
[Token(Token = "0x2000283")]
public abstract class UIKeyBindingBase : UISubSettingsBase
{
	// Token: 0x170000E8 RID: 232
	// (get) Token: 0x060017E5 RID: 6117
	[Token(Token = "0x170000E8")]
	protected abstract bool IsGamepad
	{
		[Token(Token = "0x60017E5")]
		[Address(Slot = "22")]
		get;
	}

	// Token: 0x060017E6 RID: 6118 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017E6")]
	[Address(RVA = "0xE6FEA0", Offset = "0xE6EEA0", VA = "0x180E6FEA0", Slot = "11")]
	public override void Init(CanvasGroup mainCanvasGroup, Action cancelHandler, Text title)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017E7 RID: 6119 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017E7")]
	[Address(RVA = "0xE6FBC0", Offset = "0xE6EBC0", VA = "0x180E6FBC0")]
	private void InitPages()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017E8 RID: 6120 RVA: 0x000370B4 File Offset: 0x000352B4
	[Token(Token = "0x60017E8")]
	[Address(RVA = "0xE6F7B0", Offset = "0xE6E7B0", VA = "0x180E6F7B0")]
	private void InitBottomHandlers()
	{
		UIHandlerBase[] array;
		UILabelHandler uilabelHandler2;
		for (;;)
		{
			this.defaultHandler.index = (int)((ulong)900L);
			this.backHandler.index = (int)((ulong)901L);
			array = new UIHandlerBase[2];
			UILabelHandler uilabelHandler = this.defaultHandler;
			if (uilabelHandler == 0 || array != 0)
			{
				array[0] = uilabelHandler;
				uilabelHandler2 = this.backHandler;
				if (uilabelHandler2 == 0 || array != 0)
				{
					break;
				}
			}
		}
		array[1] = uilabelHandler2;
		int num = 0;
		UINavigationSetter.Get(UINavigationMode.Horizontal, true, num).Apply(array);
		int num2 = 0;
		int length = array.Length;
		if (num2 < length)
		{
			UIHandlerBase uihandlerBase = array[num2];
			Action<UIHandlerBase> action = new Action(this.OnBottomHandlerSelected);
			uihandlerBase.onSelectedHandler = action;
			Action<UIHandlerBase> action2 = new Action(this.OnBottomHandlerDeselected);
			uihandlerBase.onDeselectedHandler = action2;
			num2++;
		}
		this.navigator.BindPointerEnterEvent(array);
		this.navigator.BindPointerExitEvent(array);
	}

	// Token: 0x060017E9 RID: 6121 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017E9")]
	[Address(RVA = "0xE6FA30", Offset = "0xE6EA30", VA = "0x180E6FA30")]
	private void InitEffects()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017EA RID: 6122 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017EA")]
	[Address(RVA = "0xE70350", Offset = "0xE6F350", VA = "0x180E70350", Slot = "12")]
	public override void Open()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017EB RID: 6123 RVA: 0x00037198 File Offset: 0x00035398
	[Token(Token = "0x60017EB")]
	[Address(RVA = "0xE70060", Offset = "0xE6F060", VA = "0x180E70060", Slot = "13")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x060017EC RID: 6124 RVA: 0x000371B8 File Offset: 0x000353B8
	[Token(Token = "0x60017EC")]
	[Address(RVA = "0xE70230", Offset = "0xE6F230", VA = "0x180E70230")]
	private void OnTopHandlerSelected(UIHandlerBase handler)
	{
		UIKeyBindingPage[] array = this.pages;
		UINavigationEffect uinavigationEffect = this.topNavigationEffect;
		int num = this.pageIndex;
		Transform transform = array[num].transform;
		uinavigationEffect.root.parentInternal = transform;
		UINavigationEffect uinavigationEffect2 = this.topNavigationEffect;
		Vector2 anchoredPosition = handler.rectTransform.anchoredPosition;
		uinavigationEffect2.root.anchoredPosition = anchoredPosition;
		this.topNavigationEffect.Appear();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060017ED RID: 6125 RVA: 0x00037230 File Offset: 0x00035430
	[Token(Token = "0x60017ED")]
	[Address(RVA = "0xE70210", Offset = "0xE6F210", VA = "0x180E70210")]
	private void OnTopHandlerDeselected(UIHandlerBase handler)
	{
		this.topNavigationEffect.Hide();
	}

	// Token: 0x060017EE RID: 6126 RVA: 0x00037250 File Offset: 0x00035450
	[Token(Token = "0x60017EE")]
	[Address(RVA = "0xE70080", Offset = "0xE6F080", VA = "0x180E70080")]
	private void OnBottomHandlerSelected(UIHandlerBase handler)
	{
		UINavigationEffect uinavigationEffect = this.bottomNavigationEffect;
		if (handler.index != 900)
		{
		}
		UILabelHandler uilabelHandler = this.defaultHandler;
		uinavigationEffect.UpdateArrowPos(uilabelHandler);
		RectTransform rectTransform = handler.rectTransform;
		UINavigationEffect uinavigationEffect2 = this.bottomNavigationEffect;
		Vector2 anchoredPosition = rectTransform.anchoredPosition;
		uinavigationEffect2.root.anchoredPosition = anchoredPosition;
		this.bottomNavigationEffect.Appear();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060017EF RID: 6127 RVA: 0x000372BC File Offset: 0x000354BC
	[Token(Token = "0x60017EF")]
	[Address(RVA = "0x95C100", Offset = "0x95B100", VA = "0x18095C100")]
	private void OnBottomHandlerDeselected(UIHandlerBase handler)
	{
		this.bottomNavigationEffect.Hide();
	}

	// Token: 0x060017F0 RID: 6128 RVA: 0x000372DC File Offset: 0x000354DC
	[Token(Token = "0x60017F0")]
	[Address(RVA = "0xE71110", Offset = "0xE70110", VA = "0x180E71110", Slot = "14")]
	public override void SwitchLeftward()
	{
		this.arrowController.SwitchPageLeftward();
	}

	// Token: 0x060017F1 RID: 6129 RVA: 0x000372FC File Offset: 0x000354FC
	[Token(Token = "0x60017F1")]
	[Address(RVA = "0xE715E0", Offset = "0xE705E0", VA = "0x180E715E0")]
	private int TrySwitchLeftward()
	{
		if (this.pageIndex != 0)
		{
			this.SwitchPage(-1);
			return this.pageIndex;
		}
		return -1;
	}

	// Token: 0x060017F2 RID: 6130 RVA: 0x00037324 File Offset: 0x00035524
	[Token(Token = "0x60017F2")]
	[Address(RVA = "0xE715B0", Offset = "0xE705B0", VA = "0x180E715B0", Slot = "15")]
	public override void SwitchRightward()
	{
		this.arrowController.SwitchPageRightward();
	}

	// Token: 0x060017F3 RID: 6131 RVA: 0x00037344 File Offset: 0x00035544
	[Token(Token = "0x60017F3")]
	[Address(RVA = "0xE71610", Offset = "0xE70610", VA = "0x180E71610")]
	private int TrySwitchRightward()
	{
		int length = this.pages.Length;
		if (this.pageIndex != length)
		{
			this.SwitchPage(1);
			return this.pageIndex;
		}
		return -1;
	}

	// Token: 0x060017F4 RID: 6132 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017F4")]
	[Address(RVA = "0xE71140", Offset = "0xE70140", VA = "0x180E71140")]
	private void SwitchPage(int pageOffset)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017F5 RID: 6133 RVA: 0x0003737C File Offset: 0x0003557C
	[Token(Token = "0x60017F5")]
	[Address(RVA = "0xE717D0", Offset = "0xE707D0", VA = "0x180E717D0")]
	private void UpdateDefaultHandler(UIHandlerBase handler)
	{
		this.navigator.SetDefaultHandler(handler);
	}

	// Token: 0x060017F6 RID: 6134 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017F6")]
	[Address(RVA = "0xE70D00", Offset = "0xE6FD00", VA = "0x180E70D00", Slot = "16")]
	public override void Submit()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017F7 RID: 6135 RVA: 0x0003739C File Offset: 0x0003559C
	[Token(Token = "0x60017F7")]
	[Address(RVA = "0xE6EF40", Offset = "0xE6DF40", VA = "0x180E6EF40")]
	private void ChangeKey(UIKeyBindingHandler handler)
	{
		if (!handler.isUnmodifiable)
		{
			CanvasGroup subCanvasGroup = this.subCanvasGroup;
			int num = 0;
			subCanvasGroup.blocksRaycasts = num != 0;
			this.newKeyBindingTip.SetActive(true);
			Game.DeactivatePlayerInput();
			if (!this.IsGamepad)
			{
				string name = handler.name;
				Action<bool, string> action = delegate(bool isEffectiveRebinding, string effectivePath)
				{
					CoroutineHandle coroutineHandle = Timing.RunCoroutine(this.OnRebindCompleted(isEffectiveRebinding, effectivePath));
				};
				Game.RunKeyboardRebindOperation(name, action);
			}
			string name2 = handler.name;
			Action<bool, string> action2 = delegate(bool isEffectiveRebinding, string effectivePath)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			};
			Game.RunGamepadRebindOperation(name2, action2);
			Game.PlayCanvasSE(UICanvasSFX.KeyBinding);
		}
	}

	// Token: 0x060017F8 RID: 6136 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017F8")]
	[Address(RVA = "0xE70170", Offset = "0xE6F170", VA = "0x180E70170")]
	private IEnumerator<float> OnRebindCompleted(bool isEffectiveRebinding, string effectivePath)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017F9 RID: 6137 RVA: 0x00037428 File Offset: 0x00035628
	[Token(Token = "0x60017F9")]
	[Address(RVA = "0xE6F6F0", Offset = "0xE6E6F0", VA = "0x180E6F6F0")]
	protected string GetInvalidBindingMsg(string effectivePath)
	{
		return Game.<UISystemText>k__BackingField.GetText(1100);
	}

	// Token: 0x060017FA RID: 6138 RVA: 0x0003744C File Offset: 0x0003564C
	[Token(Token = "0x60017FA")]
	[Address(RVA = "0xE709C0", Offset = "0xE6F9C0", VA = "0x180E709C0")]
	private void ShowInvalidBindingMsg(string msg)
	{
		UIMessageBox messageBox;
		MessageBoxConfig messageBoxConfig;
		MessageBoxHandlerData[] array;
		MessageBoxHandlerData messageBoxHandlerData;
		do
		{
			base.HideBaseCanvasGroup();
			if (Game.GetUIStackingManager().defaultCmdType != UIStackingManager.UIStackingCommand.Close)
			{
				Game.GetUIStackingManager().currentCmdType = (UIStackingManager.UIStackingCommand)((ulong)1L);
			}
			messageBox = Game.GetMessageBox(MessageBoxStyle.SingleOption);
			int num;
			messageBoxConfig = new MessageBoxConfig(msg, num);
			num = 0;
			array = new MessageBoxHandlerData[1];
			string text = Game.<UISystemText>k__BackingField.GetText(13);
			Action action = new Action(messageBox.Close);
			UICanvasSFX uicanvasSFX;
			messageBoxHandlerData = new MessageBoxHandlerData(text, uicanvasSFX, action);
		}
		while (messageBoxHandlerData != 0 && messageBoxHandlerData == 0);
		array[0] = messageBoxHandlerData;
		MessageBoxConfig messageBoxConfig2 = messageBoxConfig.BindHandlerData(array);
		Action action2 = delegate
		{
			base.AppearBaseCanvasGroup();
			Game.GetUIStackingManager().ResetDefaultCommand();
		};
		MessageBoxConfig messageBoxConfig3 = messageBoxConfig2.BindCloseEvent(action2);
		messageBox.OpenMsgBox(messageBoxConfig3);
	}

	// Token: 0x060017FB RID: 6139 RVA: 0x00037508 File Offset: 0x00035708
	[Token(Token = "0x60017FB")]
	[Address(RVA = "0xE70670", Offset = "0xE6F670", VA = "0x180E70670")]
	private void ResetKeyCodes()
	{
		Game.DeactivatePlayerInput();
		int num;
		UIKeyBindingBase.<ResetKeyboardKeyCodes>d__39 <ResetKeyboardKeyCodes>d__ = new UIKeyBindingBase.<ResetKeyboardKeyCodes>d__39(num);
		num = 0;
		<ResetKeyboardKeyCodes>d__.<>4__this = this;
		CoroutineHandle coroutineHandle = MECExtensionMethods1.RunCoroutine(<ResetKeyboardKeyCodes>d__);
	}

	// Token: 0x060017FC RID: 6140 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017FC")]
	[Address(RVA = "0xE70730", Offset = "0xE6F730", VA = "0x180E70730")]
	private IEnumerator<float> ResetKeyboardKeyCodes()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017FD RID: 6141 RVA: 0x0003753C File Offset: 0x0003573C
	[Token(Token = "0x60017FD")]
	[Address(RVA = "0xE6F120", Offset = "0xE6E120", VA = "0x180E6F120")]
	private Dictionary<string, int> CreateKeycodeTextMap()
	{
		Dictionary<string, int> dictionary = new Dictionary();
		throw new NullReferenceException();
	}

	// Token: 0x060017FE RID: 6142 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017FE")]
	[Address(RVA = "0xE707A0", Offset = "0xE6F7A0", VA = "0x180E707A0")]
	private void SetupKeyBindingInfo()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060017FF RID: 6143 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60017FF")]
	[Address(RVA = "0xE71800", Offset = "0xE70800", VA = "0x180E71800")]
	protected void UpdateTextAndFont(LocalizationData data)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001800 RID: 6144 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001800")]
	[Address(RVA = "0xE70590", Offset = "0xE6F590", VA = "0x180E70590")]
	private void PerformSubmitEffect()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001801 RID: 6145 RVA: 0x00037624 File Offset: 0x00035824
	[Token(Token = "0x6001801")]
	[Address(RVA = "0xE717F0", Offset = "0xE707F0", VA = "0x180E717F0", Slot = "21")]
	public override void UpdateDirtyCheckValue()
	{
		this.isDirty = false;
	}

	// Token: 0x06001802 RID: 6146 RVA: 0x00037638 File Offset: 0x00035838
	[Token(Token = "0x6001802")]
	[Address(RVA = "0x4E8C10", Offset = "0x4E7C10", VA = "0x1804E8C10", Slot = "19")]
	public override bool IsDirty()
	{
		return this.isDirty;
	}

	// Token: 0x06001803 RID: 6147 RVA: 0x0003764C File Offset: 0x0003584C
	[Token(Token = "0x6001803")]
	[Address(RVA = "0x41ED30", Offset = "0x41DD30", VA = "0x18041ED30")]
	protected UIKeyBindingBase()
	{
	}

	// Token: 0x04002328 RID: 9000
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4002328")]
	[SerializeField]
	protected int pageIndex;

	// Token: 0x04002329 RID: 9001
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4002329")]
	[SerializeField]
	protected string titleText;

	// Token: 0x0400232A RID: 9002
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x400232A")]
	[SerializeField]
	protected bool isDirty;

	// Token: 0x0400232B RID: 9003
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x400232B")]
	[SerializeField]
	protected GameObject newKeyBindingTip;

	// Token: 0x0400232C RID: 9004
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x400232C")]
	[SerializeField]
	protected UIKeyBindingPage[] pages;

	// Token: 0x0400232D RID: 9005
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x400232D")]
	[SerializeField]
	protected UILabelHandler defaultHandler;

	// Token: 0x0400232E RID: 9006
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x400232E")]
	[SerializeField]
	protected UILabelHandler backHandler;

	// Token: 0x0400232F RID: 9007
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x400232F")]
	[SerializeField]
	protected UINavigationEffect topNavigationEffect;

	// Token: 0x04002330 RID: 9008
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002330")]
	[SerializeField]
	protected UINavigationEffect bottomNavigationEffect;

	// Token: 0x04002331 RID: 9009
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002331")]
	[SerializeField]
	protected Image submissionEffect;

	// Token: 0x04002332 RID: 9010
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4002332")]
	[SerializeField]
	protected UISwitchPageTip switchPageTip;

	// Token: 0x04002333 RID: 9011
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4002333")]
	[SerializeField]
	protected UISwitchArrowController arrowController;

	// Token: 0x04002334 RID: 9012
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4002334")]
	[SerializeField]
	protected UIPageNumber pageNumber;

	// Token: 0x04002335 RID: 9013
	[Token(Token = "0x4002335")]
	private const int DEFAULT_HANDLER_INDEX = 900;

	// Token: 0x04002336 RID: 9014
	[Token(Token = "0x4002336")]
	private const int BACK_HANDLER_INDEX = 901;
}
