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

// Token: 0x02000239 RID: 569
[Token(Token = "0x2000239")]
public abstract class UIKeyBindingBase : UISubSettingsBase
{
	// Token: 0x170000D9 RID: 217
	// (get) Token: 0x060015C6 RID: 5574
	[Token(Token = "0x170000D9")]
	protected abstract bool IsGamepad
	{
		[Token(Token = "0x60015C6")]
		[Address(Slot = "22")]
		get;
	}

	// Token: 0x060015C7 RID: 5575 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015C7")]
	[Address(RVA = "0x1016D20", Offset = "0x1015B20", VA = "0x181016D20", 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: 0x060015C8 RID: 5576 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015C8")]
	[Address(RVA = "0x1016A40", Offset = "0x1015840", VA = "0x181016A40")]
	private void InitPages()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015C9 RID: 5577 RVA: 0x00031FB4 File Offset: 0x000301B4
	[Token(Token = "0x60015C9")]
	[Address(RVA = "0x1016630", Offset = "0x1015430", VA = "0x181016630")]
	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: 0x060015CA RID: 5578 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015CA")]
	[Address(RVA = "0x10168B0", Offset = "0x10156B0", VA = "0x1810168B0")]
	private void InitEffects()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015CB RID: 5579 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015CB")]
	[Address(RVA = "0x1017200", Offset = "0x1016000", VA = "0x181017200", Slot = "12")]
	public override void Open()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015CC RID: 5580 RVA: 0x00032098 File Offset: 0x00030298
	[Token(Token = "0x60015CC")]
	[Address(RVA = "0x1016EE0", Offset = "0x1015CE0", VA = "0x181016EE0", Slot = "13")]
	public override void Move(Direction2D direction)
	{
		this.navigator.Move(direction);
	}

	// Token: 0x060015CD RID: 5581 RVA: 0x000320B8 File Offset: 0x000302B8
	[Token(Token = "0x60015CD")]
	[Address(RVA = "0x10170E0", Offset = "0x1015EE0", VA = "0x1810170E0")]
	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: 0x060015CE RID: 5582 RVA: 0x00032130 File Offset: 0x00030330
	[Token(Token = "0x60015CE")]
	[Address(RVA = "0x10170C0", Offset = "0x1015EC0", VA = "0x1810170C0")]
	private void OnTopHandlerDeselected(UIHandlerBase handler)
	{
		this.topNavigationEffect.Hide();
	}

	// Token: 0x060015CF RID: 5583 RVA: 0x00032150 File Offset: 0x00030350
	[Token(Token = "0x60015CF")]
	[Address(RVA = "0x1016F30", Offset = "0x1015D30", VA = "0x181016F30")]
	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: 0x060015D0 RID: 5584 RVA: 0x000321BC File Offset: 0x000303BC
	[Token(Token = "0x60015D0")]
	[Address(RVA = "0x1016F00", Offset = "0x1015D00", VA = "0x181016F00")]
	private void OnBottomHandlerDeselected(UIHandlerBase handler)
	{
		this.bottomNavigationEffect.Hide();
	}

	// Token: 0x060015D1 RID: 5585 RVA: 0x000321DC File Offset: 0x000303DC
	[Token(Token = "0x60015D1")]
	[Address(RVA = "0x1017FC0", Offset = "0x1016DC0", VA = "0x181017FC0", Slot = "14")]
	public override void SwitchLeftward()
	{
		this.arrowController.SwitchPageLeftward();
	}

	// Token: 0x060015D2 RID: 5586 RVA: 0x000321FC File Offset: 0x000303FC
	[Token(Token = "0x60015D2")]
	[Address(RVA = "0x1018490", Offset = "0x1017290", VA = "0x181018490")]
	private int TrySwitchLeftward()
	{
		if (this.pageIndex != 0)
		{
			this.SwitchPage(-1);
			return this.pageIndex;
		}
		return -1;
	}

	// Token: 0x060015D3 RID: 5587 RVA: 0x00032224 File Offset: 0x00030424
	[Token(Token = "0x60015D3")]
	[Address(RVA = "0x1018460", Offset = "0x1017260", VA = "0x181018460", Slot = "15")]
	public override void SwitchRightward()
	{
		this.arrowController.SwitchPageRightward();
	}

	// Token: 0x060015D4 RID: 5588 RVA: 0x00032244 File Offset: 0x00030444
	[Token(Token = "0x60015D4")]
	[Address(RVA = "0x10184C0", Offset = "0x10172C0", VA = "0x1810184C0")]
	private int TrySwitchRightward()
	{
		int length = this.pages.Length;
		if (this.pageIndex != length)
		{
			this.SwitchPage(1);
			return this.pageIndex;
		}
		return -1;
	}

	// Token: 0x060015D5 RID: 5589 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015D5")]
	[Address(RVA = "0x1017FF0", Offset = "0x1016DF0", VA = "0x181017FF0")]
	private void SwitchPage(int pageOffset)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015D6 RID: 5590 RVA: 0x0003227C File Offset: 0x0003047C
	[Token(Token = "0x60015D6")]
	[Address(RVA = "0x1018680", Offset = "0x1017480", VA = "0x181018680")]
	private void UpdateDefaultHandler(UIHandlerBase handler)
	{
		this.navigator.SetDefaultHandler(handler);
	}

	// Token: 0x060015D7 RID: 5591 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015D7")]
	[Address(RVA = "0x1017BB0", Offset = "0x10169B0", VA = "0x181017BB0", Slot = "16")]
	public override void Submit()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015D8 RID: 5592 RVA: 0x0003229C File Offset: 0x0003049C
	[Token(Token = "0x60015D8")]
	[Address(RVA = "0x1015DC0", Offset = "0x1014BC0", VA = "0x181015DC0")]
	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)
			{
				CoroutineHandle coroutineHandle2 = Timing.RunCoroutine(this.OnRebindCompleted(isEffectiveRebinding, effectivePath));
			};
			Game.RunGamepadRebindOperation(name2, action2);
			Game.PlayCanvasSE(UICanvasSFX.KeyBinding);
		}
	}

	// Token: 0x060015D9 RID: 5593 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015D9")]
	[Address(RVA = "0x1017020", Offset = "0x1015E20", VA = "0x181017020")]
	private IEnumerator<float> OnRebindCompleted(bool isEffectiveRebinding, string effectivePath)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015DA RID: 5594 RVA: 0x00032328 File Offset: 0x00030528
	[Token(Token = "0x60015DA")]
	[Address(RVA = "0x1016570", Offset = "0x1015370", VA = "0x181016570", Slot = "23")]
	protected virtual string GetInvalidBindingMsg(string effectivePath)
	{
		return Game.<UISystemText>k__BackingField.GetText(46);
	}

	// Token: 0x060015DB RID: 5595 RVA: 0x00032348 File Offset: 0x00030548
	[Token(Token = "0x60015DB")]
	[Address(RVA = "0x1017870", Offset = "0x1016670", VA = "0x181017870")]
	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: 0x060015DC RID: 5596 RVA: 0x00032404 File Offset: 0x00030604
	[Token(Token = "0x60015DC")]
	[Address(RVA = "0x1017520", Offset = "0x1016320", VA = "0x181017520")]
	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: 0x060015DD RID: 5597 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015DD")]
	[Address(RVA = "0x10175E0", Offset = "0x10163E0", VA = "0x1810175E0")]
	private IEnumerator<float> ResetKeyboardKeyCodes()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015DE RID: 5598 RVA: 0x00032438 File Offset: 0x00030638
	[Token(Token = "0x60015DE")]
	[Address(RVA = "0x1015FA0", Offset = "0x1014DA0", VA = "0x181015FA0")]
	private Dictionary<string, int> CreateKeycodeTextMap()
	{
		Dictionary<string, int> dictionary = new Dictionary();
		throw new NullReferenceException();
	}

	// Token: 0x060015DF RID: 5599 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015DF")]
	[Address(RVA = "0x1017650", Offset = "0x1016450", VA = "0x181017650")]
	private void SetupKeyBindingInfo()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015E0 RID: 5600 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015E0")]
	[Address(RVA = "0x10186B0", Offset = "0x10174B0", VA = "0x1810186B0")]
	protected void UpdateTextAndFont(LocalizationData data)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015E1 RID: 5601 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60015E1")]
	[Address(RVA = "0x1017440", Offset = "0x1016240", VA = "0x181017440")]
	private void PerformSubmitEffect()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060015E2 RID: 5602 RVA: 0x00032520 File Offset: 0x00030720
	[Token(Token = "0x60015E2")]
	[Address(RVA = "0x10186A0", Offset = "0x10174A0", VA = "0x1810186A0", Slot = "21")]
	public override void UpdateDirtyCheckValue()
	{
		this.isDirty = false;
	}

	// Token: 0x060015E3 RID: 5603 RVA: 0x00032534 File Offset: 0x00030734
	[Token(Token = "0x60015E3")]
	[Address(RVA = "0x4F8000", Offset = "0x4F6E00", VA = "0x1804F8000", Slot = "19")]
	public override bool IsDirty()
	{
		return this.isDirty;
	}

	// Token: 0x060015E4 RID: 5604 RVA: 0x00032548 File Offset: 0x00030748
	[Token(Token = "0x60015E4")]
	[Address(RVA = "0x3FBF80", Offset = "0x3FAD80", VA = "0x1803FBF80")]
	protected UIKeyBindingBase()
	{
	}

	// Token: 0x040020DB RID: 8411
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x40020DB")]
	[SerializeField]
	protected int pageIndex;

	// Token: 0x040020DC RID: 8412
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x40020DC")]
	[SerializeField]
	protected string titleText;

	// Token: 0x040020DD RID: 8413
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x40020DD")]
	[SerializeField]
	protected bool isDirty;

	// Token: 0x040020DE RID: 8414
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x40020DE")]
	[SerializeField]
	protected GameObject newKeyBindingTip;

	// Token: 0x040020DF RID: 8415
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x40020DF")]
	[SerializeField]
	protected UIKeyBindingPage[] pages;

	// Token: 0x040020E0 RID: 8416
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x40020E0")]
	[SerializeField]
	protected UILabelHandler defaultHandler;

	// Token: 0x040020E1 RID: 8417
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x40020E1")]
	[SerializeField]
	protected UILabelHandler backHandler;

	// Token: 0x040020E2 RID: 8418
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x40020E2")]
	[SerializeField]
	protected UINavigationEffect topNavigationEffect;

	// Token: 0x040020E3 RID: 8419
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x40020E3")]
	[SerializeField]
	protected UINavigationEffect bottomNavigationEffect;

	// Token: 0x040020E4 RID: 8420
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x40020E4")]
	[SerializeField]
	protected Image submissionEffect;

	// Token: 0x040020E5 RID: 8421
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x40020E5")]
	[SerializeField]
	protected UISwitchPageTip switchPageTip;

	// Token: 0x040020E6 RID: 8422
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x40020E6")]
	[SerializeField]
	protected UISwitchArrowController arrowController;

	// Token: 0x040020E7 RID: 8423
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x40020E7")]
	[SerializeField]
	protected UIPageNumber pageNumber;

	// Token: 0x040020E8 RID: 8424
	[Token(Token = "0x40020E8")]
	private const int DEFAULT_HANDLER_INDEX = 900;

	// Token: 0x040020E9 RID: 8425
	[Token(Token = "0x40020E9")]
	private const int BACK_HANDLER_INDEX = 901;
}
