Decompiled source of WideEye v2.1.0

Mods/WideEye.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Diagnostics;
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 BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppOccaSoftware.Exposure.Runtime;
using Il2CppSLZ.Bonelab;
using Il2CppSLZ.Marrow;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using WideEye;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Mod), "WideEye", "2.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+72fc21a246a05e05768a026b7dad1eb3ca09253c")]
[assembly: AssemblyProduct("WideEye")]
[assembly: AssemblyTitle("WideEye")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.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
{
	public static class MenuSetup
	{
		public static FunctionElement GetCameraButton = new FunctionElement("Get Camera", Color.red, (Action)delegate
		{
			Mod.GetTargetCamera(isAuto: false);
		});

		public static Page MainPage;

		public static FloatElement FOVSlider { get; private set; }

		private static Page SmoothingPage { get; set; }

		public static FloatElement PSmoothing { get; private set; }

		public static FloatElement RSmoothing { get; private set; }

		private static Page OffsetPage { get; set; }

		private static Page RotationOffsetPage { get; 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; }

		private static Page PostFXPage { get; set; }

		public static BoolElement PostFXToggle { get; private set; }

		private static Page OtherPage { get; set; }

		public static BoolElement AutoSave { get; set; }

		private static Page CameraModePage { get; set; }

		public static BoolElement EleLookAtPlayer { get; private set; }

		private static Page SupportPage { get; set; }

		private static Page LensDistortionPage { get; 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; }

		private static Page ChromaticAberrationPage { get; set; }

		public static BoolElement CaEnabled { get; private set; }

		public static FloatElement CaIntensity { get; private set; }

		private static Page AutoExposurePage { get; 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 NotificationSettingsPage { get; 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 void SetupBoneMenu()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_057f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_0663: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0703: Unknown result type (might be due to invalid IL or missing references)
			//IL_071e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0739: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_081d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0851: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0904: Unknown result type (might be due to invalid IL or missing references)
			//IL_0950: Unknown result type (might be due to invalid IL or missing references)
			//IL_0974: Unknown result type (might be due to invalid IL or missing references)
			//IL_097e: Expected O, but got Unknown
			//IL_0988: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a69: Expected O, but got Unknown
			//IL_0a73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac2: Expected O, but got Unknown
			//IL_0acc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b39: Expected O, but got Unknown
			//IL_0b43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd4: Expected O, but got Unknown
			//IL_0cde: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0d: Expected O, but got Unknown
			//IL_0d17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d45: Expected O, but got Unknown
			//IL_0d4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d79: Expected O, but got Unknown
			//IL_0d83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dad: Expected O, but got Unknown
			//IL_0db7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e00: Expected O, but got Unknown
			//IL_0e0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e38: Expected O, but got Unknown
			//IL_0e42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e52: Expected O, but got Unknown
			MainPage = Page.Root.CreatePage("Wide Eye", Color.white, 0, true);
			FOVSlider = MainPage.CreateFloat("FOV", Color.cyan, 72f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate(float value)
			{
				Mod.ApplyFOV(value);
			});
			MainPage.Add((Element)new FunctionElement("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.ResetType.Fov);
			}));
			MainPage.Add((Element)new FunctionElement("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)
			{
				Mod.ApplyOther(Mod.OtherType.PostFX, value);
			});
			LensDistortionPage = PostFXPage.CreatePage("Lens Distortion", Color.white, 0, true);
			LdEnabled = LensDistortionPage.CreateBool("Enabled", Color.white, true, (Action<bool>)delegate
			{
				Mod.ApplyLd();
			});
			LdCenterX = LensDistortionPage.CreateFloat("Center X", Color.red, 0.5f, 0.1f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyLd();
			});
			LdCenterY = LensDistortionPage.CreateFloat("Center Y", Color.green, 0.5f, 0.1f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyLd();
			});
			LdIntensity = LensDistortionPage.CreateFloat("Intensity", Color.white, 0.48f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyLd();
			});
			LdScale = LensDistortionPage.CreateFloat("Scale", Color.white, 1f, 0.1f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyLd();
			});
			LdXMultiplier = LensDistortionPage.CreateFloat("X Multiplier", Color.red, 0.59f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyLd();
			});
			LdYMultiplier = LensDistortionPage.CreateFloat("Y Multiplier", Color.green, 1f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyLd();
			});
			LensDistortionPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.ResetType.LensDistortion);
			});
			ChromaticAberrationPage = PostFXPage.CreatePage("ChromaticAberration", Color.white, 0, true);
			CaEnabled = ChromaticAberrationPage.CreateBool("Enabled", Color.white, true, (Action<bool>)delegate
			{
				Mod.ApplyCa();
			});
			CaIntensity = ChromaticAberrationPage.CreateFloat("Intensity", Color.white, 0.123f, 0.01f, 0f, 1f, (Action<float>)delegate
			{
				Mod.ApplyCa();
			});
			ChromaticAberrationPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.ResetType.ChromaticAberration);
			});
			AutoExposurePage = PostFXPage.CreatePage("AutoExposure", Color.white, 0, true);
			AeEnabled = AutoExposurePage.CreateBool("Enabled", Color.white, true, (Action<bool>)delegate
			{
				Mod.ApplyAe();
			});
			AeAdaptationMode = AutoExposurePage.CreateEnum("Adaptation Mode", Color.white, (Enum)(object)(AutoExposureAdaptationMode)0, (Action<Enum>)delegate
			{
				Mod.ApplyAe();
			});
			AeD2Ls = AutoExposurePage.CreateFloat("Dark To Light Speed", Color.white, 3f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyAe();
			});
			AeEvCompensation = AutoExposurePage.CreateFloat("EV Compensation", Color.white, 2.5f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyAe();
			});
			AeEvMax = AutoExposurePage.CreateFloat("EV Max", Color.white, 1.2f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyAe();
			});
			AeEvMin = AutoExposurePage.CreateFloat("EV Min", Color.white, -1.2f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyAe();
			});
			AeL2Ds = AutoExposurePage.CreateFloat("Light To Dark Speed", Color.white, 1f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.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
			{
				Mod.ApplyAe();
			});
			AutoExposurePage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.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
			{
				Mod.ApplyOffset(Mod.OffsetType.Rotation);
			});
			YrOffset = RotationOffsetPage.CreateFloat("Y Rotation Offset", Color.green, 0f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyOffset(Mod.OffsetType.Rotation);
			});
			ZrOffset = RotationOffsetPage.CreateFloat("Z Rotation Offset", Color.blue, 0f, 1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyOffset(Mod.OffsetType.Rotation);
			});
			RotationOffsetPage.CreateFunction("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.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
			{
				Mod.ApplyOffset(Mod.OffsetType.Position);
			});
			YpOffset = PositionOffsetPage.CreateFloat("Y Position Offset", Color.green, 0f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyOffset(Mod.OffsetType.Position);
			});
			ZpOffset = PositionOffsetPage.CreateFloat("Z Position Offset", Color.blue, 0f, 0.1f, float.MinValue, float.MaxValue, (Action<float>)delegate
			{
				Mod.ApplyOffset(Mod.OffsetType.Position);
			});
			PositionOffsetPage.Add((Element)new FunctionElement("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.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
			{
				Mod.ApplySmoothing();
			});
			RSmoothing = SmoothingPage.CreateFloat("Rotation Smoothing", Color.white, 0f, 1f, float.MinValue, 2.1474836E+09f, (Action<float>)delegate
			{
				Mod.ApplySmoothing();
			});
			SmoothingPage.Add((Element)new FunctionElement("Reset To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.ResetType.Smoothing);
			}));
			CameraModePage = MainPage.CreatePage("Camera Mode", Color.white, 0, true);
			CameraModePage.Add((Element)new EnumElement("Camera Mode", Color.white, (Enum)Mod.CameraModeType.Head, (Action<Enum>)delegate(Enum value)
			{
				Mod.ApplyCameraMode((Mod.CameraModeType)(object)value);
			}));
			EleLookAtPlayer = CameraModePage.CreateBool("Look At Player", Color.white, false, (Action<bool>)delegate(bool value)
			{
				Mod.LookAtPlayer = value;
			});
			CameraModePage.Add((Element)new EnumElement("Look At :", Color.white, (Enum)Mod.LookAtPositionType.Head, (Action<Enum>)delegate(Enum value)
			{
				Mod.ApplyLookAtTransform((Mod.LookAtPositionType)(object)value);
			}));
			NotificationSettingsPage = MainPage.CreatePage("Notification Settings", Color.magenta, 0, true);
			PrefNotifi = NotificationSettingsPage.CreateBool("Preferences Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			CameraDisabledNotifi = NotificationSettingsPage.CreateBool("Camera Disabled Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			CameraFoundNotifi = NotificationSettingsPage.CreateBool("Camera Found Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			OtherNotifi = NotificationSettingsPage.CreateBool("Other Notifications", Color.white, true, (Action<bool>)delegate
			{
				ModNotification.ChangeSilentNotification();
			});
			NotificationSettingsPage.ElementSpacing = 100f;
			OtherPage = MainPage.CreatePage("Other", Color.gray, 0, true);
			AutoSave = OtherPage.CreateBool("Auto Save (Experimental)", Color.yellow, false, (Action<bool>)delegate(bool v)
			{
				ModPreferences.AutoSave = v;
			});
			OtherPage.Add((Element)new BoolElement("Head Meshes", Color.yellow, true, (Action<bool>)delegate(bool value)
			{
				Mod.ApplyOther(Mod.OtherType.HeadMesh, value);
			}));
			OtherPage.Add((Element)new BoolElement("Hair Meshes", Color.yellow, true, (Action<bool>)delegate(bool value)
			{
				Mod.ApplyOther(Mod.OtherType.HairMeshes, value);
			}));
			OtherPage.Add((Element)new FunctionElement("Reset All To Default", Color.red, (Action)delegate
			{
				Mod.ResetToDefault(Mod.ResetType.All);
			}));
			OtherPage.Add((Element)new FunctionElement("Load Preferences", Color.green, (Action)ModPreferences.LoadPref));
			OtherPage.Add((Element)new FunctionElement("Clear All Preferences", Color.red, (Action)ModPreferences.ClearPref));
			SupportPage = OtherPage.CreatePage("Support", Color.white, 0, true);
			SupportPage.Add((Element)new FunctionElement("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.Add((Element)new FunctionElement("Discord", Color.blue, (Action)delegate
			{
				GUIUtility.systemCopyBuffer = "@hiiiiiiiiiiiiiiiiii";
				new ModNotification(ModNotification.ModNotificationType.Other, "WideEye | Success", "Copied username to clipboard", (NotificationType)3, 2f).Show();
			}));
			SupportPage.Add((Element)new FunctionElement("Version : 2.1.0", Color.white, (Action)null));
		}
	}
	public static class BuildInfo
	{
		public const string Name = "WideEye";

		public const string Version = "2.1.0";

		public const string Author = "HL2H0";
	}
	public class Mod : MelonMod
	{
		public enum OffsetType
		{
			Position,
			Rotation
		}

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

		public enum CameraModeType
		{
			Head,
			Pinned
		}

		public enum LookAtPositionType
		{
			RightHand,
			LeftHand,
			Head
		}

		public enum OtherType
		{
			HairMeshes,
			HeadMesh,
			PostFX
		}

		private static PlayerAvatarArt _rmPlayerArtComponent;

		private static GameObject _scGameObject;

		private static GameObject _stGameObject;

		private static Camera _scCameraComponent;

		private static SmoothFollower _scSmootherComponent;

		private static Transform _stTransform;

		private static Volume _scVolumeComponent;

		private static LensDistortion _lensDistortionOverride;

		private static ChromaticAberration _chromaticAberrationOverride;

		private static AutoExposure _autoExposureOverride;

		private static Transform _lookAtTransform;

		private static CameraModeType _cameraMode;

		public static bool LookAtPlayer;

		private static bool _foundCamera;

		public override void OnInitializeMelon()
		{
			ModPreferences.CreatePref();
			MenuSetup.SetupBoneMenu();
			Hooking.OnLevelUnloaded += BoneLib_OnLevelUnloaded;
			Hooking.OnUIRigCreated += BoneLib_OnUIRigCreated;
			((MelonBase)this).LoggerInstance.Msg("WideEye 2.1.0 Has Been Initialized.");
		}

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

		private void BoneLib_OnLevelUnloaded()
		{
			_cameraMode = CameraModeType.Head;
			_foundCamera = false;
			LookAtPlayer = false;
			MenuSetup.EleLookAtPlayer.Value = false;
		}

		public override void OnUpdate()
		{
			((MelonBase)this).OnUpdate();
			if (LookAtPlayer && _cameraMode == CameraModeType.Pinned && _foundCamera)
			{
				_scGameObject.transform.LookAt(_lookAtTransform);
			}
		}

		private static IEnumerator WaitForCameraRig()
		{
			yield return (object)new WaitForSeconds(3f);
			GetTargetCamera(isAuto: true);
		}

		public static void GetTargetCamera(bool isAuto)
		{
			if (HelperMethods.IsAndroid())
			{
				new ModNotification(ModNotification.ModNotificationType.Force, "WideEye | Error", "WideEye doesn't work with Android", (NotificationType)2, 3f).Show();
				return;
			}
			_scGameObject = GameObject.Find("GameplaySystems [0]/DisabledContainer/Spectator Camera/Spectator Camera");
			_stGameObject = GameObject.Find("RigManager(bonelab) [0]/VRControllerRig/TrackingSpace/Headset/Spectator Target");
			if ((Object)(object)_scGameObject == (Object)null || (Object)(object)_stGameObject == (Object)null)
			{
				if (isAuto)
				{
					new ModNotification(ModNotification.ModNotificationType.Force, "WideEye | Error", "Couldn't find the camera automatically.\nPlease open WideEye's menu and find it manually.", (NotificationType)2, 3f).Show();
					MelonLogger.Error("Couldn't find the camera automatically");
					MenuSetup.MainPage.Add((Element)(object)MenuSetup.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 (!_foundCamera)
			{
				if (!_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.");
				}
				_rmPlayerArtComponent = ((Component)Player.ControllerRig).gameObject.GetComponent<PlayerAvatarArt>();
				_stTransform = _stGameObject.GetComponent<Transform>();
				_scSmootherComponent = _scGameObject.GetComponent<SmoothFollower>();
				_scVolumeComponent = _scGameObject.GetComponent<Volume>();
				_scCameraComponent = _scGameObject.GetComponent<Camera>();
				GetPostFXOverrides();
				if (isAuto)
				{
					new ModNotification(ModNotification.ModNotificationType.CameraFound, "WideEye | Success", "Found camera automatically", (NotificationType)3, 3f).Show();
					MelonLogger.Msg(ConsoleColor.Green, "Found camera automatically");
				}
				else
				{
					MenuSetup.MainPage.Remove((Element)(object)MenuSetup.GetCameraButton);
					new ModNotification(ModNotification.ModNotificationType.CameraFound, "WideEye | Success", "Found camera manually", (NotificationType)3, 3f).Show();
					MelonLogger.Msg(ConsoleColor.Green, "Found camera manually");
				}
				ModPreferences.LoadPref();
				_foundCamera = true;
				_lookAtTransform = ((Component)Player.Head).transform;
			}
		}

		private static void GetPostFXOverrides()
		{
			_scVolumeComponent.profile.TryGet<LensDistortion>(ref _lensDistortionOverride);
			_scVolumeComponent.profile.TryGet<ChromaticAberration>(ref _chromaticAberrationOverride);
			_scVolumeComponent.profile.TryGet<AutoExposure>(ref _autoExposureOverride);
		}

		public static void ResetToDefault(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 ResetType.Fov:
				ApplyFOV(75f, syncElementValue: true, MenuSetup.FOVSlider);
				break;
			case ResetType.Smoothing:
				ApplySmoothing(0f, 0f, syncElementValue: true);
				break;
			case ResetType.RotationOffset:
				ApplyOffset(new Vector3(11f, 0f, 0f), OffsetType.Rotation, syncElementValue: true, MenuSetup.XROffset, MenuSetup.YrOffset, MenuSetup.ZrOffset);
				break;
			case ResetType.PositionOffset:
				ApplyOffset(new Vector3(0f, 0f, 0f), OffsetType.Position, syncElementValue: true, MenuSetup.XpOffset, MenuSetup.YpOffset, MenuSetup.ZpOffset);
				break;
			case ResetType.LensDistortion:
				ApplyLd(enabled: true, new Vector2(0.5f, 0.5f), 0.48f, 1f, 0.59f, 1f, syncElements: true);
				break;
			case ResetType.ChromaticAberration:
				ApplyCa(enabled: true, 0.123f, syncElements: true);
				break;
			case ResetType.AutoExposure:
				ApplyAe(enabled: true, (AutoExposureAdaptationMode)0, 3f, 2.5f, 1.2f, -1.2f, 1f, (AutoExposureMeteringMaskMode)0, 2f, syncElements: true);
				break;
			case ResetType.All:
				ApplyFOV(75f, syncElementValue: true, MenuSetup.FOVSlider);
				ApplySmoothing(0f, 0f, syncElementValue: true);
				ApplyOffset(new Vector3(11f, 0f, 0f), OffsetType.Rotation, syncElementValue: true, MenuSetup.XROffset, MenuSetup.YrOffset, MenuSetup.ZrOffset);
				ApplyOffset(new Vector3(0f, 0f, 0f), OffsetType.Position, syncElementValue: true, MenuSetup.XpOffset, MenuSetup.YpOffset, MenuSetup.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)_scVolumeComponent).enabled = true;
				MenuSetup.PostFXToggle.Value = true;
				break;
			}
		}

		public static void ApplyCameraMode(CameraModeType modeType)
		{
			_cameraMode = modeType;
			switch (modeType)
			{
			case CameraModeType.Head:
				((Behaviour)_scSmootherComponent).enabled = true;
				LookAtPlayer = false;
				MenuSetup.EleLookAtPlayer.Value = false;
				break;
			case CameraModeType.Pinned:
				((Behaviour)_scSmootherComponent).enabled = false;
				break;
			}
		}

		public static void ApplyLookAtTransform(LookAtPositionType type)
		{
			switch (type)
			{
			case LookAtPositionType.Head:
				_lookAtTransform = ((Component)Player.Head).transform;
				break;
			case LookAtPositionType.RightHand:
				_lookAtTransform = ((Component)Player.RightHand).transform;
				break;
			case LookAtPositionType.LeftHand:
				_lookAtTransform = ((Component)Player.LeftHand).transform;
				break;
			}
		}

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

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

		public static void ApplyOffset(Vector3 offset, 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 OffsetType.Position:
				_stTransform.localPosition = offset;
				break;
			case OffsetType.Rotation:
				_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(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 OffsetType.Rotation:
				_stTransform.localRotation = Quaternion.Euler(MenuSetup.XROffset.Value, MenuSetup.YrOffset.Value, MenuSetup.ZrOffset.Value);
				break;
			case OffsetType.Position:
				_stTransform.localPosition = new Vector3(MenuSetup.XpOffset.Value, MenuSetup.YpOffset.Value, MenuSetup.ZpOffset.Value);
				break;
			}
			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)_lensDistortionOverride).active = enabled;
			((VolumeParameter<Vector2>)(object)_lensDistortionOverride.center).value = center;
			((VolumeParameter<float>)(object)_lensDistortionOverride.intensity).value = intensity;
			((VolumeParameter<float>)(object)_lensDistortionOverride.scale).value = scale;
			((VolumeParameter<float>)(object)_lensDistortionOverride.xMultiplier).value = xMulti;
			((VolumeParameter<float>)(object)_lensDistortionOverride.yMultiplier).value = yMulti;
			if (syncElements)
			{
				MenuSetup.LdEnabled.Value = enabled;
				MenuSetup.LdCenterX.Value = center.x;
				MenuSetup.LdCenterY.Value = center.y;
				MenuSetup.LdIntensity.Value = intensity;
				MenuSetup.LdScale.Value = scale;
				MenuSetup.LdXMultiplier.Value = xMulti;
				MenuSetup.LdYMultiplier.Value = yMulti;
			}
		}

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

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

		public static void ApplyCa()
		{
			((VolumeComponent)_chromaticAberrationOverride).active = MenuSetup.CaEnabled.Value;
			((VolumeParameter<float>)(object)_chromaticAberrationOverride.intensity).value = MenuSetup.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)_autoExposureOverride).active = enabled;
			((VolumeParameter<AutoExposureAdaptationMode>)(object)_autoExposureOverride.adaptationMode).value = adaptationMode;
			((VolumeParameter<float>)(object)_autoExposureOverride.darkToLightSpeed).value = d2Ls;
			((VolumeParameter<float>)(object)_autoExposureOverride.evCompensation).value = evCompen;
			((VolumeParameter<float>)(object)_autoExposureOverride.evMax).value = evMax;
			((VolumeParameter<float>)(object)_autoExposureOverride.evMin).value = evMin;
			((VolumeParameter<float>)(object)_autoExposureOverride.lightToDarkSpeed).value = l2Ds;
			((VolumeParameter<AutoExposureMeteringMaskMode>)(object)_autoExposureOverride.meteringMaskMode).value = meteringMaskMode;
			((VolumeParameter<float>)(object)_autoExposureOverride.meteringProceduralFalloff).value = meteringProceduralFalloff;
			if (syncElements)
			{
				MenuSetup.AeEnabled.Value = enabled;
				MenuSetup.AeAdaptationMode.Value = (Enum)(object)adaptationMode;
				MenuSetup.AeD2Ls.Value = d2Ls;
				MenuSetup.AeEvCompensation.Value = evCompen;
				MenuSetup.AeEvMax.Value = evMax;
				MenuSetup.AeEvMin.Value = evMin;
				MenuSetup.AeL2Ds.Value = l2Ds;
				MenuSetup.AeMeteringMaskMode.Value = (Enum)(object)meteringMaskMode;
				MenuSetup.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)_autoExposureOverride).active = MenuSetup.AeEnabled.Value;
			((VolumeParameter<AutoExposureAdaptationMode>)(object)_autoExposureOverride.adaptationMode).value = (AutoExposureAdaptationMode)(object)MenuSetup.AeAdaptationMode.Value;
			((VolumeParameter<float>)(object)_autoExposureOverride.darkToLightSpeed).value = MenuSetup.AeD2Ls.Value;
			((VolumeParameter<float>)(object)_autoExposureOverride.evCompensation).value = MenuSetup.AeEvCompensation.Value;
			((VolumeParameter<float>)(object)_autoExposureOverride.evMax).value = MenuSetup.AeEvMax.Value;
			((VolumeParameter<float>)(object)_autoExposureOverride.evMin).value = MenuSetup.AeEvMin.Value;
			((VolumeParameter<float>)(object)_autoExposureOverride.lightToDarkSpeed).value = MenuSetup.AeL2Ds.Value;
			((VolumeParameter<AutoExposureMeteringMaskMode>)(object)_autoExposureOverride.meteringMaskMode).value = (AutoExposureMeteringMaskMode)(object)MenuSetup.AeMeteringMaskMode.Value;
			((VolumeParameter<float>)(object)_autoExposureOverride.meteringProceduralFalloff).value = MenuSetup.AeMeteringProceduralFalloff.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}

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

		public static void ApplySmoothing()
		{
			_scSmootherComponent.RotationalSmoothTime = MenuSetup.RSmoothing.Value;
			_scSmootherComponent.TranslationSmoothTime = MenuSetup.PSmoothing.Value;
			if (ModPreferences.AutoSave)
			{
				ModPreferences.SavePref();
			}
		}
	}
	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 = MenuSetup.OtherNotifi.Value;
			_showPreferences = MenuSetup.PrefNotifi.Value;
			_showCameraDisabled = MenuSetup.CameraDisabledNotifi.Value;
			_showCameraFound = MenuSetup.CameraFoundNotifi.Value;
			_showCameraDisabled = MenuSetup.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
			});
		}
	}
	public static class ModPreferences
	{
		public static bool AutoSave;

		public static MelonPreferences_Category CategWideEye;

		private static MelonPreferences_Entry<float> _prefFov;

		private static MelonPreferences_Entry<bool> _prefPostFX;

		private static MelonPreferences_Entry<Vector3> _prefRotationOffset;

		private static MelonPreferences_Entry<Vector3> _prefPositionOffset;

		private static MelonPreferences_Entry<float> _prefRotationSmoothing;

		private static MelonPreferences_Entry<float> _prefPositionSmoothing;

		private static MelonPreferences_Entry<bool> _prefShowOtherNotifi;

		private static MelonPreferences_Entry<bool> _prefShowPrefNotifi;

		private static MelonPreferences_Entry<bool> _prefShowCameraDisabledNotifi;

		private static MelonPreferences_Entry<bool> _prefShowCameraFoundNotifi;

		private static MelonPreferences_Entry<bool> _prefAutoSave;

		private static MelonPreferences_Category _categPfxLd;

		private static MelonPreferences_Entry<bool> _prefLdEnabled;

		private static MelonPreferences_Entry<Vector2> _prefLdCenter;

		private static MelonPreferences_Entry<float> _prefLdIntensity;

		private static MelonPreferences_Entry<float> _prefLdScale;

		private static MelonPreferences_Entry<float> _prefLdXMultiplier;

		private static MelonPreferences_Entry<float> _prefLdYMultiplier;

		private static MelonPreferences_Category _categPfxCa;

		private static MelonPreferences_Entry<bool> _prefCaEnabled;

		private static MelonPreferences_Entry<float> _prefCaIntensity;

		private static MelonPreferences_Category _categPfxAe;

		private static MelonPreferences_Entry<bool> _prefAeEnabled;

		private static MelonPreferences_Entry<AutoExposureAdaptationMode> _prefAeAdaptationMode;

		private static MelonPreferences_Entry<float> _prefAeD2Ls;

		private static MelonPreferences_Entry<float> _prefAeEvCompensation;

		private static MelonPreferences_Entry<float> _prefAeEvMax;

		private static MelonPreferences_Entry<float> _prefAeEvMin;

		private static MelonPreferences_Entry<float> _prefAeL2Ds;

		private static MelonPreferences_Entry<AutoExposureMeteringMaskMode> _prefAeMeteringMask;

		private static MelonPreferences_Entry<float> _prefAeMetProcedFalloff;

		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_0199: Unknown result type (might be due to invalid IL or missing references)
			CategWideEye = MelonPreferences.CreateCategory("WideEye");
			_prefFov = CategWideEye.CreateEntry<float>("Fov", 75f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefPostFX = CategWideEye.CreateEntry<bool>("PostFX", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefRotationOffset = CategWideEye.CreateEntry<Vector3>("RotationOffset", new Vector3(11f, 0f, 0f), (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefPositionOffset = CategWideEye.CreateEntry<Vector3>("PositionOffset", Vector3.zero, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefRotationSmoothing = CategWideEye.CreateEntry<float>("RotationSmoothing", 0f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefPositionSmoothing = CategWideEye.CreateEntry<float>("PositionSmoothing", 0f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefShowOtherNotifi = CategWideEye.CreateEntry<bool>("ShowOtherNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefShowPrefNotifi = CategWideEye.CreateEntry<bool>("ShowPrefNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefShowCameraDisabledNotifi = CategWideEye.CreateEntry<bool>("ShowCameraDisabledNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefShowCameraFoundNotifi = CategWideEye.CreateEntry<bool>("ShowCameraFoundNotification", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAutoSave = CategWideEye.CreateEntry<bool>("AutoSave", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_categPfxLd = MelonPreferences.CreateCategory("WideEye_PostFX_LensDistortion");
			_prefLdEnabled = _categPfxLd.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefLdCenter = _categPfxLd.CreateEntry<Vector2>("Center", new Vector2(0.5f, 0.5f), (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefLdIntensity = _categPfxLd.CreateEntry<float>("Intensity", 0.48f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefLdScale = _categPfxLd.CreateEntry<float>("Scale", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefLdXMultiplier = _categPfxLd.CreateEntry<float>("xMultiplier", 0.59f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefLdYMultiplier = _categPfxLd.CreateEntry<float>("yMultiplier", 0.59f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_categPfxCa = MelonPreferences.CreateCategory("WideEye_PostFX_ChromaticAberration");
			_prefCaEnabled = _categPfxCa.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefCaIntensity = _categPfxCa.CreateEntry<float>("Intensity", 0.123f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_categPfxAe = MelonPreferences.CreateCategory("WideEye_PostFX_AutoExposure");
			_prefAeEnabled = _categPfxAe.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeAdaptationMode = _categPfxAe.CreateEntry<AutoExposureAdaptationMode>("AdaptationMode", (AutoExposureAdaptationMode)0, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeD2Ls = _categPfxAe.CreateEntry<float>("DarkToLightSpeed", 3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeEvCompensation = _categPfxAe.CreateEntry<float>("evCompensation", 2.5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeEvMax = _categPfxAe.CreateEntry<float>("evMax", 1.2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeEvMin = _categPfxAe.CreateEntry<float>("evMin", -1.2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeL2Ds = _categPfxAe.CreateEntry<float>("LightToDarkSpeed", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeMeteringMask = _categPfxAe.CreateEntry<AutoExposureMeteringMaskMode>("MeteringMaskMode", (AutoExposureMeteringMaskMode)0, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			_prefAeMetProcedFalloff = _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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			Mod.ApplyFOV(_prefFov.Value, syncElementValue: true, MenuSetup.FOVSlider);
			Mod.ApplyOther(Mod.OtherType.PostFX, _prefPostFX.Value, syncElement: true);
			MenuSetup.PostFXToggle.Value = _prefPostFX.Value;
			Mod.ApplyOffset(_prefRotationOffset.Value, Mod.OffsetType.Rotation, syncElementValue: true, MenuSetup.XROffset, MenuSetup.YrOffset, MenuSetup.ZrOffset);
			Mod.ApplyOffset(_prefPositionOffset.Value, Mod.OffsetType.Position, syncElementValue: true, MenuSetup.XpOffset, MenuSetup.YpOffset, MenuSetup.ZpOffset);
			Mod.ApplySmoothing(_prefRotationSmoothing.Value, _prefPositionSmoothing.Value, syncElementValue: true);
			ModNotification.ChangeSilentNotification(_prefShowOtherNotifi.Value, _prefShowPrefNotifi.Value, _prefShowCameraDisabledNotifi.Value, _prefShowCameraFoundNotifi.Value, MenuSetup.OtherNotifi, MenuSetup.PrefNotifi, MenuSetup.CameraDisabledNotifi, MenuSetup.CameraFoundNotifi);
			MenuSetup.AutoSave.Value = _prefAutoSave.Value;
			AutoSave = _prefAutoSave.Value;
			Mod.ApplyLd(_prefLdEnabled.Value, _prefLdCenter.Value, _prefLdIntensity.Value, _prefLdScale.Value, _prefLdXMultiplier.Value, _prefLdYMultiplier.Value, syncElements: true);
			Mod.ApplyCa(_prefCaEnabled.Value, _prefCaIntensity.Value, syncElements: true);
			Mod.ApplyAe(_prefAeEnabled.Value, _prefAeAdaptationMode.Value, _prefAeD2Ls.Value, _prefAeEvCompensation.Value, _prefAeEvMax.Value, _prefAeEvMin.Value, _prefAeL2Ds.Value, _prefAeMeteringMask.Value, _prefAeMetProcedFalloff.Value, syncElements: true);
			new ModNotification(ModNotification.ModNotificationType.Preferences, "WideEye | Success", "Loaded Preferences.", (NotificationType)3, 2f).Show();
			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_013b: 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_025d: Unknown result type (might be due to invalid IL or missing references)
			_prefFov.Value = MenuSetup.FOVSlider.Value;
			_prefPostFX.Value = MenuSetup.PostFXToggle.Value;
			_prefRotationOffset.Value = new Vector3(MenuSetup.XROffset.Value, MenuSetup.YrOffset.Value, MenuSetup.ZrOffset.Value);
			_prefPositionOffset.Value = new Vector3(MenuSetup.XpOffset.Value, MenuSetup.YpOffset.Value, MenuSetup.ZpOffset.Value);
			_prefRotationSmoothing.Value = MenuSetup.RSmoothing.Value;
			_prefPositionSmoothing.Value = MenuSetup.PSmoothing.Value;
			_prefShowOtherNotifi.Value = MenuSetup.OtherNotifi.Value;
			_prefShowPrefNotifi.Value = MenuSetup.PrefNotifi.Value;
			_prefShowCameraDisabledNotifi.Value = MenuSetup.CameraDisabledNotifi.Value;
			_prefShowCameraFoundNotifi.Value = MenuSetup.CameraFoundNotifi.Value;
			_prefAutoSave.Value = MenuSetup.AutoSave.Value;
			_prefLdEnabled.Value = MenuSetup.LdEnabled.Value;
			_prefLdCenter.Value = new Vector2(MenuSetup.LdCenterX.Value, MenuSetup.LdCenterY.Value);
			_prefLdIntensity.Value = MenuSetup.LdIntensity.Value;
			_prefLdScale.Value = MenuSetup.LdScale.Value;
			_prefLdXMultiplier.Value = MenuSetup.LdXMultiplier.Value;
			_prefLdYMultiplier.Value = MenuSetup.LdYMultiplier.Value;
			_prefCaEnabled.Value = MenuSetup.CaEnabled.Value;
			_prefCaIntensity.Value = MenuSetup.CaIntensity.Value;
			_prefAeEnabled.Value = MenuSetup.AeEnabled.Value;
			_prefAeAdaptationMode.Value = (AutoExposureAdaptationMode)(object)MenuSetup.AeAdaptationMode.Value;
			_prefAeD2Ls.Value = MenuSetup.AeD2Ls.Value;
			_prefAeEvCompensation.Value = MenuSetup.AeEvCompensation.Value;
			_prefAeEvMax.Value = MenuSetup.AeEvMax.Value;
			_prefAeEvMin.Value = MenuSetup.AeEvMin.Value;
			_prefAeL2Ds.Value = MenuSetup.AeL2Ds.Value;
			_prefAeMeteringMask.Value = (AutoExposureMeteringMaskMode)(object)MenuSetup.AeMeteringMaskMode.Value;
			_prefAeMetProcedFalloff.Value = MenuSetup.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");
		}
	}
}