using System;
using Cpp2IlInjected;
using Newtonsoft.Json.Converters;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x02000294 RID: 660
[Token(Token = "0x2000294")]
public class UISettingsScreen : UIValueBindingBase
{
	// Token: 0x060018B8 RID: 6328 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018B8")]
	[Address(RVA = "0x958DC0", Offset = "0x957DC0", VA = "0x180958DC0", 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: 0x060018B9 RID: 6329 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018B9")]
	[Address(RVA = "0x9582D0", Offset = "0x9572D0", VA = "0x1809582D0")]
	private UIValueBindingHandler[] GetActiveHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060018BA RID: 6330 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018BA")]
	[Address(RVA = "0x958C40", Offset = "0x957C40", VA = "0x180958C40")]
	private string[] GetResolutionContents()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060018BB RID: 6331 RVA: 0x0003B0F8 File Offset: 0x000392F8
	[Token(Token = "0x60018BB")]
	[Address(RVA = "0x95A560", Offset = "0x959560", VA = "0x18095A560")]
	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: 0x060018BC RID: 6332 RVA: 0x0003B13C File Offset: 0x0003933C
	[Token(Token = "0x60018BC")]
	[Address(RVA = "0x95A680", Offset = "0x959680", VA = "0x18095A680")]
	private void OnResolutionValueChanged(int value)
	{
		Game.Config.screenSettings.resolutionSet = value;
		Game.UpdateResolutionSettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018BD RID: 6333 RVA: 0x0003B178 File Offset: 0x00039378
	[Token(Token = "0x60018BD")]
	[Address(RVA = "0x95A710", Offset = "0x959710", VA = "0x18095A710")]
	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: 0x060018BE RID: 6334 RVA: 0x0003B1C4 File Offset: 0x000393C4
	[Token(Token = "0x60018BE")]
	[Address(RVA = "0x95A4D0", Offset = "0x9594D0", VA = "0x18095A4D0")]
	private void OnFpsValueChanged(int value)
	{
		Game.Config.screenSettings.fps = (FPSLimitation)value;
		Game.UpdateFPSSettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018BF RID: 6335 RVA: 0x0003B200 File Offset: 0x00039400
	[Token(Token = "0x60018BF")]
	[Address(RVA = "0x95A5F0", Offset = "0x9595F0", VA = "0x18095A5F0")]
	private void OnQualityValueChanged(int value)
	{
		Game.Config.screenSettings.qualitySet = value;
		Game.UpdateQualitySettings(Game.Config.screenSettings);
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018C0 RID: 6336 RVA: 0x0003B23C File Offset: 0x0003943C
	[Token(Token = "0x60018C0")]
	[Address(RVA = "0x95A450", Offset = "0x959450", VA = "0x18095A450")]
	private void OnDofValueChanged(int value)
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		bool flag = value == 1;
		screenSettings.depthOfField = flag;
		Game.EmitScreenSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018C1 RID: 6337 RVA: 0x0003B278 File Offset: 0x00039478
	[Token(Token = "0x60018C1")]
	[Address(RVA = "0x95A350", Offset = "0x959350", VA = "0x18095A350")]
	private void OnBloomValueChanged(int value)
	{
		ScreenSettings screenSettings = Game.Config.screenSettings;
		bool flag = value == 1;
		screenSettings.bloomEffect = flag;
		Game.EmitScreenSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018C2 RID: 6338 RVA: 0x0003B2B4 File Offset: 0x000394B4
	[Token(Token = "0x60018C2")]
	[Address(RVA = "0x95A3D0", Offset = "0x9593D0", VA = "0x18095A3D0")]
	private void OnBrightnessValueChanged(int value)
	{
		Game.Config.screenSettings.brightnessSet = value;
		Game.EmitScreenSettingChangedEvent();
		Game.PlayHandlerSE(UIHandlerSFX.Navigation);
	}

	// Token: 0x060018C3 RID: 6339 RVA: 0x0003B2E8 File Offset: 0x000394E8
	[Token(Token = "0x60018C3")]
	[Address(RVA = "0x959CD0", Offset = "0x958CD0", VA = "0x180959CD0", 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: 0x060018C4 RID: 6340 RVA: 0x0003B684 File Offset: 0x00039884
	[Token(Token = "0x60018C4")]
	[Address(RVA = "0x958730", Offset = "0x957730", VA = "0x180958730", 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: 0x060018C5 RID: 6341 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60018C5")]
	[Address(RVA = "0x95A9D0", Offset = "0x9599D0", VA = "0x18095A9D0", Slot = "24")]
	protected override void UpdateTopHandlers()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060018C6 RID: 6342 RVA: 0x0003B7E4 File Offset: 0x000399E4
	[Token(Token = "0x60018C6")]
	[Address(RVA = "0x95A850", Offset = "0x959850", VA = "0x18095A850")]
	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: 0x060018C7 RID: 6343 RVA: 0x0003B844 File Offset: 0x00039A44
	[Token(Token = "0x60018C7")]
	[Address(RVA = "0x95A7C0", Offset = "0x9597C0", VA = "0x18095A7C0", Slot = "25")]
	protected override void SetDefault()
	{
		Game.UpdateVSyncSettings(Game.Config.screenSettings.SetDefault());
		Game.EmitScreenSettingChangedEvent();
		string system = ((IXmlDocumentType)this).System;
	}

	// Token: 0x060018C8 RID: 6344 RVA: 0x0003B87C File Offset: 0x00039A7C
	[Token(Token = "0x60018C8")]
	[Address(RVA = "0x3ED6F0", Offset = "0x3EC6F0", VA = "0x1803ED6F0")]
	public UISettingsScreen()
	{
	}
}
