Decompiled source of WideEye v3.1.0

Mods/WideEye.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Json;
using System.Text.Json.Serialization;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using FieldInjector;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppOccaSoftware.Exposure.Runtime;
using Il2CppSLZ.Bonelab;
using Il2CppSLZ.Marrow;
using Il2CppTMPro;
using MelonLoader;
using MelonLoader.Preferences;
using MelonLoader.Utils;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using WideEye.Behaviors;
using WideEye.CameraManagers;
using WideEye.Core;
using WideEye.Data;
using WideEye.Objects;
using WideEye.UI;
using WideEye.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Mod), "WideEye", "3.1.0", "HL2H0", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("WideEye")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+924614f2d7e57e47362d2db028f21efc6cb4e60f")]
[assembly: AssemblyProduct("WideEye")]
[assembly: AssemblyTitle("WideEye")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace WideEye.Utilities
{
	public static class Paths
	{
		private static string ResourcesFolder => Path.Combine(MelonEnvironment.GameRootDirectory, "UserData", "WideEye Resources");

		public static string ResourcesPath => Path.Combine(MelonEnvironment.GameRootDirectory, "UserData", "WideEye Resources", "md_resources.bundle");

		public static string PresetsPath => Path.Combine(MelonEnvironment.GameRootDirectory, "UserData", "WideEye Resources", "Presets");

		public static void InitFolders()
		{
			if (!Directory.Exists(ResourcesFolder))
			{
				Directory.CreateDirectory(ResourcesFolder);
			}
			if (!Directory.Exists(PresetsPath))
			{
				Directory.CreateDirectory(PresetsPath);
			}
		}
	}
	public static class SettingsApplier
	{
		public static void ResetToDefault(ModEnums.ResetType resetType)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			switch (resetType)
			{
			case ModEnums.ResetType.Fov:
				ApplyFOV(75f, syncElementValue: true, ModMenu.FOVSlider);
				break;
			case ModEnums.ResetType.Smoothing:
				ApplySmoothing(0f, 0f, syncElementValue: true);
				break;
			case ModEnums.ResetType.RotationOffset:
				ApplyOffset(new Vector3(11f, 0f, 0f), ModEnums.OffsetType.Rotation, syncElementValue: true, ModMenu.XrOffset, ModMenu.YrOffset, ModMenu.ZrOffset);
				break;
			case ModEnums.ResetType.PositionOffset:
				ApplyOffset(new Vector3(0f, 0f, 0f), ModEnums.OffsetType.Position, syncElementValue: true, ModMenu.XpOffset, ModMenu.YpOffset, ModMenu.ZpOffset);
				break;
			case ModEnums.ResetType.LensDistortion:
				ApplyLd(enabled: true, new Vector2(0.5f, 0.5f), 0.48f, 1f, 0.59f, 1f, syncElements: true);
				break;
			case ModEnums.ResetType.ChromaticAberration:
				ApplyCa(enabled: true, 0.123f, syncElements: true);
				break;
			case ModEnums.ResetType.AutoExposure:
				ApplyAe(enabled: true, (AutoExposureAdaptationMode)0, 3f, 2.5f, 1.2f, -1.2f, 1f, (AutoExposureMeteringMaskMode)0, 2f, syncElements: true);
				break;
			case ModEnums.ResetType.All:
				ApplyFOV(75f, syncElementValue: true, ModMenu.FOVSlider);
				ApplySmoothing(0f, 0f, syncElementValue: true);
				ApplyOffset(new Vector3(11f, 0f, 0f), ModEnums.OffsetType.Rotation, syncElementValue: true, ModMenu.XrOffset, ModMenu.YrOffset, ModMenu.ZrOffset);
				ApplyOffset(new Vector3(0f, 0f, 0f), ModEnums.OffsetType.Position, syncElementValue: true, ModMenu.XpOffset, ModMenu.YpOffset, ModMenu.ZpOffset);
				ApplyLd(enabled: true, new Vector2(0.5f, 0.5f), 0.48f, 1f, 0.59f, 1f, syncElements: true);
				ApplyCa(enabled: true, 0.123f, syncElements: true);
				ApplyAe(enabled: true, (AutoExposureAdaptationMode)0, 3f, 2.5f, 1.2f, -1.2f, 1f, (AutoExposureMeteringMaskMode)0, 2f, syncElements: true);
				((Behaviour)Mod.ScVolumeComponent).enabled = true;
				ModMenu.PostFXToggle.Value = true;
				break;
			}
		}

		public static void ApplyFOV(float fov, bool syncElementValue = false, FloatElement fovEle = null)
		{
			Mod.ScCameraComponent.fieldOfView = fov;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
			if (syncElementValue && fovEle != null)
			{
				fovEle.Value = fov;
			}
		}

		public static void ApplyOther(ModEnums.OtherType type, bool value, bool syncElement = false)
		{
			switch (type)
			{
			case ModEnums.OtherType.PostFX:
				((Behaviour)Mod.ScVolumeComponent).enabled = value;
				break;
			case ModEnums.OtherType.HeadMesh:
				if (!value)
				{
					Mod.RmPlayerArtComponent.DisableHead();
				}
				else
				{
					Mod.RmPlayerArtComponent.EnableHead();
				}
				foreach (SkinnedMeshRenderer item in (Il2CppArrayBase<SkinnedMeshRenderer>)(object)Player.Avatar.headMeshes)
				{
					((Renderer)item).enabled = value;
				}
				break;
			case ModEnums.OtherType.HairMeshes:
				if (!value)
				{
					Mod.RmPlayerArtComponent.DisableHair();
				}
				else
				{
					Mod.RmPlayerArtComponent.EnableHair();
				}
				foreach (SkinnedMeshRenderer item2 in (Il2CppArrayBase<SkinnedMeshRenderer>)(object)Player.Avatar.hairMeshes)
				{
					((Renderer)item2).enabled = value;
				}
				break;
			}
			if (syncElement)
			{
				ModMenu.PostFXToggle.Value = value;
			}
		}

		public static void ApplyOffset(Vector3 offset, ModEnums.OffsetType offsetType, bool syncElementValue = false, FloatElement eleX = null, FloatElement eleY = null, FloatElement eleZ = null)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			switch (offsetType)
			{
			case ModEnums.OffsetType.Position:
				Mod.StTransform.localPosition = offset;
				break;
			case ModEnums.OffsetType.Rotation:
				Mod.StTransform.localRotation = Quaternion.Euler(offset);
				break;
			}
			if (syncElementValue)
			{
				if (eleX != null)
				{
					eleX.Value = offset.x;
				}
				if (eleY != null)
				{
					eleY.Value = offset.y;
				}
				if (eleZ != null)
				{
					eleZ.Value = offset.z;
				}
			}
		}

		public static void ApplyOffset(ModEnums.OffsetType type)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			switch (type)
			{
			case ModEnums.OffsetType.Rotation:
				Mod.StTransform.localRotation = Quaternion.Euler(ModMenu.XrOffset.Value, ModMenu.YrOffset.Value, ModMenu.ZrOffset.Value);
				break;
			case ModEnums.OffsetType.Position:
				Mod.StTransform.localPosition = new Vector3(ModMenu.XpOffset.Value, ModMenu.YpOffset.Value, ModMenu.ZpOffset.Value);
				break;
			}
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}

		public static void ApplySmoothing(float rotationSmoothingValue, float positionSmoothingValue, bool syncElementValue)
		{
			Mod.ScSmootherComponent.RotationalSmoothTime = rotationSmoothingValue;
			Mod.ScSmootherComponent.TranslationSmoothTime = positionSmoothingValue;
			if (syncElementValue)
			{
				ModMenu.RSmoothing.Value = rotationSmoothingValue;
				ModMenu.PSmoothing.Value = positionSmoothingValue;
			}
		}

		public static void ApplySmoothing()
		{
			Mod.ScSmootherComponent.RotationalSmoothTime = ModMenu.RSmoothing.Value;
			Mod.ScSmootherComponent.TranslationSmoothTime = ModMenu.PSmoothing.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}

		public static void ApplyLd(bool enabled, Vector2 center, float intensity, float scale, float xMulti, float yMulti, bool syncElements)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			((VolumeComponent)Mod.LensDistortionOverride).active = enabled;
			((VolumeParameter<Vector2>)(object)Mod.LensDistortionOverride.center).value = center;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.intensity).value = intensity;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.scale).value = scale;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.xMultiplier).value = xMulti;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.yMultiplier).value = yMulti;
			if (syncElements)
			{
				ModMenu.LdEnabled.Value = enabled;
				ModMenu.LdCenterX.Value = center.x;
				ModMenu.LdCenterY.Value = center.y;
				ModMenu.LdIntensity.Value = intensity;
				ModMenu.LdScale.Value = scale;
				ModMenu.LdXMultiplier.Value = xMulti;
				ModMenu.LdYMultiplier.Value = yMulti;
			}
		}

		public static void ApplyLd()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			((VolumeComponent)Mod.LensDistortionOverride).active = ModMenu.LdEnabled.Value;
			((VolumeParameter<Vector2>)(object)Mod.LensDistortionOverride.center).value = new Vector2(ModMenu.LdCenterX.Value, ModMenu.LdCenterY.Value);
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.intensity).value = ModMenu.LdIntensity.Value;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.scale).value = ModMenu.LdScale.Value;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.xMultiplier).value = ModMenu.LdXMultiplier.Value;
			((VolumeParameter<float>)(object)Mod.LensDistortionOverride.yMultiplier).value = ModMenu.LdYMultiplier.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}

		public static void ApplyCa(bool enabled, float intensity, bool syncElements)
		{
			((VolumeComponent)Mod.ChromaticAberrationOverride).active = enabled;
			((VolumeParameter<float>)(object)Mod.ChromaticAberrationOverride.intensity).value = intensity;
			if (syncElements)
			{
				ModMenu.CaEnabled.Value = enabled;
				ModMenu.CaIntensity.Value = intensity;
			}
		}

		public static void ApplyCa()
		{
			((VolumeComponent)Mod.ChromaticAberrationOverride).active = ModMenu.CaEnabled.Value;
			((VolumeParameter<float>)(object)Mod.ChromaticAberrationOverride.intensity).value = ModMenu.CaIntensity.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}

		public static void ApplyAe(bool enabled, AutoExposureAdaptationMode adaptationMode, float d2Ls, float evCompen, float evMax, float evMin, float l2Ds, AutoExposureMeteringMaskMode meteringMaskMode, float meteringProceduralFalloff, bool syncElements)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			((VolumeComponent)Mod.AutoExposureOverride).active = enabled;
			((VolumeParameter<AutoExposureAdaptationMode>)(object)Mod.AutoExposureOverride.adaptationMode).value = adaptationMode;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.darkToLightSpeed).value = d2Ls;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.evCompensation).value = evCompen;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.evMax).value = evMax;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.evMin).value = evMin;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.lightToDarkSpeed).value = l2Ds;
			((VolumeParameter<AutoExposureMeteringMaskMode>)(object)Mod.AutoExposureOverride.meteringMaskMode).value = meteringMaskMode;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.meteringProceduralFalloff).value = meteringProceduralFalloff;
			if (syncElements)
			{
				ModMenu.AeEnabled.Value = enabled;
				ModMenu.AeAdaptationMode.Value = (Enum)(object)adaptationMode;
				ModMenu.AeD2Ls.Value = d2Ls;
				ModMenu.AeEvCompensation.Value = evCompen;
				ModMenu.AeEvMax.Value = evMax;
				ModMenu.AeEvMin.Value = evMin;
				ModMenu.AeL2Ds.Value = l2Ds;
				ModMenu.AeMeteringMaskMode.Value = (Enum)(object)meteringMaskMode;
				ModMenu.AeMeteringProceduralFalloff.Value = meteringProceduralFalloff;
			}
		}

		public static void ApplyAe()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			((VolumeComponent)Mod.AutoExposureOverride).active = ModMenu.AeEnabled.Value;
			((VolumeParameter<AutoExposureAdaptationMode>)(object)Mod.AutoExposureOverride.adaptationMode).value = (AutoExposureAdaptationMode)(object)ModMenu.AeAdaptationMode.Value;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.darkToLightSpeed).value = ModMenu.AeD2Ls.Value;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.evCompensation).value = ModMenu.AeEvCompensation.Value;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.evMax).value = ModMenu.AeEvMax.Value;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.evMin).value = ModMenu.AeEvMin.Value;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.lightToDarkSpeed).value = ModMenu.AeL2Ds.Value;
			((VolumeParameter<AutoExposureMeteringMaskMode>)(object)Mod.AutoExposureOverride.meteringMaskMode).value = (AutoExposureMeteringMaskMode)(object)ModMenu.AeMeteringMaskMode.Value;
			((VolumeParameter<float>)(object)Mod.AutoExposureOverride.meteringProceduralFalloff).value = ModMenu.AeMeteringProceduralFalloff.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}
	}
}
namespace WideEye.UI
{
	public static class ModMenu
	{
		public static FunctionElement GetCameraButton = new FunctionElement("Get Camera", Color.red, (Action)delegate
		{
			SpectatorCameraManager.GetSpectatorCamera(isAuto: false);
		});

		public static Page MainPage;

		public static FloatElement FOVSlider { get; private set; }

		private static Page OffsetPage { get; set; }

		private static Page SupportPage { get; set; }

		private static Page AutoExposurePage { get; set; }

		private static Page PostFXPage { get; set; }

		private static Page SmoothingPage { get; set; }

		private static Page LensDistortionPage { get; set; }

		private static Page ViewPage { get; set; }

		private static Page PresetsPage { get; set; }

		private static Page HandheldCameraPage { get; set; }

		private static Page FreeCamPage { get; set; }

		private static Page RotationOffsetPage { get; set; }

		private static Page NotificationPage { get; set; }

		public static FloatElement PSmoothing { get; private set; }

		public static FloatElement RSmoothing { get; private set; }

		public static EnumElement ViewMode { get; private set; }

		public static FloatElement FreeCamSpeed { get; private set; }

		public static FloatElement FreeCamFastSpeed { get; private set; }

		public static FloatElement FreeCamSensitivity { get; private set; }

		public static FloatElement FreeCamSmoothSpeed { get; private set; }

		public static FloatElement FreeCamScrollSensitivity { get; private set; }

		public static FloatElement FreeCamScrollSmoothing { get; private set; }

		public static BoolElement FreeCamShowIndicator { get; private set; }

		public static FloatElement XrOffset { get; private set; }

		public static FloatElement YrOffset { get; private set; }

		public static FloatElement ZrOffset { get; private set; }

		private static Page PositionOffsetPage { get; set; }

		public static FloatElement XpOffset { get; private set; }

		public static FloatElement YpOffset { get; private set; }

		public static FloatElement ZpOffset { get; private set; }

		public static BoolElement PostFXToggle { get; private set; }

		private static Page ChromaticAberrationPage { get; set; }

		public static BoolElement CaEnabled { get; private set; }

		public static FloatElement CaIntensity { get; private set; }

		public static BoolElement LdEnabled { get; private set; }

		public static FloatElement LdCenterX { get; private set; }

		public static FloatElement LdCenterY { get; private set; }

		public static FloatElement LdIntensity { get; private set; }

		public static FloatElement LdScale { get; private set; }

		public static FloatElement LdXMultiplier { get; private set; }

		public static FloatElement LdYMultiplier { get; private set; }

		public static BoolElement AeEnabled { get; private set; }

		public static EnumElement AeAdaptationMode { get; private set; }

		public static FloatElement AeD2Ls { get; private set; }

		public static FloatElement AeEvCompensation { get; private set; }

		public static FloatElement AeEvMax { get; private set; }

		public static FloatElement AeEvMin { get; private set; }

		public static FloatElement AeL2Ds { get; private set; }

		public static EnumElement AeMeteringMaskMode { get; private set; }

		public static FloatElement AeMeteringProceduralFalloff { get; private set; }

		private static Page ModSettingsPage { get; set; }

		public static BoolElement AutoSave { get; private set; }

		public static BoolElement OtherNotifi { get; private set; }

		public static BoolElement PrefNotifi { get; private set; }

		public static BoolElement CameraDisabledNotifi { get; private set; }

		public static BoolElement CameraFoundNotifi { get; private set; }

		public static IntElement StartupDelay { get; private set; }

		public static void CreatePresetsPage()
		{
			foreach (KeyValuePair<string, WideEyeSettings> preset in PresetsManager.Presets)
			{
				CreateOnePresetPage(preset.Value.Name);
			}
		}

		public static void CreateOnePresetPage(string presetName)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			WideEyeSettings wideEyeSettings = PresetsManager.Presets[presetName];
			Page val = PresetsPage.CreatePage(presetName, Color.white, 0, true);
			if (wideEyeSettings != null)
			{
				val.CreateFunction("Save Current Setting To This", Color.cyan, (Action)delegate
				{
					PresetsManager.SavePreset(presetName);
				});
				val.CreateFunction("Load This Preset", Color.green, (Action)delegate
				{
					PresetsManager.ApplyPreset(presetName);
				});
				val.CreateFunction("View Path", Color.yellow, (Action)delegate
				{
					PresetsManager.ViewPath(presetName);
				});
			}
			else
			{
				val.Color = Color.red;
				val.CreateFunction("An Error Occured", Color.white, (Action)null);
				val.CreateFunction("While Loading Preset", Color.white, (Action)null);
			}
		}

		public static WideEyeSettings GetValues()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			return new WideEyeSettings
			{
				FOV = FOVSlider.Value,
				PosSmoothing = PSmoothing.Value,
				RotSmoothing = RSmoothing.Value,
				PosOffset = new SerializableVector3(new Vector3(XpOffset.Value, YpOffset.Value, ZpOffset.Value)),
				RotOffset = new SerializableVector3(new Vector3(XrOffset.Value, YrOffset.Value, ZrOffset.Value)),
				PostFXEnabled = PostFXToggle.Value,
				CaEnabled = CaEnabled.Value,
				CaIntensity = CaIntensity.Value,
				LdEnabled = LdEnabled.Value,
				LdCenter = new SerializableVector2(new Vector2(LdCenterX.Value, LdCenterY.Value)),
				LdIntensity = LdIntensity.Value,
				LdScale = LdScale.Value,
				LdMultiplyer = new SerializableVector2(new Vector2(LdXMultiplier.Value, LdYMultiplier.Value)),
				AeEnabled = AeEnabled.Value,
				AeAdaptationMode = (AutoExposureAdaptationMode)(object)AeAdaptationMode.Value,
				AeD2Ls = AeD2Ls.Value,
				AeEvComp = AeEvCompensation.Value,
				AeEvMax = AeEvMax.Value,
				AeEvMin = AeEvMin.Value,
				AeL2ds = AeL2Ds.Value,
				AeMeetringMaskMode = (AutoExposureMeteringMaskMode)(object)AeMeteringMaskMode.Value,
				AeMeetaeMeteringProceduralFalloff = AeMeteringProceduralFalloff.Value
			};
		}

		public static void SetupBoneMenu()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0701: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_081b: Unknown result type (might be due to invalid IL or missing references)
			//IL_084f: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0902: Unknown result type (might be due to invalid IL or missing references)
			//IL_094e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0972: Unknown result type (might be due to invalid IL or missing references)
			//IL_097c: Expected O, but got Unknown
			//IL_0986: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a67: Expected O, but got Unknown
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0de8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0feb: Unknown result type (might be due to invalid IL or missing references)
			//IL_101b: Unknown result type (might be due to invalid IL or missing references)
			//IL_104b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1066: Unknown result type (might be due to invalid IL or missing references)
			//IL_109f: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1111: Unknown result type (might be due to invalid IL or missing references)
			//IL_114a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1165: Unknown result type (might be due to invalid IL or missing references)
			//IL_1199: Unknown result type (might be due to invalid IL or missing references)
			//IL_11cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1201: Unknown result type (might be due to invalid IL or missing references)
			MainPage = Page.Root.CreatePage("WideEye", Color.white, 0, true);
			FOVSlider = MainPage.CreateFloat("FOV", Color.cyan, 72f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate(float value)
			{
				SettingsApplier.ApplyFOV(value);
			});
			MainPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.Fov);
			});
			MainPage.CreateFunction("Save Preferences", Color.green, (Action)ModPreferences.SavePref);
			PostFXPage = MainPage.CreatePage("Post-Processing", Color.yellow, 0, true);
			PostFXToggle = PostFXPage.CreateBool("Enabled", Color.yellow, true, (Action<bool>)delegate(bool value)
			{
				SettingsApplier.ApplyOther(ModEnums.OtherType.PostFX, value);
			});
			LensDistortionPage = PostFXPage.CreatePage("Lens Distortion", Color.white, 0, true);
			LdEnabled = LensDistortionPage.CreateBool("Enabled", Color.white, true, (Action<bool>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LdCenterX = LensDistortionPage.CreateFloat("Center X", Color.red, 0.5f, 0.1f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LdCenterY = LensDistortionPage.CreateFloat("Center Y", Color.green, 0.5f, 0.1f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LdIntensity = LensDistortionPage.CreateFloat("Intensity", Color.white, 0.48f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LdScale = LensDistortionPage.CreateFloat("Scale", Color.white, 1f, 0.1f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LdXMultiplier = LensDistortionPage.CreateFloat("X Multiplier", Color.red, 0.59f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LdYMultiplier = LensDistortionPage.CreateFloat("Y Multiplier", Color.green, 1f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyLd();
			});
			LensDistortionPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.LensDistortion);
			});
			ChromaticAberrationPage = PostFXPage.CreatePage("ChromaticAberration", Color.white, 0, true);
			CaEnabled = ChromaticAberrationPage.CreateBool("Enabled", Color.white, true, (Action<bool>)delegate
			{
				SettingsApplier.ApplyCa();
			});
			CaIntensity = ChromaticAberrationPage.CreateFloat("Intensity", Color.white, 0.123f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				SettingsApplier.ApplyCa();
			});
			ChromaticAberrationPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.ChromaticAberration);
			});
			AutoExposurePage = PostFXPage.CreatePage("AutoExposure", Color.white, 0, true);
			AeEnabled = AutoExposurePage.CreateBool("Enabled", Color.white, true, (Action<bool>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeAdaptationMode = AutoExposurePage.CreateEnum("Adaptation Mode", Color.white, (Enum)(object)(AutoExposureAdaptationMode)0, (Action<Enum>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeD2Ls = AutoExposurePage.CreateFloat("Dark To Light Speed", Color.white, 3f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeEvCompensation = AutoExposurePage.CreateFloat("EV Compensation", Color.white, 2.5f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeEvMax = AutoExposurePage.CreateFloat("EV Max", Color.white, 1.2f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeEvMin = AutoExposurePage.CreateFloat("EV Min", Color.white, -1.2f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeL2Ds = AutoExposurePage.CreateFloat("Light To Dark Speed", Color.white, 1f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AeMeteringMaskMode = AutoExposurePage.CreateEnum("Metering Mask Mode", Color.white, (Enum)(object)(AutoExposureMeteringMaskMode)0, (Action<Enum>)null);
			AeMeteringProceduralFalloff = AutoExposurePage.CreateFloat("Metering Procedural Falloff", Color.white, 2f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyAe();
			});
			AutoExposurePage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.AutoExposure);
			});
			OffsetPage = MainPage.CreatePage("Offset", Color.white, 0, true);
			RotationOffsetPage = OffsetPage.CreatePage("Rotation Offset", Color.white, 0, true);
			XrOffset = RotationOffsetPage.CreateFloat("X Rotation Offset", Color.red, 11f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyOffset(ModEnums.OffsetType.Rotation);
			});
			YrOffset = RotationOffsetPage.CreateFloat("Y Rotation Offset", Color.green, 0f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyOffset(ModEnums.OffsetType.Rotation);
			});
			ZrOffset = RotationOffsetPage.CreateFloat("Z Rotation Offset", Color.blue, 0f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyOffset(ModEnums.OffsetType.Rotation);
			});
			RotationOffsetPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.RotationOffset);
			});
			PositionOffsetPage = OffsetPage.CreatePage("Position Offset", Color.white, 0, true);
			XpOffset = PositionOffsetPage.CreateFloat("X Position Offset", Color.red, 0f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyOffset(ModEnums.OffsetType.Position);
			});
			YpOffset = PositionOffsetPage.CreateFloat("Y Position Offset", Color.green, 0f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyOffset(ModEnums.OffsetType.Position);
			});
			ZpOffset = PositionOffsetPage.CreateFloat("Z Position Offset", Color.blue, 0f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				SettingsApplier.ApplyOffset(ModEnums.OffsetType.Position);
			});
			PositionOffsetPage.Add((Element)new FunctionElement("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.PositionOffset);
			}));
			SmoothingPage = MainPage.CreatePage("Smoothing", Color.white, 0, true);
			PSmoothing = SmoothingPage.CreateFloat("Position Smoothing", Color.white, 0f, 1f, float.MinValue, 2.1474836E+09f, (Action<float>)delegate
			{
				SettingsApplier.ApplySmoothing();
			});
			RSmoothing = SmoothingPage.CreateFloat("Rotation Smoothing", Color.white, 0f, 1f, float.MinValue, 2.1474836E+09f, (Action<float>)delegate
			{
				SettingsApplier.ApplySmoothing();
			});
			SmoothingPage.Add((Element)new FunctionElement("Reset To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.Smoothing);
			}));
			PresetsPage = MainPage.CreatePage("Presets", Color.magenta, 0, true);
			StringElement presetNameInput = PresetsPage.CreateString("Preset Name", Color.white, "", (Action<string>)null);
			PresetsPage.CreateFunction("Create Preset From Current Settings", Color.white, (Action)delegate
			{
				PresetsManager.CreatePreset(presetNameInput.Value);
			});
			CreatePresetsPage();
			Menu.OnPageOpened += delegate(Page page)
			{
				if (page == PresetsPage)
				{
					PresetsManager.RefreshPresetList();
				}
			};
			ViewPage = MainPage.CreatePage("View", Color.cyan, 0, true);
			ViewMode = ViewPage.CreateEnum("View Mode", Color.white, (Enum)ModEnums.ViewMode.Head, (Action<Enum>)delegate(Enum v)
			{
				CameraController.UpdateView((ModEnums.ViewMode)(object)v);
			});
			HandheldCameraPage = ViewPage.CreatePage("Handheld Camera", Color.white, 0, true);
			if (!ResourcesManager.Loaded)
			{
				HandheldCameraPage.Name = "Handheld Camera [ERROR]";
				HandheldCameraPage.Color = Color.red;
				HandheldCameraPage.CreateFunction("An Error Occured", Color.white, (Action)null);
				HandheldCameraPage.CreateFunction("While Loading Resources", Color.white, (Action)null);
				HandheldCameraPage.CreateFunction("Check if you have installed the mod correctly", Color.white, (Action)null);
				HandheldCameraPage.CreateFunction("For more help, click me", Color.white, (Action)delegate
				{
					Application.OpenURL("https://github.com/HL2H0/WideEye/issues");
					new ModNotification(ModNotification.ModNotificationType.Other, "WideEye | Success", "Opened the GitHub issues page for WideEye On Desktop", (NotificationType)3, 2f).Show();
				});
			}
			else
			{
				HandheldCameraPage.CreateFunction("Spawn Camera", Color.green, (Action)HandheldCameraManager.SpawnHandheldCamera);
				HandheldCameraPage.CreateFunction("Destroy Camera", Color.red, (Action)HandheldCameraManager.DestroyHandheldCamera);
				HandheldCameraPage.CreateFunction("Teleport Camera", Color.cyan, (Action)HandheldCameraManager.TeleportHandheldCamera);
			}
			FreeCamPage = ViewPage.CreatePage("FreeCam Settings", Color.white, 0, true);
			FreeCamSpeed = FreeCamPage.CreateFloat("Move Speed", Color.white, 3f, 1f, 0f, float.MaxValue, (Action<float>)delegate(float v)
			{
				FreeCamManager.MoveSpeed = v;
			});
			FreeCamFastSpeed = FreeCamPage.CreateFloat("Fast Move Speed", Color.white, 7f, 1f, 0f, float.MaxValue, (Action<float>)delegate(float v)
			{
				FreeCamManager.FastMoveSpeed = v;
			});
			FreeCamSensitivity = FreeCamPage.CreateFloat("Mouse Sensitivity", Color.white, 3f, 1f, 0f, float.MaxValue, (Action<float>)delegate(float v)
			{
				FreeCamManager.Sensitivity = v;
			});
			FreeCamSmoothSpeed = FreeCamPage.CreateFloat("Smooth Speed", Color.white, 10f, 1f, 0f, float.MaxValue, (Action<float>)delegate(float v)
			{
				FreeCamManager.SmoothSpeed = v;
			});
			FreeCamScrollSensitivity = FreeCamPage.CreateFloat("Scroll Sensitivity", Color.white, 15f, 1f, 0f, float.MaxValue, (Action<float>)delegate(float v)
			{
				FreeCamManager.ScrollSensitivity = v;
			});
			FreeCamScrollSmoothing = FreeCamPage.CreateFloat("Scroll Smoothing", Color.white, 10f, 1f, 0f, float.MaxValue, (Action<float>)delegate(float v)
			{
				FreeCamManager.ScrollSmoothing = v;
			});
			FreeCamShowIndicator = FreeCamPage.CreateBool("Show Indicator", Color.white, true, (Action<bool>)delegate(bool v)
			{
				FreeCamManager.ShowIndicator = v;
			});
			ModSettingsPage = MainPage.CreatePage("Mod Settings", Color.green, 0, true);
			StartupDelay = ModSettingsPage.CreateInt("Startup Delay (Seconds)", Color.cyan, 5, 1, 2, int.MaxValue, (Action<int>)delegate(int v)
			{
				ModPreferences.StartupDelay = v;
			});
			AutoSave = ModSettingsPage.CreateBool("Auto Save (Experimental)", Color.yellow, false, (Action<bool>)delegate(bool v)
			{
				ModPreferences.AutoSave = v;
			});
			ModSettingsPage.CreateBool("Head Meshes", Color.yellow, true, (Action<bool>)delegate(bool value)
			{
				SettingsApplier.ApplyOther(ModEnums.OtherType.HeadMesh, value);
			});
			ModSettingsPage.CreateBool("Hair Meshes", Color.yellow, true, (Action<bool>)delegate(bool value)
			{
				SettingsApplier.ApplyOther(ModEnums.OtherType.HairMeshes, value);
			});
			ModSettingsPage.CreateFunction("Reset All To Default", Color.red, (Action)delegate
			{
				SettingsApplier.ResetToDefault(ModEnums.ResetType.All);
			});
			ModSettingsPage.CreateFunction("Load Preferences", Color.green, (Action)ModPreferences.LoadPref);
			ModSettingsPage.CreateFunction("Clear All Preferences", Color.red, (Action)ModPreferences.ClearPref);
			NotificationPage = ModSettingsPage.CreatePage("Notification", Color.magenta, 0, true);
			PrefNotifi = NotificationPage.CreateBool("Preferences Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			CameraDisabledNotifi = NotificationPage.CreateBool("Camera Disabled Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			CameraFoundNotifi = NotificationPage.CreateBool("Camera Found Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			OtherNotifi = NotificationPage.CreateBool("Other Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			SupportPage = MainPage.CreatePage("Support", Color.white, 0, true);
			SupportPage.CreateFunction("Open GitHub Issues", Color.white, (Action)delegate
			{
				Application.OpenURL("https://github.com/HL2H0/WideEye/issues");
				new ModNotification(ModNotification.ModNotificationType.Other, "WideEye | Success", "Opened the GitHub issues page for WideEye On Desktop", (NotificationType)3, 2f).Show();
			});
			SupportPage.CreateFunction("Discord", Color.blue, (Action)delegate
			{
				GUIUtility.systemCopyBuffer = "@hiiiiiiiiiiiiiiiiii";
				new ModNotification(ModNotification.ModNotificationType.Other, "WideEye | Success", "Copied username to clipboard", (NotificationType)3, 2f).Show();
			});
			SupportPage.CreateFunction("Support me on Ko-Fi", Color.magenta, (Action)delegate
			{
				Application.OpenURL("https://ko-fi.com/hl2h0");
				new ModNotification(ModNotification.ModNotificationType.Other, "WideEye | Success", "Opened the Ko-Fi page for WideEye On Desktop", (NotificationType)3, 2f).Show();
			});
			SupportPage.CreateFunction("Version :  3.1.0", Color.white, (Action)null);
		}
	}
	public class ModNotification
	{
		public enum ModNotificationType
		{
			Preferences,
			CameraDisabled,
			CameraFound,
			Other,
			Force
		}

		private static bool _showOther;

		private static bool _showPreferences;

		private static bool _showCameraDisabled;

		private static bool _showCameraFound;

		private ModNotificationType _type;

		private string _title;

		private string _message;

		private NotificationType _notificationType;

		private float _popupLength;

		public ModNotification(ModNotificationType type, string title, string message, NotificationType notificationType, float popupLength)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			_type = type;
			_title = title;
			_message = message;
			_notificationType = notificationType;
			_popupLength = popupLength;
			base..ctor();
		}

		public static void ChangeSilentNotification()
		{
			_showOther = ModMenu.OtherNotifi.Value;
			_showPreferences = ModMenu.PrefNotifi.Value;
			_showCameraDisabled = ModMenu.CameraDisabledNotifi.Value;
			_showCameraFound = ModMenu.CameraFoundNotifi.Value;
			_showCameraDisabled = ModMenu.CameraDisabledNotifi.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}

		public static void ChangeSilentNotification(bool other, bool preference, bool cameraFound, bool cameraDisabled, BoolElement otherElement, BoolElement preferenceElement, BoolElement cameraFoundElement, BoolElement cameraDisabledElement)
		{
			_showOther = other;
			_showPreferences = preference;
			_showCameraDisabled = cameraDisabled;
			_showCameraFound = cameraFound;
			_showCameraDisabled = cameraDisabled;
			otherElement.Value = other;
			preferenceElement.Value = preference;
			cameraFoundElement.Value = cameraFound;
			cameraDisabledElement.Value = cameraDisabled;
			cameraFoundElement.Value = cameraFound;
		}

		public void Show()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			switch (_type)
			{
			case ModNotificationType.Preferences:
				if (!_showPreferences)
				{
					return;
				}
				break;
			case ModNotificationType.CameraDisabled:
				if (!_showCameraDisabled)
				{
					return;
				}
				break;
			case ModNotificationType.CameraFound:
				if (!_showCameraFound)
				{
					return;
				}
				break;
			case ModNotificationType.Other:
				if (!_showOther)
				{
					return;
				}
				break;
			}
			Notifier.Send(new Notification
			{
				Title = NotificationText.op_Implicit(_title),
				Message = NotificationText.op_Implicit(_message),
				PopupLength = _popupLength,
				Type = _notificationType,
				ShowTitleOnPopup = true
			});
		}
	}
}
namespace WideEye.Objects
{
	public class SerializableVector2
	{
		public float X { get; set; }

		public float Y { get; set; }

		public SerializableVector2()
		{
		}

		public SerializableVector2(Vector2 vector2)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			X = vector2.x;
			Y = vector2.y;
		}

		public Vector2 ToVector2()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(X, Y);
		}
	}
	public class SerializableVector3
	{
		public float X { get; set; }

		public float Y { get; set; }

		public float Z { get; set; }

		public SerializableVector3()
		{
		}

		public SerializableVector3(Vector3 vector3)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			X = vector3.x;
			Y = vector3.y;
			Z = vector3.z;
		}

		public Vector3 ToVector3()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(X, Y, Z);
		}
	}
}
namespace WideEye.Data
{
	public static class ModPreferences
	{
		public static bool AutoSave;

		private static MelonPreferences_Category _categWideEye;

		private static MelonPreferences_Entry<float> _fov;

		private static MelonPreferences_Entry<bool> _postFX;

		private static MelonPreferences_Entry<Vector3> _rotationOffset;

		private static MelonPreferences_Entry<Vector3> _positionOffset;

		private static MelonPreferences_Entry<float> _rotationSmoothing;

		private static MelonPreferences_Entry<float> _positionSmoothing;

		private static MelonPreferences_Entry<bool> _showOtherNotifi;

		private static MelonPreferences_Entry<bool> _showPrefNotifi;

		private static MelonPreferences_Entry<bool> _showCameraDisabledNotifi;

		private static MelonPreferences_Entry<bool> _showCameraFoundNotifi;

		private static MelonPreferences_Entry<bool> _autoSave;

		private static MelonPreferences_Entry<int> _startupDelay;

		private static MelonPreferences_Entry<float> _freeCamSpeed;

		private static MelonPreferences_Entry<float> _freeCamFastSpeed;

		private static MelonPreferences_Entry<float> _freeCamSensitivity;

		private static MelonPreferences_Entry<float> _freeCamSmoothSpeed;

		private static MelonPreferences_Entry<float> _freeCamScrollSensitivity;

		private static MelonPreferences_Entry<float> _freeCamScrollSmoothing;

		private static MelonPreferences_Entry<bool> _freecamIndicator;

		private static MelonPreferences_Category _categPfxLd;

		private static MelonPreferences_Entry<bool> _ldEnabled;

		private static MelonPreferences_Entry<Vector2> _ldCenter;

		private static MelonPreferences_Entry<float> _ldIntensity;

		private static MelonPreferences_Entry<float> _ldScale;

		private static MelonPreferences_Entry<float> _ldXMultiplier;

		private static MelonPreferences_Entry<float> _ldYMultiplier;

		private static MelonPreferences_Category _categPfxCa;

		private static MelonPreferences_Entry<bool> _caEnabled;

		private static MelonPreferences_Entry<float> _caIntensity;

		private static MelonPreferences_Category _categPfxAe;

		private static MelonPreferences_Entry<bool> _aeEnabled;

		private static MelonPreferences_Entry<AutoExposureAdaptationMode> _aeAdaptationMode;

		private static MelonPreferences_Entry<float> _aeD2Ls;

		private static MelonPreferences_Entry<float> _aeEvCompensation;

		private static MelonPreferences_Entry<float> _aeEvMax;

		private static MelonPreferences_Entry<float> _aeEvMin;

		private static MelonPreferences_Entry<float> _aeL2Ds;

		private static MelonPreferences_Entry<AutoExposureMeteringMaskMode> _aeMeteringMask;

		private static MelonPreferences_Entry<float> _aeMetProcedFalloff;

		public static int StartupDelay
		{
			get
			{
				return _startupDelay.Value;
			}
			set
			{
				_startupDelay.Value = value;
			}
		}

		public static void CreatePref()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			_categWideEye = MelonPreferences.CreateCategory("WideEye");
			_fov = _categWideEye.CreateEntry<float>("Fov", 75f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_postFX = _categWideEye.CreateEntry<bool>("PostFX", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_rotationOffset = _categWideEye.CreateEntry<Vector3>("RotationOffset", new Vector3(11f, 0f, 0f), (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_positionOffset = _categWideEye.CreateEntry<Vector3>("PositionOffset", Vector3.zero, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_rotationSmoothing = _categWideEye.CreateEntry<float>("RotationSmoothing", 0f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_positionSmoothing = _categWideEye.CreateEntry<float>("PositionSmoothing", 0f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_startupDelay = _categWideEye.CreateEntry<int>("StartupDelay", 5, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_showOtherNotifi = _categWideEye.CreateEntry<bool>("ShowOtherNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_showPrefNotifi = _categWideEye.CreateEntry<bool>("ShowPrefNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_showCameraDisabledNotifi = _categWideEye.CreateEntry<bool>("ShowCameraDisabledNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_showCameraFoundNotifi = _categWideEye.CreateEntry<bool>("ShowCameraFoundNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_autoSave = _categWideEye.CreateEntry<bool>("AutoSave", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freeCamSpeed = _categWideEye.CreateEntry<float>("FreeCamSpeed", 3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freeCamFastSpeed = _categWideEye.CreateEntry<float>("FreeCamFastSpeed", 7f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freeCamSensitivity = _categWideEye.CreateEntry<float>("FreeCamSensitivity", 3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freeCamSmoothSpeed = _categWideEye.CreateEntry<float>("FreeCamSmoothSpeed", 10f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freeCamScrollSensitivity = _categWideEye.CreateEntry<float>("FreeCamScrollSensitivity", 15f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freeCamScrollSmoothing = _categWideEye.CreateEntry<float>("FreeCamScrollSmoothing", 10f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_freecamIndicator = _categWideEye.CreateEntry<bool>("FreeCamIndicator", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_categPfxLd = MelonPreferences.CreateCategory("WideEye_PostFX_LensDistortion");
			_ldEnabled = _categPfxLd.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_ldCenter = _categPfxLd.CreateEntry<Vector2>("Center", new Vector2(0.5f, 0.5f), (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_ldIntensity = _categPfxLd.CreateEntry<float>("Intensity", 0.48f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_ldScale = _categPfxLd.CreateEntry<float>("Scale", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_ldXMultiplier = _categPfxLd.CreateEntry<float>("xMultiplier", 0.59f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_ldYMultiplier = _categPfxLd.CreateEntry<float>("yMultiplier", 0.59f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_categPfxCa = MelonPreferences.CreateCategory("WideEye_PostFX_ChromaticAberration");
			_caEnabled = _categPfxCa.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_caIntensity = _categPfxCa.CreateEntry<float>("Intensity", 0.123f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_categPfxAe = MelonPreferences.CreateCategory("WideEye_PostFX_AutoExposure");
			_aeEnabled = _categPfxAe.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeAdaptationMode = _categPfxAe.CreateEntry<AutoExposureAdaptationMode>("AdaptationMode", (AutoExposureAdaptationMode)0, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeD2Ls = _categPfxAe.CreateEntry<float>("DarkToLightSpeed", 3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeEvCompensation = _categPfxAe.CreateEntry<float>("evCompensation", 2.5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeEvMax = _categPfxAe.CreateEntry<float>("evMax", 1.2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeEvMin = _categPfxAe.CreateEntry<float>("evMin", -1.2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeL2Ds = _categPfxAe.CreateEntry<float>("LightToDarkSpeed", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeMeteringMask = _categPfxAe.CreateEntry<AutoExposureMeteringMaskMode>("MeteringMaskMode", (AutoExposureMeteringMaskMode)0, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_aeMetProcedFalloff = _categPfxAe.CreateEntry<float>("MeteringProceduralFalloff", 2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		}

		public static void LoadPref()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			SettingsApplier.ApplyFOV(_fov.Value, syncElementValue: true, ModMenu.FOVSlider);
			SettingsApplier.ApplyOther(ModEnums.OtherType.PostFX, _postFX.Value, syncElement: true);
			ModMenu.PostFXToggle.Value = _postFX.Value;
			SettingsApplier.ApplyOffset(_rotationOffset.Value, ModEnums.OffsetType.Rotation, syncElementValue: true, ModMenu.XrOffset, ModMenu.YrOffset, ModMenu.ZrOffset);
			SettingsApplier.ApplyOffset(_positionOffset.Value, ModEnums.OffsetType.Position, syncElementValue: true, ModMenu.XpOffset, ModMenu.YpOffset, ModMenu.ZpOffset);
			SettingsApplier.ApplySmoothing(_rotationSmoothing.Value, _positionSmoothing.Value, syncElementValue: true);
			ModMenu.StartupDelay.Value = _startupDelay.Value;
			ModNotification.ChangeSilentNotification(_showOtherNotifi.Value, _showPrefNotifi.Value, _showCameraDisabledNotifi.Value, _showCameraFoundNotifi.Value, ModMenu.OtherNotifi, ModMenu.PrefNotifi, ModMenu.CameraDisabledNotifi, ModMenu.CameraFoundNotifi);
			ModMenu.AutoSave.Value = _autoSave.Value;
			AutoSave = _autoSave.Value;
			FreeCamManager.MoveSpeed = _freeCamSpeed.Value;
			FreeCamManager.FastMoveSpeed = _freeCamFastSpeed.Value;
			FreeCamManager.Sensitivity = _freeCamSensitivity.Value;
			FreeCamManager.SmoothSpeed = _freeCamSmoothSpeed.Value;
			FreeCamManager.ScrollSensitivity = _freeCamScrollSensitivity.Value;
			FreeCamManager.ScrollSmoothing = _freeCamScrollSmoothing.Value;
			FreeCamManager.ShowIndicator = _freecamIndicator.Value;
			SettingsApplier.ApplyLd(_ldEnabled.Value, _ldCenter.Value, _ldIntensity.Value, _ldScale.Value, _ldXMultiplier.Value, _ldYMultiplier.Value, syncElements: true);
			SettingsApplier.ApplyCa(_caEnabled.Value, _caIntensity.Value, syncElements: true);
			SettingsApplier.ApplyAe(_aeEnabled.Value, _aeAdaptationMode.Value, _aeD2Ls.Value, _aeEvCompensation.Value, _aeEvMax.Value, _aeEvMin.Value, _aeL2Ds.Value, _aeMeteringMask.Value, _aeMetProcedFalloff.Value, syncElements: true);
			MelonLogger.Msg(ConsoleColor.Green, "Loaded Preferences.");
		}

		public static void SavePref()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			_fov.Value = ModMenu.FOVSlider.Value;
			_postFX.Value = ModMenu.PostFXToggle.Value;
			_rotationOffset.Value = new Vector3(ModMenu.XrOffset.Value, ModMenu.YrOffset.Value, ModMenu.ZrOffset.Value);
			_positionOffset.Value = new Vector3(ModMenu.XpOffset.Value, ModMenu.YpOffset.Value, ModMenu.ZpOffset.Value);
			_rotationSmoothing.Value = ModMenu.RSmoothing.Value;
			_positionSmoothing.Value = ModMenu.PSmoothing.Value;
			_showOtherNotifi.Value = ModMenu.OtherNotifi.Value;
			_showPrefNotifi.Value = ModMenu.PrefNotifi.Value;
			_showCameraDisabledNotifi.Value = ModMenu.CameraDisabledNotifi.Value;
			_showCameraFoundNotifi.Value = ModMenu.CameraFoundNotifi.Value;
			_autoSave.Value = ModMenu.AutoSave.Value;
			_freeCamSpeed.Value = ModMenu.FreeCamSpeed.Value;
			_freeCamFastSpeed.Value = ModMenu.FreeCamFastSpeed.Value;
			_freeCamSensitivity.Value = ModMenu.FreeCamSensitivity.Value;
			_freeCamSmoothSpeed.Value = ModMenu.FreeCamSmoothSpeed.Value;
			_freeCamScrollSensitivity.Value = ModMenu.FreeCamScrollSensitivity.Value;
			_freeCamScrollSmoothing.Value = ModMenu.FreeCamScrollSmoothing.Value;
			_ldEnabled.Value = ModMenu.LdEnabled.Value;
			_ldCenter.Value = new Vector2(ModMenu.LdCenterX.Value, ModMenu.LdCenterY.Value);
			_ldIntensity.Value = ModMenu.LdIntensity.Value;
			_ldScale.Value = ModMenu.LdScale.Value;
			_ldXMultiplier.Value = ModMenu.LdXMultiplier.Value;
			_ldYMultiplier.Value = ModMenu.LdYMultiplier.Value;
			_caEnabled.Value = ModMenu.CaEnabled.Value;
			_caIntensity.Value = ModMenu.CaIntensity.Value;
			_aeEnabled.Value = ModMenu.AeEnabled.Value;
			_aeAdaptationMode.Value = (AutoExposureAdaptationMode)(object)ModMenu.AeAdaptationMode.Value;
			_aeD2Ls.Value = ModMenu.AeD2Ls.Value;
			_aeEvCompensation.Value = ModMenu.AeEvCompensation.Value;
			_aeEvMax.Value = ModMenu.AeEvMax.Value;
			_aeEvMin.Value = ModMenu.AeEvMin.Value;
			_aeL2Ds.Value = ModMenu.AeL2Ds.Value;
			_aeMeteringMask.Value = (AutoExposureMeteringMaskMode)(object)ModMenu.AeMeteringMaskMode.Value;
			_aeMetProcedFalloff.Value = ModMenu.AeMeteringProceduralFalloff.Value;
			_categWideEye.SaveToFile(false);
			_categPfxLd.SaveToFile(false);
			_categPfxCa.SaveToFile(false);
			_categPfxAe.SaveToFile(false);
			if (!AutoSave)
			{
				new ModNotification(ModNotification.ModNotificationType.Preferences, "WideEye | Success", "Saved Preferences.", (NotificationType)3, 2f).Show();
				MelonLogger.Msg(ConsoleColor.Green, "Saved Preferences.");
			}
		}

		public static void ClearPref()
		{
			foreach (MelonPreferences_Entry item in _categWideEye.Entries.Concat(_categPfxLd.Entries).Concat(_categPfxCa.Entries).Concat(_categPfxAe.Entries)
				.ToList())
			{
				item.ResetToDefault();
			}
			LoadPref();
			new ModNotification(ModNotification.ModNotificationType.Preferences, "WideEye | Success", "Cleared All Preferences", (NotificationType)3, 2f).Show();
			MelonLogger.Msg(ConsoleColor.Green, "Done!, Cleared All Preferences");
		}
	}
	public static class PresetsManager
	{
		public static Dictionary<string, WideEyeSettings> Presets = new Dictionary<string, WideEyeSettings>();

		private static JsonSerializerOptions _options = new JsonSerializerOptions
		{
			WriteIndented = true,
			ReferenceHandler = ReferenceHandler.Preserve
		};

		public static void LoadPresets()
		{
			string[] files = Directory.GetFiles(Paths.PresetsPath, "*.json");
			foreach (string text in files)
			{
				WideEyeSettings wideEyeSettings = JsonSerializer.Deserialize<WideEyeSettings>(File.ReadAllText(text));
				if (wideEyeSettings != null)
				{
					Presets.Add(wideEyeSettings.Name, wideEyeSettings);
					MelonLogger.Msg("Loaded Preset: " + wideEyeSettings.Name);
				}
				else
				{
					MelonLogger.Error("Preset " + text + " Couldn't be Loaded");
				}
			}
		}

		public static void ApplyPreset(string presetName)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			WideEyeSettings wideEyeSettings = Presets[presetName];
			if (wideEyeSettings != null)
			{
				SettingsApplier.ApplyFOV(wideEyeSettings.FOV, syncElementValue: true);
				SettingsApplier.ApplySmoothing(wideEyeSettings.RotSmoothing, wideEyeSettings.PosSmoothing, syncElementValue: true);
				SettingsApplier.ApplyOffset(wideEyeSettings.RotOffset.ToVector3(), ModEnums.OffsetType.Rotation);
				SettingsApplier.ApplyOffset(wideEyeSettings.PosOffset.ToVector3(), ModEnums.OffsetType.Position);
				SettingsApplier.ApplyCa(wideEyeSettings.CaEnabled, wideEyeSettings.CaIntensity, syncElements: true);
				SettingsApplier.ApplyAe(wideEyeSettings.AeEnabled, wideEyeSettings.AeAdaptationMode, wideEyeSettings.AeD2Ls, wideEyeSettings.AeEvComp, wideEyeSettings.AeEvMax, wideEyeSettings.AeEvMin, wideEyeSettings.AeL2ds, wideEyeSettings.AeMeetringMaskMode, wideEyeSettings.AeMeetaeMeteringProceduralFalloff, syncElements: true);
				SettingsApplier.ApplyLd(wideEyeSettings.LdEnabled, wideEyeSettings.LdCenter.ToVector2(), wideEyeSettings.LdIntensity, wideEyeSettings.LdScale, wideEyeSettings.LdMultiplyer.X, wideEyeSettings.LdMultiplyer.Y, syncElements: true);
				MelonLogger.Msg("Applied Preset: " + presetName);
			}
		}

		public static void SavePreset(string presetName)
		{
			if (Presets.ContainsKey(presetName))
			{
				WideEyeSettings values = ModMenu.GetValues();
				Presets[presetName] = values;
				string contents = JsonSerializer.Serialize(values, _options);
				File.WriteAllText(Path.Combine(Paths.PresetsPath, presetName + ".json"), contents);
				MelonLogger.Msg("Saved Preset: " + presetName);
			}
		}

		public static void RefreshPresetList()
		{
			string[] files = Directory.GetFiles(Paths.PresetsPath, "*.json");
			foreach (string text in files)
			{
				if (Presets.ContainsKey(Path.GetFileNameWithoutExtension(text)))
				{
					break;
				}
				WideEyeSettings wideEyeSettings = JsonSerializer.Deserialize<WideEyeSettings>(File.ReadAllText(text));
				if (wideEyeSettings != null)
				{
					Presets.Add(wideEyeSettings.Name, wideEyeSettings);
					MelonLogger.Msg("Loaded Preset: " + wideEyeSettings.Name);
				}
				else
				{
					MelonLogger.Error("Preset " + text + " Couldn't be Loaded");
				}
			}
		}

		public static void ViewPath(string presetName)
		{
			string text = Path.Combine(Paths.PresetsPath, presetName + ".json");
			if (File.Exists(text))
			{
				MelonLogger.Msg("Path: " + text);
				Process.Start(new ProcessStartInfo("explorer.exe", "/select, \"" + text + "\""));
			}
		}

		public static void CreatePreset(string presetName)
		{
			presetName = presetName.ToLower();
			WideEyeSettings values = ModMenu.GetValues();
			Presets.Add(presetName, values);
			values.Version = "3.1.0";
			values.Name = presetName;
			string contents = JsonSerializer.Serialize(values, _options);
			File.WriteAllText(Path.Combine(Paths.PresetsPath, presetName + ".json"), contents);
			ModMenu.CreateOnePresetPage(presetName);
			MelonLogger.Msg("Created Preset: " + presetName);
		}
	}
	public static class ResourcesManager
	{
		public static GameObject HandheldCameraPrefab;

		public static GameObject FreeCamIndicatorPrefab;

		public static bool Loaded
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)HandheldCameraPrefab))
				{
					return Object.op_Implicit((Object)(object)FreeCamIndicatorPrefab);
				}
				return true;
			}
		}

		public static void Init()
		{
			SerialisationHandler.Inject<CustomGripEvents>(0);
			SerialisationHandler.Inject<HandheldCameraScript>(0);
			SerialisationHandler.Inject<FreeCam>(0);
			if (File.Exists(Paths.ResourcesPath))
			{
				AssetBundle obj = AssetBundle.LoadFromFile(Paths.ResourcesPath);
				HandheldCameraPrefab = HelperMethods.LoadPersistentAsset<GameObject>(obj, "Handheld Camera");
				FreeCamIndicatorPrefab = HelperMethods.LoadPersistentAsset<GameObject>(obj, "FreeCamIndicator");
			}
		}
	}
	public class WideEyeSettings
	{
		public string Name { get; set; }

		public string Version { get; set; }

		public float FOV { get; set; }

		public float PosSmoothing { get; set; }

		public float RotSmoothing { get; set; }

		public SerializableVector3 PosOffset { get; set; }

		public SerializableVector3 RotOffset { get; set; }

		public bool PostFXEnabled { get; set; }

		public bool CaEnabled { get; set; }

		public float CaIntensity { get; set; }

		public bool LdEnabled { get; set; }

		public SerializableVector2 LdCenter { get; set; }

		public float LdIntensity { get; set; }

		public float LdScale { get; set; }

		public SerializableVector2 LdMultiplyer { get; set; }

		public bool AeEnabled { get; set; }

		public AutoExposureAdaptationMode AeAdaptationMode { get; set; }

		public float AeD2Ls { get; set; }

		public float AeEvComp { get; set; }

		public float AeEvMax { get; set; }

		public float AeEvMin { get; set; }

		public float AeL2ds { get; set; }

		public AutoExposureMeteringMaskMode AeMeetringMaskMode { get; set; }

		public float AeMeetaeMeteringProceduralFalloff { get; set; }

		public AutoExposureMode AeMode { get; set; }
	}
}
namespace WideEye.Core
{
	public static class BuildInfo
	{
		public const string Name = "WideEye";

		public const string Version = "3.1.0";

		public const string Author = "HL2H0";
	}
	public class Mod : MelonMod
	{
		[CompilerGenerated]
		private sealed class <StartWideEye>d__13 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public float waitTime;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <StartWideEye>d__13(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(waitTime);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					SpectatorCameraManager.GetSpectatorCamera(isAuto: true);
					FreeCamManager.Init();
					ModPreferences.LoadPref();
					if (!ResourcesManager.Loaded)
					{
						new ModNotification(ModNotification.ModNotificationType.Force, "Error", "Mod resources isn't loaded correctly or couldn't be found.", (NotificationType)2, 5f).Show();
						MelonLogger.Error("Mod resources isn't loaded correctly or couldn't be found.");
					}
					else
					{
						new ModNotification(ModNotification.ModNotificationType.CameraFound, "Success", "WideEye Has Launched Without errors (=", (NotificationType)3, 2f).Show();
					}
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static PlayerAvatarArt RmPlayerArtComponent;

		public static GameObject ScGameObject;

		public static GameObject StGameObject;

		public static Camera ScCameraComponent;

		public static SmoothFollower ScSmootherComponent;

		public static Transform StTransform;

		public static Volume ScVolumeComponent;

		public static LensDistortion LensDistortionOverride;

		public static ChromaticAberration ChromaticAberrationOverride;

		public static AutoExposure AutoExposureOverride;

		public static bool FoundCamera;

		public override void OnInitializeMelon()
		{
			Paths.InitFolders();
			ResourcesManager.Init();
			ModPreferences.CreatePref();
			PresetsManager.LoadPresets();
			ModMenu.SetupBoneMenu();
			Hooking.OnLevelUnloaded += BoneLib_OnLevelUnloaded;
			Hooking.OnUIRigCreated += BoneLib_OnUIRigCreated;
			((MelonBase)this).LoggerInstance.Msg("WideEye 3.1.0 Has Been Initialized.");
		}

		private void BoneLib_OnUIRigCreated()
		{
			MelonCoroutines.Start(StartWideEye(ModPreferences.StartupDelay));
			MelonLogger.Msg(ConsoleColor.Green, "UI Rig Created, Trying To Get Camera...");
		}

		[IteratorStateMachine(typeof(<StartWideEye>d__13))]
		private static IEnumerator StartWideEye(float waitTime)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <StartWideEye>d__13(0)
			{
				waitTime = waitTime
			};
		}

		private void BoneLib_OnLevelUnloaded()
		{
			FoundCamera = false;
			if (HandheldCameraManager.Spawned)
			{
				Object.Destroy((Object)(object)HandheldCameraManager.HandheldCamera);
				HandheldCameraManager.HandheldCamera = null;
				ModMenu.ViewMode.Value = ModEnums.ViewMode.Head;
			}
		}
	}
	public static class ModEnums
	{
		public enum OffsetType
		{
			Position,
			Rotation
		}

		public enum ResetType
		{
			Fov,
			Smoothing,
			RotationOffset,
			PositionOffset,
			LensDistortion,
			ChromaticAberration,
			AutoExposure,
			All
		}

		public enum ViewMode
		{
			Head,
			Handheld,
			FreeCam
		}

		public enum OtherType
		{
			HairMeshes,
			HeadMesh,
			PostFX
		}
	}
}
namespace WideEye.CameraManagers
{
	public static class CameraController
	{
		public static void UpdateView(ModEnums.ViewMode viewMode)
		{
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			switch (viewMode)
			{
			case ModEnums.ViewMode.Head:
				Mod.ScSmootherComponent.targetTransform = Mod.StTransform;
				if (HandheldCameraManager.Spawned)
				{
					HandheldCameraManager.ActiveHandheldCameraScript.SyncCamera = null;
				}
				FreeCamManager.FreeCamObject.SetActive(false);
				break;
			case ModEnums.ViewMode.Handheld:
				if (HandheldCameraManager.Spawned)
				{
					Mod.ScSmootherComponent.targetTransform = HandheldCameraManager.ActiveHandheldCameraScript.cameraTarget;
					FreeCamManager.FreeCamObject.SetActive(false);
				}
				break;
			case ModEnums.ViewMode.FreeCam:
				Mod.ScSmootherComponent.targetTransform = FreeCamManager.FreeCamObject.transform;
				if (HandheldCameraManager.Spawned)
				{
					HandheldCameraManager.ActiveHandheldCameraScript.SyncCamera = null;
				}
				FreeCamManager.FreeCamObject.transform.position = Player.Head.position;
				FreeCamManager.FreeCamObject.transform.rotation = Player.Head.rotation;
				FreeCamManager.FreeCamObject.SetActive(true);
				break;
			}
		}
	}
	public static class FreeCamManager
	{
		private static FreeCam _freeCam;

		private static GameObject _indicator;

		public static GameObject FreeCamObject { get; private set; }

		public static float MoveSpeed
		{
			get
			{
				return _freeCam.moveSpeed;
			}
			set
			{
				_freeCam.moveSpeed = value;
			}
		}

		public static float FastMoveSpeed
		{
			get
			{
				return _freeCam.fastMoveSpeed;
			}
			set
			{
				_freeCam.fastMoveSpeed = value;
			}
		}

		public static float Sensitivity
		{
			get
			{
				return _freeCam.sensitivity;
			}
			set
			{
				_freeCam.sensitivity = value;
			}
		}

		public static float SmoothSpeed
		{
			get
			{
				return _freeCam.smoothSpeed;
			}
			set
			{
				_freeCam.smoothSpeed = value;
			}
		}

		public static float ScrollSensitivity
		{
			get
			{
				return _freeCam.scrollSensitivity;
			}
			set
			{
				_freeCam.scrollSensitivity = value;
			}
		}

		public static float ScrollSmoothing
		{
			get
			{
				return _freeCam.scrollSmoothing;
			}
			set
			{
				_freeCam.scrollSmoothing = value;
			}
		}

		public static bool ShowIndicator
		{
			get
			{
				return _indicator.activeSelf;
			}
			set
			{
				_indicator.SetActive(value);
			}
		}

		public static void Init()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			FreeCamObject = new GameObject("[WideEye] FreeCam");
			_indicator = Object.Instantiate<GameObject>(ResourcesManager.FreeCamIndicatorPrefab, FreeCamObject.transform);
			_freeCam = FreeCamObject.AddComponent<FreeCam>();
			FreeCamObject.SetActive(false);
			_indicator.SetActive(false);
		}
	}
	public static class HandheldCameraManager
	{
		public static GameObject HandheldCamera;

		public static HandheldCameraScript ActiveHandheldCameraScript;

		public static bool Spawned => Object.op_Implicit((Object)(object)HandheldCamera);

		public static void SpawnHandheldCamera()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			if (!Spawned)
			{
				Vector3 val = Player.Head.position + Player.Head.forward * 1f;
				HandheldCamera = Object.Instantiate<GameObject>(ResourcesManager.HandheldCameraPrefab, val, Quaternion.identity);
				((Object)HandheldCamera).name = "[WideEye] Handheld Camera";
				ActiveHandheldCameraScript = HandheldCamera.GetComponent<HandheldCameraScript>();
				HandheldCamera.transform.position = val;
			}
		}

		public static void DestroyHandheldCamera()
		{
			if (Spawned)
			{
				Object.Destroy((Object)(object)HandheldCamera);
				HandheldCamera = null;
				CameraController.UpdateView(ModEnums.ViewMode.Head);
			}
		}

		public static void TeleportHandheldCamera()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (Spawned)
			{
				Vector3 position = Player.Head.position + Player.Head.forward * 0.5f;
				HandheldCamera.transform.position = position;
			}
		}
	}
	public static class SpectatorCameraManager
	{
		public static void GetSpectatorCamera(bool isAuto)
		{
			if (HelperMethods.IsAndroid())
			{
				new ModNotification(ModNotification.ModNotificationType.Force, "WideEye | Error", "WideEye doesn't work with Quest", (NotificationType)2, 3f).Show();
				return;
			}
			Mod.ScGameObject = GameObject.Find("GameplaySystems [0]/DisabledContainer/Spectator Camera/Spectator Camera");
			Mod.StGameObject = GameObject.Find("RigManager(bonelab) [0]/VRControllerRig/TrackingSpace/Headset/Spectator Target");
			if (!Object.op_Implicit((Object)(object)Mod.ScGameObject) || !Object.op_Implicit((Object)(object)Mod.StGameObject))
			{
				if (isAuto)
				{
					new ModNotification(ModNotification.ModNotificationType.Force, "WideEye | Error", "Couldn't find the camera automatically.\nChange startup delay then reload the map", (NotificationType)2, 3f).Show();
					MelonLogger.Error("Couldn't find the camera automatically");
					ModMenu.MainPage.Add((Element)(object)ModMenu.GetCameraButton);
				}
				else
				{
					new ModNotification(ModNotification.ModNotificationType.Force, "WideEye | Error", "Couldn't find the camera.", (NotificationType)2, 3f).Show();
					MelonLogger.Error("Couldn't find the camera");
				}
			}
			else if (!Mod.FoundCamera)
			{
				if (!Mod.ScGameObject.active)
				{
					new ModNotification(ModNotification.ModNotificationType.CameraDisabled, "WideEye | Warning", "Spectator Camera Is Not Active.\nModifications will not take action.", (NotificationType)1, 3f).Show();
					MelonLogger.Warning("Spectator Camera Is Not Active. Modifications will not take action.");
				}
				Mod.RmPlayerArtComponent = ((Component)Player.ControllerRig).gameObject.GetComponent<PlayerAvatarArt>();
				Mod.StTransform = Mod.StGameObject.GetComponent<Transform>();
				Mod.ScSmootherComponent = Mod.ScGameObject.GetComponent<SmoothFollower>();
				Mod.ScVolumeComponent = Mod.ScGameObject.GetComponent<Volume>();
				Mod.ScCameraComponent = Mod.ScGameObject.GetComponent<Camera>();
				GetPostFXOverrides();
				if (isAuto)
				{
					MelonLogger.Msg(ConsoleColor.Green, "Found camera automatically");
				}
				else
				{
					ModMenu.MainPage.Remove((Element)(object)ModMenu.GetCameraButton);
					new ModNotification(ModNotification.ModNotificationType.CameraFound, "WideEye | Success", "Found camera manually", (NotificationType)3, 3f).Show();
					MelonLogger.Msg(ConsoleColor.Green, "Found camera manually");
				}
				Mod.FoundCamera = true;
			}
		}

		private static void GetPostFXOverrides()
		{
			Mod.ScVolumeComponent.profile.TryGet<LensDistortion>(ref Mod.LensDistortionOverride);
			Mod.ScVolumeComponent.profile.TryGet<ChromaticAberration>(ref Mod.ChromaticAberrationOverride);
			Mod.ScVolumeComponent.profile.TryGet<AutoExposure>(ref Mod.AutoExposureOverride);
		}
	}
}
namespace WideEye.Behaviors
{
	public class CustomGripEvents : MonoBehaviour
	{
		public Grip grip;

		public UnityEvent onIndex;

		public UnityEvent onMenuButtonDown;

		private void Update()
		{
			BaseController val = default(BaseController);
			if (grip.GetController(ref val))
			{
				if (val.GetPrimaryInteractionButton())
				{
					onIndex.Invoke();
				}
				if (val.GetMenuButtonDown())
				{
					onMenuButtonDown.Invoke();
				}
			}
		}
	}
	public class FreeCam : MonoBehaviour
	{
		public float moveSpeed = 3f;

		public float fastMoveSpeed = 7f;

		public float sensitivity = 3f;

		public float smoothSpeed = 10f;

		public float scrollSensitivity = 15f;

		public float scrollSmoothing = 10f;

		private bool _isLooking;

		private bool _enableFreeCam = true;

		private Vector3 _targetPosition;

		private float _currentScrollValue;

		private float _targetScrollValue;

		private void Start()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			_targetPosition = ((Component)this).transform.position;
			_targetScrollValue = ModMenu.FOVSlider.Value;
		}

		private void Update()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			if (!_enableFreeCam)
			{
				return;
			}
			if (Input.GetKeyDown((KeyCode)324))
			{
				_isLooking = true;
				Cursor.lockState = (CursorLockMode)1;
				Cursor.visible = false;
			}
			if (Input.GetKeyUp((KeyCode)324))
			{
				_isLooking = false;
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
			}
			if (_isLooking)
			{
				float num = ((Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303)) ? fastMoveSpeed : moveSpeed);
				float axis = Input.GetAxis("Mouse ScrollWheel");
				Vector3 val = Vector3.zero;
				if (Input.GetKey((KeyCode)97))
				{
					val += -((Component)this).transform.right;
				}
				if (Input.GetKey((KeyCode)100))
				{
					val += ((Component)this).transform.right;
				}
				if (Input.GetKey((KeyCode)119))
				{
					val += ((Component)this).transform.forward;
				}
				if (Input.GetKey((KeyCode)115))
				{
					val += -((Component)this).transform.forward;
				}
				if (Input.GetKey((KeyCode)113))
				{
					val += -((Component)this).transform.up;
				}
				if (Input.GetKey((KeyCode)101))
				{
					val += ((Component)this).transform.up;
				}
				if (Input.GetKeyDown((KeyCode)114))
				{
					((Component)this).transform.position = Player.Head.position;
					_targetPosition = ((Component)this).transform.position;
					_targetScrollValue = ModMenu.FOVSlider.Value;
					_currentScrollValue = _targetScrollValue;
				}
				_targetScrollValue += axis * scrollSensitivity;
				_targetScrollValue = MathF.Floor(_targetScrollValue);
				_currentScrollValue = Mathf.Lerp(_currentScrollValue, _targetScrollValue, scrollSmoothing * Time.deltaTime);
				((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, _targetPosition, smoothSpeed * Time.deltaTime);
				SettingsApplier.ApplyFOV(_currentScrollValue, syncElementValue: true, ModMenu.FOVSlider);
				_targetPosition += ((Vector3)(ref val)).normalized * (num * Time.deltaTime);
				if (_isLooking)
				{
					float num2 = ((Component)this).transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivity;
					float num3 = ((Component)this).transform.localEulerAngles.x - Input.GetAxis("Mouse Y") * sensitivity;
					((Component)this).transform.localEulerAngles = new Vector3(num3, num2, 0f);
				}
			}
		}

		private void OnDisable()
		{
			Cursor.lockState = (CursorLockMode)0;
			Cursor.visible = true;
			_isLooking = false;
			_enableFreeCam = false;
		}

		private void OnEnable()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			_enableFreeCam = true;
			Cursor.lockState = (CursorLockMode)1;
			Cursor.visible = false;
			_targetPosition = ((Component)this).transform.position;
			_targetScrollValue = ModMenu.FOVSlider.Value;
		}
	}
	public class HandheldCameraScript : MonoBehaviour
	{
		public Transform cameraTarget;

		public Light cameraLight;

		public GameObject previewParent;

		public Camera previewCamera;

		public TextMeshPro fovLabel;

		public TextMeshPro lightIntensityLabel;

		private Rigidbody _rb;

		private bool _isTarget;

		private Color[] _colors = (Color[])(object)new Color[7]
		{
			Color.white,
			Color.red,
			Color.yellow,
			Color.green,
			Color.blue,
			Color.cyan,
			Color.magenta
		};

		private int _currentColorIndex;

		public float FOV
		{
			get
			{
				return previewCamera.fieldOfView;
			}
			set
			{
				previewCamera.fieldOfView = value;
				if (_isTarget)
				{
					SyncCamera.fieldOfView = value;
				}
				((TMP_Text)fovLabel).text = $"FOV : {MathF.Round(value, 2)}";
			}
		}

		public Camera SyncCamera { get; set; }

		private void Start()
		{
			_rb = ((Component)this).GetComponent<Rigidbody>();
			((TMP_Text)fovLabel).text = $"FOV : {FOV}";
			((TMP_Text)lightIntensityLabel).text = "Light Intensity : " + ((TMP_Text)lightIntensityLabel).text;
		}

		private void Update()
		{
			_isTarget = Object.op_Implicit((Object)(object)SyncCamera);
		}

		public void ToggleKinematic()
		{
			_rb.isKinematic = !_rb.isKinematic;
		}

		public void ToggleLight()
		{
			cameraLight.intensity = (cameraLight.intensity + 1f) % 5f;
			((TMP_Text)lightIntensityLabel).text = $"Light Intensity : {cameraLight.intensity}";
		}

		public void ToggleLightColor()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			_currentColorIndex = (_currentColorIndex + 1) % _colors.Length;
			cameraLight.color = _colors[_currentColorIndex];
		}

		public void AddFOV(float fov)
		{
			FOV += fov;
		}

		public void TogglePreview()
		{
			previewParent.SetActive(!previewParent.activeSelf);
		}
	}
}