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

// Token: 0x02000290 RID: 656
[Token(Token = "0x2000290")]
public class UISettingsGame : UIValueBindingBase
{
	// Token: 0x0600189C RID: 6300 RVA: 0x0003A4C8 File Offset: 0x000386C8
	[Token(Token = "0x600189C")]
	[Address(RVA = "0x955E60", Offset = "0x954E60", VA = "0x180955E60", 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[4];
															if ("Standard Mode" == 0 || array5 != 0)
															{
																array5[0] = "Standard Mode";
																if ("Advance Mode" == 0 || "Advance Mode" != 0)
																{
																	array5[1] = "Advance Mode";
																	if ("Hard Mode" == 0 || "Hard Mode" != 0)
																	{
																		array5[2] = "Hard Mode";
																		if ("Boss Rush Mode" == 0 || "Boss Rush Mode" != 0)
																		{
																			break;
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		array5[3] = "Boss Rush Mode";
		uivalueBindingHandler6.Init(action6, array5);
		UIValueBindingHandler[] topHandlers = this.topHandlers;
		base.InitHandlers(topHandlers);
	}

	// Token: 0x0600189D RID: 6301 RVA: 0x0003A810 File Offset: 0x00038A10
	[Token(Token = "0x600189D")]
	[Address(RVA = "0x957800", Offset = "0x956800", VA = "0x180957800", Slot = "12")]
	public override void Open()
	{
		SceneManager sceneManager = Game.sceneManager;
		int num = 0;
		if (!(sceneManager != num))
		{
		}
		bool flag = Game.GameSave.basic.difficulty != GameDifficulty.BossRush;
		this.EnableDifficultyHandler(flag);
		base.Open();
	}

	// Token: 0x0600189E RID: 6302 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600189E")]
	[Address(RVA = "0x955790", Offset = "0x954790", VA = "0x180955790")]
	private void EnableDifficultyHandler(bool enable)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600189F RID: 6303 RVA: 0x0003A85C File Offset: 0x00038A5C
	[Token(Token = "0x600189F")]
	[Address(RVA = "0x956F10", Offset = "0x955F10", VA = "0x180956F10")]
	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: 0x060018A0 RID: 6304 RVA: 0x0003A89C File Offset: 0x00038A9C
	[Token(Token = "0x60018A0")]
	[Address(RVA = "0x957660", Offset = "0x956660", VA = "0x180957660")]
	private void OnHitStopValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		bool flag = value == 1;
		gameSettings.hitStop = flag;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018A1 RID: 6305 RVA: 0x0003A8D8 File Offset: 0x00038AD8
	[Token(Token = "0x60018A1")]
	[Address(RVA = "0x957780", Offset = "0x956780", VA = "0x180957780")]
	private void OnVibrationValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		bool flag = value == 1;
		gameSettings.gamepadVibration = flag;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018A2 RID: 6306 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018A2")]
	[Address(RVA = "0x9576E0", Offset = "0x9566E0", VA = "0x1809576E0")]
	private void OnLanguageValueChanged(int value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060018A3 RID: 6307 RVA: 0x0003A914 File Offset: 0x00038B14
	[Token(Token = "0x60018A3")]
	[Address(RVA = "0x956FA0", Offset = "0x955FA0", VA = "0x180956FA0")]
	private void OnDashModeValueChanged(int value)
	{
		GameSettings gameSettings = Game.Config.gameSettings;
		bool flag = value == 1;
		gameSettings.holdDashing = flag;
		Game.EmitGameSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018A4 RID: 6308 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018A4")]
	[Address(RVA = "0x957020", Offset = "0x956020", VA = "0x180957020")]
	private void OnDifficultyValueChanged(int value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060018A5 RID: 6309 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018A5")]
	[Address(RVA = "0x9555B0", Offset = "0x9545B0", VA = "0x1809555B0")]
	private void ChangeDifficulty(int value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060018A6 RID: 6310 RVA: 0x0003A950 File Offset: 0x00038B50
	[Token(Token = "0x60018A6")]
	[Address(RVA = "0x9569C0", Offset = "0x9559C0", VA = "0x1809569C0", 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: 0x060018A7 RID: 6311 RVA: 0x0003AC54 File Offset: 0x00038E54
	[Token(Token = "0x60018A7")]
	[Address(RVA = "0x955A20", Offset = "0x954A20", VA = "0x180955A20", 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: 0x060018A8 RID: 6312 RVA: 0x0003AD38 File Offset: 0x00038F38
	[Token(Token = "0x60018A8")]
	[Address(RVA = "0x9579E0", Offset = "0x9569E0", VA = "0x1809579E0", Slot = "24")]
	protected override void UpdateTopHandlers()
	{
		UIValueBindingHandler uivalueBindingHandler = this.topHandlers[0];
		int cameraShake = Game.Config.gameSettings.cameraShake;
		uivalueBindingHandler.UpdatePointer(cameraShake);
		UIValueBindingHandler uivalueBindingHandler2 = this.topHandlers[1];
		GameSettings gameSettings = Game.Config.gameSettings;
		int num = 0;
		bool flag = (gameSettings.hitStop ? 1 : 0) != num;
		uivalueBindingHandler2.UpdatePointer(flag ? 1 : 0);
		UIValueBindingHandler uivalueBindingHandler3 = this.topHandlers[2];
		bool flag2 = (Game.Config.gameSettings.gamepadVibration ? 1 : 0) != num;
		uivalueBindingHandler3.UpdatePointer(flag2 ? 1 : 0);
		UIValueBindingHandler uivalueBindingHandler4 = this.topHandlers[3];
		GameLanguage[] array = this.gameLanguages;
		if (num < array.Length)
		{
			GameLanguage gameLanguage = array[num];
			GameLanguage language = Game.Language;
			if (gameLanguage != language)
			{
				GameLanguage[] array2 = this.gameLanguages;
				num++;
			}
		}
		uivalueBindingHandler4.UpdatePointer(num);
		UIValueBindingHandler uivalueBindingHandler5 = this.topHandlers[4];
		bool flag3 = (Game.Config.gameSettings.holdDashing ? 1 : 0) != num;
		uivalueBindingHandler5.UpdatePointer(flag3 ? 1 : 0);
		GameDifficulty difficulty = Game.GameSave.basic.difficulty;
		UIValueBindingHandler uivalueBindingHandler6 = this.topHandlers[5];
		int num2 = (int)difficulty;
		uivalueBindingHandler6.UpdatePointer(num2);
		UIValueBindingHandler[] topHandlers = this.topHandlers;
		if (difficulty != GameDifficulty.Standard)
		{
			topHandlers[5].UnLock();
			return;
		}
		topHandlers[5].Lock();
		throw new IndexOutOfRangeException();
	}

	// Token: 0x060018A9 RID: 6313 RVA: 0x0003AEB8 File Offset: 0x000390B8
	[Token(Token = "0x60018A9")]
	[Address(RVA = "0x955D90", Offset = "0x954D90", VA = "0x180955D90")]
	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: 0x060018AA RID: 6314 RVA: 0x0003AF04 File Offset: 0x00039104
	[Token(Token = "0x60018AA")]
	[Address(RVA = "0x957950", Offset = "0x956950", VA = "0x180957950", Slot = "25")]
	protected override void SetDefault()
	{
		GameSettings gameSettings = Game.Config.gameSettings.SetDefault();
		Game.EmitGameSettingChangedEvent();
		DateTime valueAsDateTime = base.ValueAsDateTime;
	}

	// Token: 0x060018AB RID: 6315 RVA: 0x0003AF38 File Offset: 0x00039138
	[Token(Token = "0x60018AB")]
	[Address(RVA = "0x3ED6F0", Offset = "0x3EC6F0", VA = "0x1803ED6F0")]
	public UISettingsGame()
	{
	}

	// Token: 0x04002370 RID: 9072
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002370")]
	private GameLanguage[] gameLanguages;
}
