using System;
using Cpp2IlInjected;
using MarsSDK;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x02000246 RID: 582
[Token(Token = "0x2000246")]
public class UISettingsGame : UIValueBindingBase
{
	// Token: 0x0600167C RID: 5756 RVA: 0x000353B0 File Offset: 0x000335B0
	[Token(Token = "0x600167C")]
	[Address(RVA = "0x18A3150", Offset = "0x18A1F50", VA = "0x1818A3150", Slot = "11")]
	public override void Init(CanvasGroup mainCanvasGroup, Action cancelHandler, Text title)
	{
		UIValueBindingHandler uivalueBindingHandler6;
		Action<int> action6;
		string[] array5;
		for (;;)
		{
			base.Init(mainCanvasGroup, cancelHandler, title);
			GameLanguage[] languages = Game.Arguments.Languages;
			this.gameLanguages = languages;
			UIValueBindingHandler uivalueBindingHandler = this.topHandlers[0];
			Action<int> action = new Action(this.OnCameraShakeValueChanged);
			string[] array = new string[6];
			if ("0" == 0 || array != 0)
			{
				array[0] = "0";
				if ("1" == 0 || "1" != 0)
				{
					array[1] = "1";
					if ("2" == 0 || "2" != 0)
					{
						array[2] = "2";
						if ("3" == 0 || "3" != 0)
						{
							array[3] = "3";
							if ("4" == 0 || "4" != 0)
							{
								array[4] = "4";
								if ("5" == 0 || "5" != 0)
								{
									array[5] = "5";
									uivalueBindingHandler.Init(action, array);
									UIValueBindingHandler uivalueBindingHandler2 = this.topHandlers[1];
									Action<int> action2 = new Action(this.OnHitStopValueChanged);
									string[] array2 = new string[2];
									if ("OFF" == 0 || array2 != 0)
									{
										array2[0] = "OFF";
										if ("ON" == 0 || "ON" != 0)
										{
											array2[1] = "ON";
											uivalueBindingHandler2.Init(action2, array2);
											UIValueBindingHandler uivalueBindingHandler3 = this.topHandlers[2];
											Action<int> action3 = new Action(this.OnVibrationValueChanged);
											string[] array3 = new string[2];
											if ("OFF" == 0 || array3 != 0)
											{
												array3[0] = "OFF";
												if ("ON" == 0 || "ON" != 0)
												{
													array3[1] = "ON";
													uivalueBindingHandler3.Init(action3, array3);
													UIValueBindingHandler uivalueBindingHandler4 = this.topHandlers[3];
													Action<int> action4 = new Action(this.OnLanguageValueChanged);
													string[] languageText = Game.GetLanguageText(this.gameLanguages);
													uivalueBindingHandler4.Init(action4, languageText);
													UIValueBindingHandler uivalueBindingHandler5 = this.topHandlers[4];
													Action<int> action5 = new Action(this.OnDashModeValueChanged);
													string[] array4 = new string[2];
													if ("Toggle" == 0 || array4 != 0)
													{
														array4[0] = "Toggle";
														if ("Hold" == 0 || "Hold" != 0)
														{
															array4[1] = "Hold";
															uivalueBindingHandler5.Init(action5, array4);
															uivalueBindingHandler6 = this.topHandlers[5];
															action6 = new Action(this.OnDifficultyValueChanged);
															array5 = new string[2];
															if ("Standard Mode" == 0 || array5 != 0)
															{
																array5[0] = "Standard Mode";
																if ("Advance Mode" == 0 || "Advance Mode" != 0)
																{
																	break;
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		array5[1] = "Advance Mode";
		uivalueBindingHandler6.Init(action6, array5);
		UIValueBindingHandler[] topHandlers = this.topHandlers;
		base.InitHandlers(topHandlers);
	}

	// Token: 0x0600167D RID: 5757 RVA: 0x000356B8 File Offset: 0x000338B8
	[Token(Token = "0x600167D")]
	[Address(RVA = "0x18A45D0", Offset = "0x18A33D0", VA = "0x1818A45D0", Slot = "12")]
	public override void Open()
	{
		SceneManager sceneManager = Game.sceneManager;
		int num = 0;
		bool flag = sceneManager != num;
		this.EnableDifficultyHandler(flag);
		base.Open();
	}

	// Token: 0x0600167E RID: 5758 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600167E")]
	[Address(RVA = "0x18A2A80", Offset = "0x18A1880", VA = "0x1818A2A80")]
	private void EnableDifficultyHandler(bool enable)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600167F RID: 5759 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600167F")]
	[Address(RVA = "0x18A4120", Offset = "0x18A2F20", VA = "0x1818A4120", Slot = "13")]
	public override void Move(Direction2D direction)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001680 RID: 5760 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001680")]
	[Address(RVA = "0x18A4760", Offset = "0x18A3560", VA = "0x1818A4760")]
	private void SwitchHandlerValue(int index, Direction2D direction)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001681 RID: 5761 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001681")]
	[Address(RVA = "0x18A25C0", Offset = "0x18A13C0", VA = "0x1818A25C0")]
	private void ConfirmDifficultyModification(Direction2D direction)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001682 RID: 5762 RVA: 0x000356E4 File Offset: 0x000338E4
	[Token(Token = "0x6001682")]
	[Address(RVA = "0x18A4190", Offset = "0x18A2F90", VA = "0x1818A4190")]
	private void OnCameraShakeValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		int num = 0;
		int num2 = Mathf.Clamp(value, num, 5);
		gameSettings.cameraShake = num2;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x06001683 RID: 5763 RVA: 0x00035724 File Offset: 0x00033924
	[Token(Token = "0x6001683")]
	[Address(RVA = "0x18A4430", Offset = "0x18A3230", VA = "0x1818A4430")]
	private void OnHitStopValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		bool flag = value == 1;
		gameSettings.hitStop = flag;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x06001684 RID: 5764 RVA: 0x00035760 File Offset: 0x00033960
	[Token(Token = "0x6001684")]
	[Address(RVA = "0x18A4550", Offset = "0x18A3350", VA = "0x1818A4550")]
	private void OnVibrationValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		bool flag = value == 1;
		gameSettings.gamepadVibration = flag;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x06001685 RID: 5765 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001685")]
	[Address(RVA = "0x18A44B0", Offset = "0x18A32B0", VA = "0x1818A44B0")]
	private void OnLanguageValueChanged(int value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001686 RID: 5766 RVA: 0x0003579C File Offset: 0x0003399C
	[Token(Token = "0x6001686")]
	[Address(RVA = "0x18A4220", Offset = "0x18A3020", VA = "0x1818A4220")]
	private void OnDashModeValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		bool flag = value == 1;
		gameSettings.holdDashing = flag;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x06001687 RID: 5767 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001687")]
	[Address(RVA = "0x18A42A0", Offset = "0x18A30A0", VA = "0x1818A42A0")]
	private void OnDifficultyValueChanged(int value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001688 RID: 5768 RVA: 0x000357D8 File Offset: 0x000339D8
	[Token(Token = "0x6001688")]
	[Address(RVA = "0x18A3BD0", Offset = "0x18A29D0", VA = "0x1818A3BD0", Slot = "20")]
	public override void Localize(LocalizationData data)
	{
		string text = data.systemText.GetText(90);
		this.titleText = text;
		Text title = this.title;
		string titleText = this.titleText;
		title.text = titleText;
		UIValueBindingHandler[] topHandlers = this.topHandlers;
		GameTextData systemText = data.systemText;
		UIValueBindingHandler uivalueBindingHandler = topHandlers[0];
		string text2 = systemText.GetText(98);
		uivalueBindingHandler.UpdateLabelText(text2);
		UIValueBindingHandler[] topHandlers2 = this.topHandlers;
		GameTextData systemText2 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler2 = topHandlers2[1];
		string text3 = systemText2.GetText(99);
		uivalueBindingHandler2.UpdateLabelText(text3);
		UIValueBindingHandler[] topHandlers3 = this.topHandlers;
		GameTextData systemText3 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler3 = topHandlers3[2];
		string text4 = systemText3.GetText(100);
		uivalueBindingHandler3.UpdateLabelText(text4);
		UIValueBindingHandler[] topHandlers4 = this.topHandlers;
		GameTextData systemText4 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler4 = topHandlers4[3];
		string text5 = systemText4.GetText(323);
		uivalueBindingHandler4.UpdateLabelText(text5);
		UIValueBindingHandler[] topHandlers5 = this.topHandlers;
		GameTextData systemText5 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler5 = topHandlers5[4];
		string text6 = systemText5.GetText(137);
		uivalueBindingHandler5.UpdateLabelText(text6);
		UIValueBindingHandler[] topHandlers6 = this.topHandlers;
		GameTextData systemText6 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler6 = topHandlers6[5];
		string text7 = systemText6.GetText(168);
		uivalueBindingHandler6.UpdateLabelText(text7);
		UIValueBindingHandler[] topHandlers7 = this.topHandlers;
		GameTextData systemText7 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler7 = topHandlers7[1];
		string[] switchText = base.GetSwitchText(systemText7);
		uivalueBindingHandler7.UpdateValueText(switchText);
		UIValueBindingHandler[] topHandlers8 = this.topHandlers;
		GameTextData systemText8 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler8 = topHandlers8[2];
		string[] switchText2 = base.GetSwitchText(systemText8);
		uivalueBindingHandler8.UpdateValueText(switchText2);
		UIValueBindingHandler[] topHandlers9 = this.topHandlers;
		GameTextData systemText9 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler9 = topHandlers9[4];
		string[] dashMethodText = base.GetDashMethodText(systemText9);
		uivalueBindingHandler9.UpdateValueText(dashMethodText);
		UIValueBindingHandler[] topHandlers10 = this.topHandlers;
		GameTextData systemText10 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler10 = topHandlers10[5];
		string[] difficultyText = base.GetDifficultyText(systemText10);
		uivalueBindingHandler10.UpdateValueText(difficultyText);
		UIValueBindingHandler[] topHandlers11 = this.topHandlers;
		GameTextData systemText11 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler11 = topHandlers11[5];
		string text8 = systemText11.GetText(27);
		uivalueBindingHandler11.UpdateLockText(text8);
		GameTextData systemText12 = data.systemText;
		UILabelHandler resetHandler = this.resetHandler;
		string text9 = systemText12.GetText(15);
		resetHandler.SetLabel(text9);
		GameTextData systemText13 = data.systemText;
		UILabelHandler backHandler = this.backHandler;
		string text10 = systemText13.GetText(12);
		backHandler.SetLabel(text10);
		UIValueBindingHandler[] topHandlers12 = this.topHandlers;
		int num = 0;
		int length = topHandlers12.Length;
		if (num < length)
		{
			UIValueBindingHandler uivalueBindingHandler12 = topHandlers12[num];
			GameFontPack fontPack = data.fontPack;
			uivalueBindingHandler12.UpdateFont(fontPack);
			num++;
		}
		GameFontPack fontPack2 = data.fontPack;
		UILabelHandler resetHandler2 = this.resetHandler;
		Font medium = fontPack2.medium;
		resetHandler2.SetFont(medium);
		GameFontPack fontPack3 = data.fontPack;
		UILabelHandler backHandler2 = this.backHandler;
		Font medium2 = fontPack3.medium;
		backHandler2.SetFont(medium2);
	}

	// Token: 0x06001689 RID: 5769 RVA: 0x00035ADC File Offset: 0x00033CDC
	[Token(Token = "0x6001689")]
	[Address(RVA = "0x18A2D10", Offset = "0x18A1B10", VA = "0x1818A2D10", Slot = "23")]
	protected override ValueType[] GetConfigValues()
	{
		ValueType[] array;
		bool holdDashing;
		for (;;)
		{
			array = new ValueType[5];
			int cameraShake = Game.Config.gameSettings.cameraShake;
			if (cameraShake == 0 || cameraShake != 0)
			{
				array[0] = cameraShake;
				bool flag = Game.Config.gameSettings.hitStop;
				if (!flag || flag)
				{
					array[1] = flag;
					bool gamepadVibration = Game.Config.gameSettings.gamepadVibration;
					flag = gamepadVibration;
					if (!gamepadVibration || gamepadVibration)
					{
						array[2] = flag;
						GameLanguage language = Game.Config.gameSettings.language;
						if (language == GameLanguage.ChineseTraditional || language != GameLanguage.ChineseTraditional)
						{
							array[3] = language;
							holdDashing = Game.Config.gameSettings.holdDashing;
							if (!holdDashing || holdDashing)
							{
								break;
							}
						}
					}
				}
			}
		}
		array[4] = holdDashing;
		return array;
	}

	// Token: 0x0600168A RID: 5770 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600168A")]
	[Address(RVA = "0x18A4770", Offset = "0x18A3570", VA = "0x1818A4770", Slot = "24")]
	protected override void UpdateTopHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600168B RID: 5771 RVA: 0x00035BC0 File Offset: 0x00033DC0
	[Token(Token = "0x600168B")]
	[Address(RVA = "0x18A3080", Offset = "0x18A1E80", VA = "0x1818A3080")]
	private int GetLanguageIndex()
	{
		GameLanguage[] array = this.gameLanguages;
		int num = 0;
		if (num < array.Length)
		{
			GameLanguage gameLanguage = array[num];
			GameLanguage language = Game.Language;
			if (gameLanguage != language)
			{
				GameLanguage[] array2 = this.gameLanguages;
				num++;
			}
			return num;
		}
		return 0;
	}

	// Token: 0x0600168C RID: 5772 RVA: 0x00035C0C File Offset: 0x00033E0C
	[Token(Token = "0x600168C")]
	[Address(RVA = "0x18A46D0", Offset = "0x18A34D0", VA = "0x1818A46D0", Slot = "25")]
	protected override void SetDefault()
	{
		GameSettings gameSettings = Game.Config.gameSettings.SetDefault();
		Game.EmitGameSettingChangedEvent();
		((IUIController)this).SwitchLeftward();
	}

	// Token: 0x0600168D RID: 5773 RVA: 0x00035C40 File Offset: 0x00033E40
	[Token(Token = "0x600168D")]
	[Address(RVA = "0x384B20", Offset = "0x383920", VA = "0x180384B20")]
	public UISettingsGame()
	{
	}

	// Token: 0x04002123 RID: 8483
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002123")]
	private GameLanguage[] gameLanguages;
}
