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

// Token: 0x0200024A RID: 586
[Token(Token = "0x200024A")]
public class UISettingsScreen : UIValueBindingBase
{
	// Token: 0x0600169B RID: 5787 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600169B")]
	[Address(RVA = "0x18A5AE0", Offset = "0x18A48E0", VA = "0x1818A5AE0", 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: 0x0600169C RID: 5788 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600169C")]
	[Address(RVA = "0x18A4FF0", Offset = "0x18A3DF0", VA = "0x1818A4FF0")]
	private UIValueBindingHandler[] GetActiveHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600169D RID: 5789 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600169D")]
	[Address(RVA = "0x18A5960", Offset = "0x18A4760", VA = "0x1818A5960")]
	private string[] GetResolutionContents()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600169E RID: 5790 RVA: 0x00035E20 File Offset: 0x00034020
	[Token(Token = "0x600169E")]
	[Address(RVA = "0x18A7280", Offset = "0x18A6080", VA = "0x1818A7280")]
	private void OnFullScreenValueChanged(int value)
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		bool flag = value == 1;
		screenSettings.fullScreen = flag;
		Game.UpdateResolutionSettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x0600169F RID: 5791 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600169F")]
	[Address(RVA = "0x18A73A0", Offset = "0x18A61A0", VA = "0x1818A73A0")]
	private void OnResolutionValueChanged(int value)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060016A0 RID: 5792 RVA: 0x00035E64 File Offset: 0x00034064
	[Token(Token = "0x60016A0")]
	[Address(RVA = "0x18A7430", Offset = "0x18A6230", VA = "0x1818A7430")]
	private void OnVSyncValueChanged(int value)
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		bool flag = value == 1;
		screenSettings.vSync = flag;
		Game.UpdateVSyncSettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
		this.UpdateFpsHandlerLockState();
	}

	// Token: 0x060016A1 RID: 5793 RVA: 0x00035EB0 File Offset: 0x000340B0
	[Token(Token = "0x60016A1")]
	[Address(RVA = "0x18A71F0", Offset = "0x18A5FF0", VA = "0x1818A71F0")]
	private void OnFpsValueChanged(int value)
	{
		Game.Config.screenSettings.fps = (FPSLimitation)value;
		Game.UpdateFPSSettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060016A2 RID: 5794 RVA: 0x00035EEC File Offset: 0x000340EC
	[Token(Token = "0x60016A2")]
	[Address(RVA = "0x18A7310", Offset = "0x18A6110", VA = "0x1818A7310")]
	private void OnQualityValueChanged(int value)
	{
		Game.Config.screenSettings.qualitySet = value;
		Game.UpdateQualitySettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060016A3 RID: 5795 RVA: 0x00035F28 File Offset: 0x00034128
	[Token(Token = "0x60016A3")]
	[Address(RVA = "0x18A7170", Offset = "0x18A5F70", VA = "0x1818A7170")]
	private void OnDofValueChanged(int value)
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		bool flag = value == 1;
		screenSettings.depthOfField = flag;
		Game.EmitScreenSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060016A4 RID: 5796 RVA: 0x00035F64 File Offset: 0x00034164
	[Token(Token = "0x60016A4")]
	[Address(RVA = "0x18A7070", Offset = "0x18A5E70", VA = "0x1818A7070")]
	private void OnBloomValueChanged(int value)
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		bool flag = value == 1;
		screenSettings.bloomEffect = flag;
		Game.EmitScreenSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060016A5 RID: 5797 RVA: 0x00035FA0 File Offset: 0x000341A0
	[Token(Token = "0x60016A5")]
	[Address(RVA = "0x18A70F0", Offset = "0x18A5EF0", VA = "0x1818A70F0")]
	private void OnBrightnessValueChanged(int value)
	{
		Game.Config.screenSettings.brightnessSet = value;
		Game.EmitScreenSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060016A6 RID: 5798 RVA: 0x00035FD4 File Offset: 0x000341D4
	[Token(Token = "0x60016A6")]
	[Address(RVA = "0x18A69F0", Offset = "0x18A57F0", VA = "0x1818A69F0", Slot = "20")]
	public override void Localize(LocalizationData data)
	{
		string text = data.systemText.GetText(91);
		this.titleText = text;
		UIValueBindingHandler[] topHandlers = this.topHandlers;
		GameTextData systemText = data.systemText;
		UIValueBindingHandler uivalueBindingHandler = topHandlers[0];
		string text2 = systemText.GetText(104);
		uivalueBindingHandler.UpdateLabelText(text2);
		UIValueBindingHandler[] topHandlers2 = this.topHandlers;
		GameTextData systemText2 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler2 = topHandlers2[1];
		string text3 = systemText2.GetText(105);
		uivalueBindingHandler2.UpdateLabelText(text3);
		UIValueBindingHandler[] topHandlers3 = this.topHandlers;
		GameTextData systemText3 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler3 = topHandlers3[2];
		string text4 = systemText3.GetText(108);
		uivalueBindingHandler3.UpdateLabelText(text4);
		UIValueBindingHandler[] topHandlers4 = this.topHandlers;
		GameTextData systemText4 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler4 = topHandlers4[3];
		string text5 = systemText4.GetText(120);
		uivalueBindingHandler4.UpdateLabelText(text5);
		UIValueBindingHandler[] topHandlers5 = this.topHandlers;
		GameTextData systemText5 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler5 = topHandlers5[4];
		string text6 = systemText5.GetText(106);
		uivalueBindingHandler5.UpdateLabelText(text6);
		UIValueBindingHandler[] topHandlers6 = this.topHandlers;
		GameTextData systemText6 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler6 = topHandlers6[5];
		string text7 = systemText6.GetText(107);
		uivalueBindingHandler6.UpdateLabelText(text7);
		UIValueBindingHandler[] topHandlers7 = this.topHandlers;
		GameTextData systemText7 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler7 = topHandlers7[6];
		string text8 = systemText7.GetText(103);
		uivalueBindingHandler7.UpdateLabelText(text8);
		UIValueBindingHandler[] topHandlers8 = this.topHandlers;
		GameTextData systemText8 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler8 = topHandlers8[7];
		string text9 = systemText8.GetText(96);
		uivalueBindingHandler8.UpdateLabelText(text9);
		UIValueBindingHandler[] topHandlers9 = this.topHandlers;
		GameTextData systemText9 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler9 = topHandlers9[0];
		string[] switchText = base.GetSwitchText(systemText9);
		uivalueBindingHandler9.UpdateValueText(switchText);
		UIValueBindingHandler[] topHandlers10 = this.topHandlers;
		GameTextData systemText10 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler10 = topHandlers10[2];
		string[] switchText2 = base.GetSwitchText(systemText10);
		uivalueBindingHandler10.UpdateValueText(switchText2);
		UIValueBindingHandler[] topHandlers11 = this.topHandlers;
		GameTextData systemText11 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler11 = topHandlers11[3];
		string[] fpsText = base.GetFpsText(systemText11);
		uivalueBindingHandler11.UpdateValueText(fpsText);
		UIValueBindingHandler[] topHandlers12 = this.topHandlers;
		GameTextData systemText12 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler12 = topHandlers12[3];
		string text10 = systemText12.GetText(331);
		uivalueBindingHandler12.UpdateLockText(text10);
		UIValueBindingHandler[] topHandlers13 = this.topHandlers;
		GameTextData systemText13 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler13 = topHandlers13[4];
		string[] qualityText = base.GetQualityText(systemText13);
		uivalueBindingHandler13.UpdateValueText(qualityText);
		UIValueBindingHandler[] topHandlers14 = this.topHandlers;
		GameTextData systemText14 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler14 = topHandlers14[5];
		string[] switchText3 = base.GetSwitchText(systemText14);
		uivalueBindingHandler14.UpdateValueText(switchText3);
		UIValueBindingHandler[] topHandlers15 = this.topHandlers;
		GameTextData systemText15 = data.systemText;
		UIValueBindingHandler uivalueBindingHandler15 = topHandlers15[6];
		string[] switchText4 = base.GetSwitchText(systemText15);
		uivalueBindingHandler15.UpdateValueText(switchText4);
		GameTextData systemText16 = data.systemText;
		UILabelHandler resetHandler = this.resetHandler;
		string text11 = systemText16.GetText(15);
		resetHandler.SetLabel(text11);
		GameTextData systemText17 = data.systemText;
		UILabelHandler backHandler = this.backHandler;
		string text12 = systemText17.GetText(12);
		backHandler.SetLabel(text12);
		UIValueBindingHandler[] topHandlers16 = this.topHandlers;
		int num = 0;
		int length = topHandlers16.Length;
		if (num < length)
		{
			UIValueBindingHandler uivalueBindingHandler16 = topHandlers16[num];
			GameFontPack fontPack = data.fontPack;
			uivalueBindingHandler16.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: 0x060016A7 RID: 5799 RVA: 0x00036370 File Offset: 0x00034570
	[Token(Token = "0x60016A7")]
	[Address(RVA = "0x18A5450", Offset = "0x18A4250", VA = "0x1818A5450", Slot = "23")]
	protected override ValueType[] GetConfigValues()
	{
		ValueType[] array;
		int brightnessSet;
		for (;;)
		{
			array = new ValueType[8];
			bool fullScreen = Game.Config.screenSettings.fullScreen;
			if (!fullScreen || fullScreen)
			{
				array[0] = fullScreen;
				int resolutionSet = Game.Config.screenSettings.resolutionSet;
				if (resolutionSet == 0 || resolutionSet != 0)
				{
					array[1] = resolutionSet;
					bool vSync = Game.Config.screenSettings.vSync;
					if (!vSync || vSync)
					{
						array[2] = vSync;
						FPSLimitation fps = Game.Config.screenSettings.fps;
						if (fps == FPSLimitation.FPS30 || fps != FPSLimitation.FPS30)
						{
							array[3] = fps;
							int qualitySet = Game.Config.screenSettings.qualitySet;
							if (qualitySet == 0 || qualitySet != 0)
							{
								array[4] = qualitySet;
								bool flag = Game.Config.screenSettings.depthOfField;
								if (!flag || flag)
								{
									array[5] = flag;
									bool bloomEffect = Game.Config.screenSettings.bloomEffect;
									flag = bloomEffect;
									if (!bloomEffect || bloomEffect)
									{
										array[6] = flag;
										brightnessSet = Game.Config.screenSettings.brightnessSet;
										if (brightnessSet == 0 || brightnessSet != 0)
										{
											break;
										}
									}
								}
							}
						}
					}
				}
			}
		}
		array[7] = brightnessSet;
		return array;
	}

	// Token: 0x060016A8 RID: 5800 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60016A8")]
	[Address(RVA = "0x18A76F0", Offset = "0x18A64F0", VA = "0x1818A76F0", Slot = "24")]
	protected override void UpdateTopHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060016A9 RID: 5801 RVA: 0x000364D0 File Offset: 0x000346D0
	[Token(Token = "0x60016A9")]
	[Address(RVA = "0x18A7570", Offset = "0x18A6370", VA = "0x1818A7570")]
	private void UpdateFpsHandlerLockState()
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		UIValueBindingHandler[] topHandlers = this.topHandlers;
		if (!screenSettings.vSync)
		{
			topHandlers[3].UnLock();
			return;
		}
		UIValueBindingHandler uivalueBindingHandler = topHandlers[3];
		string text = Game.<UISystemText>k__BackingField.GetText(331);
		uivalueBindingHandler.Lock(text);
	}

	// Token: 0x060016AA RID: 5802 RVA: 0x00036530 File Offset: 0x00034730
	[Token(Token = "0x60016AA")]
	[Address(RVA = "0x18A74E0", Offset = "0x18A62E0", VA = "0x1818A74E0", Slot = "25")]
	protected override void SetDefault()
	{
		Game.UpdateVSyncSettings(Game.Config.screenSettings.SetDefault());
		Game.EmitScreenSettingChangedEvent();
		FieldAttributes attributes = base.Attributes;
	}

	// Token: 0x060016AB RID: 5803 RVA: 0x00036568 File Offset: 0x00034768
	[Token(Token = "0x60016AB")]
	[Address(RVA = "0x384B20", Offset = "0x383920", VA = "0x180384B20")]
	public UISettingsScreen()
	{
	}
}
