Decompiled source of LuckyEnhancements v1.3.2

LuckyEnhancements.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.Mono;
using Microsoft.CodeAnalysis;
using Shooterlatro.Core.Localization;
using Shooterlatro.Game;
using Shooterlatro.Player;
using Shooterlatro.Shop;
using Shooterlatro.Weapons;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.Profiling;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LuckyEnhancements")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Lucky Enhancements Mod")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LuckyEnhancements")]
[assembly: AssemblyTitle("LuckyEnhancements")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 LuckyEnhancements
{
	public static class ConfigManager
	{
		public static ConfigEntry<string> ShowFps { get; private set; }

		public static ConfigEntry<int> FpsLimit { get; private set; }

		public static ConfigEntry<Key> OpenMenuKey { get; private set; }

		public static ConfigEntry<float> GameSpeed { get; private set; }

		public static ConfigEntry<float> Fov { get; private set; }

		public static ConfigEntry<bool> ShowStats { get; private set; }

		public static ConfigEntry<float> ShadowDistance { get; private set; }

		public static ConfigEntry<float> LodBias { get; private set; }

		public static ConfigEntry<int> AntiAliasing { get; private set; }

		public static ConfigEntry<int> TextureQuality { get; private set; }

		public static ConfigEntry<bool> PreserveWindowSize { get; private set; }

		public static ConfigEntry<float> WindowX { get; private set; }

		public static ConfigEntry<float> WindowY { get; private set; }

		public static ConfigEntry<float> WindowWidth { get; private set; }

		public static ConfigEntry<float> WindowHeight { get; private set; }

		public static ConfigEntry<string> ShowClock { get; private set; }

		public static ConfigEntry<int> ClockSize { get; private set; }

		public static ConfigEntry<string> ClockColorName { get; private set; }

		public static ConfigEntry<string> ShowSpeedrunTimer { get; private set; }

		public static ConfigEntry<int> TimerSize { get; private set; }

		public static ConfigEntry<string> TimerColorName { get; private set; }

		public static ConfigEntry<float> HudBgOpacity { get; private set; }

		public static ConfigEntry<string> HudFontStyle { get; private set; }

		public static ConfigEntry<bool> DontStopOnFocusLoss { get; private set; }

		public static ConfigEntry<int> HudSize { get; private set; }

		public static ConfigEntry<string> HudColorName { get; private set; }

		public static ConfigEntry<string> DisplayFilter { get; private set; }

		public static ConfigEntry<bool> EnableZoom { get; private set; }

		public static ConfigEntry<Key> ZoomKey { get; private set; }

		public static ConfigEntry<float> ZoomFov { get; private set; }

		public static ConfigEntry<string> ZoomType { get; private set; }

		public static ConfigEntry<bool> ZoomSensitivityScale { get; private set; }

		public static ConfigEntry<float> ZoomSensitivityMult { get; private set; }

		public static ConfigEntry<string> ShowSelectedBullet { get; private set; }

		public static ConfigEntry<int> SelectedBulletSize { get; private set; }

		public static ConfigEntry<float> SelectedBulletOffset { get; private set; }

		public static ConfigEntry<bool> ShowBulletQueue { get; private set; }

		public static ConfigEntry<Key> QuickRestartKey { get; private set; }

		public static ConfigEntry<string> SpeedrunHistoryData { get; private set; }

		public static ConfigEntry<string> SpeedrunPBsData { get; private set; }

		public static ConfigEntry<string> SpeedrunGoldsData { get; private set; }

		public static void Initialize(ConfigFile config)
		{
			ShowFps = config.Bind<string>("Graphics", "ShowFPS", "Off", "Where to show the FPS counter (Off, Left, Right, Middle)");
			FpsLimit = config.Bind<int>("Graphics", "FPSLimit", -1, "Target frame rate limit (e.g. 30, 60, 120, 144, -1 for unlimited)");
			OpenMenuKey = config.Bind<Key>("Keybinds", "OpenMenuKey", (Key)95, "The key used to open/close the mod settings menu.");
			GameSpeed = config.Bind<float>("Gameplay", "GameSpeed", 1f, "Game speed multiplier.");
			Fov = config.Bind<float>("Gameplay", "FieldOfView", 60f, "Custom camera Field of View.");
			ShowStats = config.Bind<bool>("Graphics", "ShowStats", false, "Show the real-time statistics overlay on the left-middle of the screen.");
			ShadowDistance = config.Bind<float>("Graphics", "ShadowDistance", 150f, "Custom shadow rendering distance limit.");
			LodBias = config.Bind<float>("Graphics", "LodBias", 1f, "Custom Level of Detail (LOD) bias multiplier.");
			AntiAliasing = config.Bind<int>("Graphics", "AntiAliasing", QualitySettings.antiAliasing, "Anti-Aliasing level (0 for Off, 2, 4, or 8).");
			TextureQuality = config.Bind<int>("Graphics", "TextureQuality", 0, "Global Texture Mipmap Limit (0 for Full Res, 1 for Half, 2 for Quarter).");
			PreserveWindowSize = config.Bind<bool>("UI", "PreserveWindowSize", true, "Save the window size and position and restore them on startup.");
			WindowX = config.Bind<float>("UI", "WindowX", 100f, "Saved window X position.");
			WindowY = config.Bind<float>("UI", "WindowY", 100f, "Saved window Y position.");
			WindowWidth = config.Bind<float>("UI", "WindowWidth", 950f, "Saved window width.");
			WindowHeight = config.Bind<float>("UI", "WindowHeight", 600f, "Saved window height.");
			ShowClock = config.Bind<string>("UI", "ShowClockMode", "Off", "Where to show the real-world clock HUD (Off, Top-Left, Top-Middle, Top-Right, Bottom-Left, Bottom-Middle, Bottom-Right).");
			ClockSize = config.Bind<int>("UI", "ClockSize", 16, "Font size of the HUD Clock overlay (10-40).");
			ClockColorName = config.Bind<string>("UI", "ClockColor", "Green-Cyan", "Color of the Clock overlay.");
			ShowSpeedrunTimer = config.Bind<string>("UI", "ShowSpeedrunTimerMode", "Off", "Where to show the speedrun stopwatch HUD.");
			TimerSize = config.Bind<int>("UI", "TimerSize", 16, "Font size of the speedrun timer overlay (10-40).");
			TimerColorName = config.Bind<string>("UI", "TimerColor", "Green-Cyan", "Color of the Speedrun Timer overlay.");
			HudBgOpacity = config.Bind<float>("UI", "HudBgOpacity", 0f, "Opacity of the dark background box behind HUD overlays (0.0 = transparent, 1.0 = opaque).");
			HudFontStyle = config.Bind<string>("UI", "HudFontStyle", "Bold", "Font style for HUD text (Normal, Bold, Italic, BoldItalic).");
			DontStopOnFocusLoss = config.Bind<bool>("UI", "DontStopOnFocusLoss", true, "Keep the game running when it loses focus.");
			HudSize = config.Bind<int>("UI", "HUDSize", 16, "Font size of the HUD (Legacy).");
			HudColorName = config.Bind<string>("UI", "HUDColor", "Green-Cyan", "Color of the HUD (Legacy).");
			DisplayFilter = config.Bind<string>("Graphics", "DisplayFilter", "None", "Screen-space display filters (None, Scanlines, RGB Lights, Very Dark, Very Bright, Retro Amber, Fallout Green, Cinematic Letterbox, Sepia, Matrix Digital, Rainbow Wave, CRT Retro Arcade, VHS Static, Night Vision, Doom Red, Blizzard Ice, Pixelated, Upside Down, Drunk Vision, Disco Shaker, Rainbow Rave).");
			EnableZoom = config.Bind<bool>("Gameplay", "EnableZoom", true, "Enable the camera zoom hotkey.");
			ZoomKey = config.Bind<Key>("Keybinds", "ZoomKey", (Key)40, "Key used to zoom in the camera.");
			ZoomFov = config.Bind<float>("Gameplay", "ZoomFOV", 30f, "Target FOV when zoomed in (10-50).");
			ZoomType = config.Bind<string>("Gameplay", "ZoomType", "Hold", "How the zoom key behaves (Hold = zoom while pressed, Toggle = press to toggle zoom).");
			ZoomSensitivityScale = config.Bind<bool>("Gameplay", "ZoomSensitivityScale", true, "Scale mouse sensitivity down while zoomed in to maintain relative speed.");
			ZoomSensitivityMult = config.Bind<float>("Gameplay", "ZoomSensitivityMultiplier", 1f, "Manual sensitivity multiplier applied during zoom (0.1 to 2.0).");
			ShowSelectedBullet = config.Bind<string>("UI", "ShowSelectedBullet", "Dot Queue Only", "Display the next bullet name and details under the crosshair.");
			SelectedBulletSize = config.Bind<int>("UI", "SelectedBulletSize", 13, "Font size of the selected bullet text (10-30).");
			SelectedBulletOffset = config.Bind<float>("UI", "SelectedBulletOffset", 40f, "Vertical pixel distance of bullet name below the crosshair.");
			ShowBulletQueue = config.Bind<bool>("UI", "ShowBulletQueue", true, "Show the next 3 upcoming bullets as colored indicators below the crosshair.");
			QuickRestartKey = config.Bind<Key>("Keybinds", "QuickRestartKey", (Key)32, "Key used to instantly restart the current run in-game.");
			SpeedrunHistoryData = config.Bind<string>("Hidden", "SpeedrunHistoryData", "", "Serialized speedrun history records.");
			SpeedrunPBsData = config.Bind<string>("Hidden", "SpeedrunPBsData", "", "Serialized Personal Best times per weapon.");
			SpeedrunGoldsData = config.Bind<string>("Hidden", "SpeedrunGoldsData", "", "Serialized best round segment times (Gold Splits).");
			ConfigEntry<bool> val = config.Bind<bool>("UI", "ShowClock", false, "");
			if (val.Value && ShowClock.Value == "Off")
			{
				ShowClock.Value = "Top-Left";
				val.Value = false;
				config.Save();
			}
			ConfigEntry<bool> val2 = config.Bind<bool>("UI", "ShowSpeedrunTimer", false, "");
			if (val2.Value && ShowSpeedrunTimer.Value == "Off")
			{
				ShowSpeedrunTimer.Value = "Top-Left";
				val2.Value = false;
				config.Save();
			}
		}
	}
	public static class GameControl
	{
		private static float zoomTransitionFov = -1f;

		public static void SetGamePauseState(bool paused)
		{
			try
			{
				FieldInfo field = typeof(SettingsMenuManager).GetField("<IsPaused>k__BackingField", BindingFlags.Static | BindingFlags.NonPublic);
				if (field != null)
				{
					field.SetValue(null, paused);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("[LuckyEnhancements] Error setting game pause state: " + ex.Message));
			}
		}

		public static void DisablePlayerLook()
		{
			try
			{
				PlayerCameraController val = Object.FindFirstObjectByType<PlayerCameraController>();
				if ((Object)(object)val != (Object)null)
				{
					val.SetManualLookInputEnabled(false);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("[LuckyEnhancements] Error disabling player look: " + ex.Message));
			}
		}

		public static void EnablePlayerLook()
		{
			try
			{
				PlayerCameraController val = Object.FindFirstObjectByType<PlayerCameraController>();
				if ((Object)(object)val != (Object)null)
				{
					val.SetManualLookInputEnabled(true);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("[LuckyEnhancements] Error enabling player look: " + ex.Message));
			}
		}

		public static void DisableWeaponInput()
		{
			try
			{
				Weapon instance = Weapon.Instance;
				if ((Object)(object)instance != (Object)null)
				{
					FieldInfo field = typeof(Weapon).GetField("_manualFireInputEnabled", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field != null)
					{
						field.SetValue(instance, false);
					}
					FieldInfo field2 = typeof(Weapon).GetField("_manualScopeInputEnabled", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field2 != null)
					{
						field2.SetValue(instance, false);
					}
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("[LuckyEnhancements] Error disabling weapon input: " + ex.Message));
			}
		}

		public static void EnableWeaponInput()
		{
			try
			{
				Weapon instance = Weapon.Instance;
				if ((Object)(object)instance != (Object)null)
				{
					FieldInfo field = typeof(Weapon).GetField("_manualFireInputEnabled", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field != null)
					{
						field.SetValue(instance, true);
					}
					FieldInfo field2 = typeof(Weapon).GetField("_manualScopeInputEnabled", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field2 != null)
					{
						field2.SetValue(instance, true);
					}
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("[LuckyEnhancements] Error enabling weapon input: " + ex.Message));
			}
		}

		public static void ApplyFov(bool isZooming = false)
		{
			Camera main = Camera.main;
			if (!((Object)(object)main == (Object)null))
			{
				float value = ConfigManager.Fov.Value;
				if (isZooming && ConfigManager.EnableZoom.Value)
				{
					value = ConfigManager.ZoomFov.Value;
				}
				if (zoomTransitionFov < 0f)
				{
					zoomTransitionFov = main.fieldOfView;
				}
				zoomTransitionFov = Mathf.Lerp(zoomTransitionFov, value, Time.unscaledDeltaTime * 12f);
				if (Mathf.Abs(zoomTransitionFov - value) < 0.05f)
				{
					zoomTransitionFov = value;
				}
				main.fieldOfView = zoomTransitionFov;
			}
		}

		public static void ApplyGraphicsSettings()
		{
			QualitySettings.shadowDistance = ConfigManager.ShadowDistance.Value;
			QualitySettings.lodBias = ConfigManager.LodBias.Value;
			QualitySettings.antiAliasing = ConfigManager.AntiAliasing.Value;
			QualitySettings.globalTextureMipmapLimit = ConfigManager.TextureQuality.Value;
		}

		public static void ApplyFpsLimit(bool isMenuOpen, float menuTransitionProgress)
		{
			int num = ((isMenuOpen || menuTransitionProgress > 0f) ? (-1) : ConfigManager.FpsLimit.Value);
			if (num <= 0)
			{
				Application.targetFrameRate = -1;
				return;
			}
			QualitySettings.vSyncCount = 0;
			Application.targetFrameRate = num;
		}
	}
	public static class MenuUI
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static WindowFunction <0>__DrawWindow;
		}

		public static bool isMenuOpen = false;

		public static float menuTransitionProgress = 0f;

		public static float menuTargetProgress = 0f;

		public static Rect windowRect = new Rect(100f, 100f, 950f, 600f);

		public static bool isResizing = false;

		private static Vector2 resizeStartMouse = Vector2.zero;

		private static Vector2 resizeStartSize = Vector2.zero;

		public static string currentCategory = "Graphics & Quality";

		public static float previousTimeScale = 1f;

		public static CursorLockMode lastLockMode = (CursorLockMode)0;

		public static bool lastCursorVisible = true;

		public static string waitingForKeybind = "";

		private static Vector2 graphicsScrollPosition = Vector2.zero;

		private static Vector2 gameplayScrollPosition = Vector2.zero;

		private static Vector2 keybindsScrollPosition = Vector2.zero;

		private static Vector2 speedrunsScrollPosition = Vector2.zero;

		private static Vector2 aboutScrollPosition = Vector2.zero;

		private static Vector2 splitsDetailScrollPosition = Vector2.zero;

		private static SpeedrunRunRecord selectedRunForSplits = null;

		private static GUIStyle windowStyle;

		private static GUIStyle sidebarStyle;

		private static GUIStyle buttonStyle;

		private static GUIStyle buttonSelectedStyle;

		private static GUIStyle gridButtonStyle;

		private static GUIStyle gridButtonSelectedStyle;

		private static GUIStyle headerStyle;

		private static GUIStyle labelStyle;

		private static GUIStyle separatorStyle;

		private static GUIStyle resetButtonStyle;

		private static bool stylesInitialized = false;

		public static void InitStyles()
		{
			//IL_001c: 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_003b: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_00ca: 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_0102: Expected O, but got Unknown
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Expected O, but got Unknown
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Expected O, but got Unknown
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Expected O, but got Unknown
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Expected O, but got Unknown
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Expected O, but got Unknown
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Expected O, but got Unknown
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Expected O, but got Unknown
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0503: Unknown result type (might be due to invalid IL or missing references)
			//IL_050d: Expected O, but got Unknown
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Expected O, but got Unknown
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_0540: Unknown result type (might be due to invalid IL or missing references)
			//IL_054a: Expected O, but got Unknown
			if (!stylesInitialized)
			{
				Texture2D background = CreateColorTexture(new Color(0.12f, 0.12f, 0.14f, 0.98f));
				windowStyle = new GUIStyle(GUI.skin.window);
				windowStyle.normal.background = background;
				windowStyle.onNormal.background = background;
				windowStyle.border = new RectOffset(4, 4, 4, 4);
				Texture2D background2 = CreateColorTexture(new Color(0.08f, 0.08f, 0.09f, 0.98f));
				sidebarStyle = new GUIStyle();
				sidebarStyle.normal.background = background2;
				headerStyle = new GUIStyle();
				headerStyle.normal.textColor = new Color(0.95f, 0.95f, 0.95f);
				headerStyle.fontSize = 20;
				headerStyle.fontStyle = (FontStyle)1;
				headerStyle.margin = new RectOffset(10, 10, 10, 15);
				labelStyle = new GUIStyle();
				labelStyle.normal.textColor = new Color(0.85f, 0.85f, 0.85f);
				labelStyle.fontSize = 14;
				labelStyle.margin = new RectOffset(5, 5, 5, 5);
				Texture2D background3 = CreateColorTexture(new Color(0.18f, 0.18f, 0.2f, 1f));
				Texture2D background4 = CreateColorTexture(new Color(0.25f, 0.25f, 0.28f, 1f));
				Texture2D background5 = CreateColorTexture(new Color(0.35f, 0.35f, 0.4f, 1f));
				buttonStyle = new GUIStyle(GUI.skin.button);
				buttonStyle.normal.background = background3;
				buttonStyle.normal.textColor = new Color(0.85f, 0.85f, 0.85f);
				buttonStyle.hover.background = background4;
				buttonStyle.hover.textColor = Color.white;
				buttonStyle.active.background = background5;
				buttonStyle.active.textColor = Color.white;
				buttonStyle.fontSize = 13;
				buttonStyle.alignment = (TextAnchor)3;
				buttonStyle.padding = new RectOffset(12, 10, 8, 8);
				buttonStyle.margin = new RectOffset(5, 5, 2, 2);
				Texture2D background6 = CreateColorTexture(new Color(0.18f, 0.48f, 0.82f, 1f));
				buttonSelectedStyle = new GUIStyle(buttonStyle);
				buttonSelectedStyle.normal.background = background6;
				buttonSelectedStyle.normal.textColor = Color.white;
				buttonSelectedStyle.hover.background = background6;
				buttonSelectedStyle.hover.textColor = Color.white;
				gridButtonStyle = new GUIStyle(GUI.skin.button);
				gridButtonStyle.normal.background = background3;
				gridButtonStyle.normal.textColor = new Color(0.85f, 0.85f, 0.85f);
				gridButtonStyle.hover.background = background4;
				gridButtonStyle.hover.textColor = Color.white;
				gridButtonStyle.active.background = background5;
				gridButtonStyle.active.textColor = Color.white;
				gridButtonStyle.fontSize = 13;
				gridButtonStyle.alignment = (TextAnchor)4;
				gridButtonStyle.padding = new RectOffset(4, 4, 4, 4);
				gridButtonStyle.margin = new RectOffset(3, 3, 2, 2);
				gridButtonSelectedStyle = new GUIStyle(gridButtonStyle);
				gridButtonSelectedStyle.normal.background = background6;
				gridButtonSelectedStyle.normal.textColor = Color.white;
				gridButtonSelectedStyle.hover.background = background6;
				gridButtonSelectedStyle.hover.textColor = Color.white;
				resetButtonStyle = new GUIStyle(GUI.skin.button);
				resetButtonStyle.normal.background = background3;
				resetButtonStyle.normal.textColor = new Color(0.85f, 0.85f, 0.85f);
				resetButtonStyle.hover.background = CreateColorTexture(new Color(0.35f, 0.15f, 0.15f, 1f));
				resetButtonStyle.hover.textColor = Color.white;
				resetButtonStyle.active.background = CreateColorTexture(new Color(0.45f, 0.2f, 0.2f, 1f));
				resetButtonStyle.active.textColor = Color.white;
				resetButtonStyle.fontSize = 12;
				resetButtonStyle.alignment = (TextAnchor)4;
				resetButtonStyle.padding = new RectOffset(4, 4, 2, 2);
				resetButtonStyle.margin = new RectOffset(3, 3, 2, 2);
				Texture2D background7 = CreateColorTexture(new Color(0.25f, 0.25f, 0.28f, 0.5f));
				separatorStyle = new GUIStyle();
				separatorStyle.normal.background = background7;
				stylesInitialized = true;
			}
		}

		private static Texture2D CreateColorTexture(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			Texture2D val = new Texture2D(1, 1);
			val.SetPixel(0, 0, color);
			val.Apply();
			return val;
		}

		private static void DrawSeparator()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Space(10f);
			GUI.Box(GUILayoutUtility.GetRect(10f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }), "", separatorStyle);
			GUILayout.Space(10f);
		}

		public static void ToggleMenu()
		{
			//IL_0028: 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)
			isMenuOpen = !isMenuOpen;
			if (isMenuOpen)
			{
				previousTimeScale = Time.timeScale;
				Time.timeScale = 0f;
				lastLockMode = Cursor.lockState;
				lastCursorVisible = Cursor.visible;
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
				menuTargetProgress = 1f;
				GameControl.DisablePlayerLook();
				GameControl.DisableWeaponInput();
			}
			else
			{
				menuTargetProgress = 0f;
				SaveWindowSettings();
			}
		}

		public static void SaveWindowSettings()
		{
			if (ConfigManager.PreserveWindowSize.Value)
			{
				ConfigManager.WindowX.Value = ((Rect)(ref windowRect)).x;
				ConfigManager.WindowY.Value = ((Rect)(ref windowRect)).y;
				ConfigManager.WindowWidth.Value = ((Rect)(ref windowRect)).width;
				ConfigManager.WindowHeight.Value = ((Rect)(ref windowRect)).height;
				((ConfigEntryBase)ConfigManager.WindowWidth).ConfigFile.Save();
			}
		}

		public static void DrawMenu()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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)
			//IL_006e: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			InitStyles();
			if (menuTransitionProgress > 0f)
			{
				Matrix4x4 matrix = GUI.matrix;
				Color color = GUI.color;
				float num = EaseOutCubic(menuTransitionProgress);
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor(((Rect)(ref windowRect)).x + ((Rect)(ref windowRect)).width / 2f, ((Rect)(ref windowRect)).y + ((Rect)(ref windowRect)).height / 2f);
				GUIUtility.ScaleAroundPivot(new Vector2(num, num), val);
				GUI.color = new Color(color.r, color.g, color.b, num * color.a);
				Rect val2 = windowRect;
				object obj = <>O.<0>__DrawWindow;
				if (obj == null)
				{
					WindowFunction val3 = DrawWindow;
					<>O.<0>__DrawWindow = val3;
					obj = (object)val3;
				}
				Rect val4 = GUI.Window(9999, val2, (WindowFunction)obj, $"LuckyEnhancements (Press {ConfigManager.OpenMenuKey.Value} to close)", windowStyle);
				if (menuTransitionProgress >= 1f)
				{
					windowRect = val4;
				}
				GUI.color = color;
				GUI.matrix = matrix;
			}
		}

		private static float EaseOutCubic(float x)
		{
			return 1f - Mathf.Pow(1f - x, 3f);
		}

		private static void DrawWindow(int windowId)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: 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_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Invalid comparison between Unknown and I4
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: 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_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Invalid comparison between Unknown and I4
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Invalid comparison between Unknown and I4
			GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, 25f));
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) });
			GUILayout.BeginVertical(sidebarStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(180f),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Space(15f);
			DrawCategoryButton("Graphics & Quality");
			DrawCategoryButton("Display VFX");
			DrawCategoryButton("HUD & Overlay");
			DrawCategoryButton("Gameplay & Zoom");
			DrawCategoryButton("Keybinds");
			DrawCategoryButton("Speedruns");
			DrawCategoryButton("About");
			GUILayout.EndVertical();
			GUILayout.Space(15f);
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Space(10f);
			if (currentCategory == "Graphics & Quality")
			{
				DrawGraphicsSettings();
			}
			else if (currentCategory == "Display VFX")
			{
				DrawDisplayFiltersSettings();
			}
			else if (currentCategory == "HUD & Overlay")
			{
				DrawHUDOverlaySettings();
			}
			else if (currentCategory == "Gameplay & Zoom")
			{
				DrawGameplaySettings();
			}
			else if (currentCategory == "Keybinds")
			{
				DrawKeybindsSettings();
			}
			else if (currentCategory == "Speedruns")
			{
				DrawSpeedrunsPage();
			}
			else if (currentCategory == "About")
			{
				DrawAboutPage();
			}
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(((Rect)(ref windowRect)).width - 16f, ((Rect)(ref windowRect)).height - 16f, 16f, 16f);
			GUIStyle val2 = new GUIStyle();
			val2.normal.textColor = new Color(0.18f, 0.48f, 0.82f, 0.7f);
			val2.alignment = (TextAnchor)8;
			val2.fontSize = 14;
			GUI.Label(val, "◢", val2);
			Event current = Event.current;
			if ((int)current.type == 0 && ((Rect)(ref val)).Contains(current.mousePosition))
			{
				isResizing = true;
				resizeStartMouse = GUIUtility.GUIToScreenPoint(current.mousePosition);
				resizeStartSize = new Vector2(((Rect)(ref windowRect)).width, ((Rect)(ref windowRect)).height);
				current.Use();
			}
			if (isResizing)
			{
				if ((int)current.type == 3)
				{
					Vector2 val3 = GUIUtility.GUIToScreenPoint(current.mousePosition) - resizeStartMouse;
					((Rect)(ref windowRect)).width = Mathf.Clamp(resizeStartSize.x + val3.x, 850f, 1600f);
					((Rect)(ref windowRect)).height = Mathf.Clamp(resizeStartSize.y + val3.y, 550f, 1000f);
					current.Use();
				}
				else if ((int)current.type == 1 || (int)current.rawType == 1)
				{
					isResizing = false;
					SaveWindowSettings();
				}
			}
		}

		private static void DrawCategoryButton(string name)
		{
			bool num = currentCategory == name;
			GUIStyle val = (num ? buttonSelectedStyle : buttonStyle);
			if (GUILayout.Button(num ? ("> " + name) : name, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(38f) }))
			{
				currentCategory = name;
			}
		}

		private static void DrawGraphicsSettings()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			graphicsScrollPosition = GUILayout.BeginScrollView(graphicsScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("Graphics Options", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Show FPS Counter:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			string value = ConfigManager.ShowFps.Value;
			string[] array = new string[4] { "Off", "Left", "Middle", "Right" };
			for (int i = 0; i < array.Length; i++)
			{
				GUIStyle val = ((value == array[i]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array[i], val, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(80f),
					GUILayout.Height(25f)
				}))
				{
					ConfigManager.ShowFps.Value = array[i];
					((ConfigEntryBase)ConfigManager.ShowFps).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			DrawSeparator();
			int value2 = ConfigManager.FpsLimit.Value;
			float num = ((value2 <= 0) ? 301f : ((float)value2));
			string text = ((value2 <= 0) ? "Max" : $"{value2}");
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("FPS Limit (" + text + "):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			if (GUILayout.Button("-", gridButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(25f),
				GUILayout.Height(22f)
			}))
			{
				if (value2 == -1)
				{
					ConfigManager.FpsLimit.Value = 300;
				}
				else if (value2 > 1)
				{
					ConfigManager.FpsLimit.Value = value2 - 1;
				}
				GameControl.ApplyFpsLimit(isMenuOpen, menuTransitionProgress);
				((ConfigEntryBase)ConfigManager.FpsLimit).ConfigFile.Save();
			}
			int num2 = Mathf.RoundToInt(GUILayout.HorizontalSlider(num, 1f, 301f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) }));
			if (GUILayout.Button("+", gridButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(25f),
				GUILayout.Height(22f)
			}) && value2 != -1)
			{
				if (value2 < 300)
				{
					ConfigManager.FpsLimit.Value = value2 + 1;
				}
				else if (value2 == 300)
				{
					ConfigManager.FpsLimit.Value = -1;
				}
				GameControl.ApplyFpsLimit(isMenuOpen, menuTransitionProgress);
				((ConfigEntryBase)ConfigManager.FpsLimit).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			if (num2 != Mathf.RoundToInt(num))
			{
				if (num2 == 301)
				{
					ConfigManager.FpsLimit.Value = -1;
				}
				else
				{
					ConfigManager.FpsLimit.Value = num2;
				}
				GameControl.ApplyFpsLimit(isMenuOpen, menuTransitionProgress);
				((ConfigEntryBase)ConfigManager.FpsLimit).ConfigFile.Save();
			}
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Space(185f);
			int[] array2 = new int[6] { 30, 60, 120, 144, 240, -1 };
			for (int j = 0; j < array2.Length; j++)
			{
				int num3 = array2[j];
				string obj = ((num3 == -1) ? "Max" : num3.ToString());
				GUIStyle val2 = ((value2 == num3) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(obj, val2, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(48f),
					GUILayout.Height(25f)
				}))
				{
					ConfigManager.FpsLimit.Value = num3;
					GameControl.ApplyFpsLimit(isMenuOpen, menuTransitionProgress);
					((ConfigEntryBase)ConfigManager.FpsLimit).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			DrawSeparator();
			GUILayout.Label("Advanced Quality Settings", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Show Stats Overlay:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			bool value3 = ConfigManager.ShowStats.Value;
			bool flag = GUILayout.Toggle(value3, value3 ? " Enabled" : " Disabled", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			if (flag != value3)
			{
				ConfigManager.ShowStats.Value = flag;
				((ConfigEntryBase)ConfigManager.ShowStats).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Shadow Distance ({ConfigManager.ShadowDistance.Value:F0}m):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			float num4 = GUILayout.HorizontalSlider(ConfigManager.ShadowDistance.Value, 0f, 500f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			if (num4 != ConfigManager.ShadowDistance.Value)
			{
				ConfigManager.ShadowDistance.Value = Mathf.Round(num4);
				QualitySettings.shadowDistance = ConfigManager.ShadowDistance.Value;
				((ConfigEntryBase)ConfigManager.ShadowDistance).ConfigFile.Save();
			}
			if (GUILayout.Button("Reset", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(60f),
				GUILayout.Height(22f)
			}))
			{
				ConfigManager.ShadowDistance.Value = 150f;
				QualitySettings.shadowDistance = 150f;
				((ConfigEntryBase)ConfigManager.ShadowDistance).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"LOD Bias ({ConfigManager.LodBias.Value:F2}x):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			float num5 = GUILayout.HorizontalSlider(ConfigManager.LodBias.Value, 0.1f, 5f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			if (num5 != ConfigManager.LodBias.Value)
			{
				ConfigManager.LodBias.Value = (float)Math.Round(num5, 2);
				QualitySettings.lodBias = ConfigManager.LodBias.Value;
				((ConfigEntryBase)ConfigManager.LodBias).ConfigFile.Save();
			}
			if (GUILayout.Button("Reset", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(60f),
				GUILayout.Height(22f)
			}))
			{
				ConfigManager.LodBias.Value = 1f;
				QualitySettings.lodBias = 1f;
				((ConfigEntryBase)ConfigManager.LodBias).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Anti-Aliasing:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			int[] array3 = new int[4] { 0, 2, 4, 8 };
			string[] array4 = new string[4] { "Off", "2x", "4x", "8x" };
			for (int k = 0; k < array3.Length; k++)
			{
				GUIStyle val3 = ((ConfigManager.AntiAliasing.Value == array3[k]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array4[k], val3, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(55f),
					GUILayout.Height(24f)
				}))
				{
					ConfigManager.AntiAliasing.Value = array3[k];
					QualitySettings.antiAliasing = array3[k];
					((ConfigEntryBase)ConfigManager.AntiAliasing).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Texture Quality:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			int[] array5 = new int[3] { 0, 1, 2 };
			string[] array6 = new string[3] { "Full", "Half", "Quarter" };
			for (int l = 0; l < array5.Length; l++)
			{
				GUIStyle val4 = ((ConfigManager.TextureQuality.Value == array5[l]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array6[l], val4, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(75f),
					GUILayout.Height(24f)
				}))
				{
					ConfigManager.TextureQuality.Value = array5[l];
					QualitySettings.globalTextureMipmapLimit = array5[l];
					((ConfigEntryBase)ConfigManager.TextureQuality).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndScrollView();
		}

		private static void DrawDisplayFiltersSettings()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			graphicsScrollPosition = GUILayout.BeginScrollView(graphicsScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("Display VFX Filters", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Display Filter:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value = ConfigManager.DisplayFilter.Value;
			string[] array = new string[17]
			{
				"None", "Scanlines", "RGB Lights", "Very Dark", "Very Bright", "Retro Amber", "Fallout Green", "Sepia", "Cinematic Letterbox", "Matrix Digital",
				"Rainbow Wave", "CRT Retro Arcade", "VHS Static", "Night Vision", "Doom Red", "Blizzard Ice", "Pixelated"
			};
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < 5; i++)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				for (int j = 0; j < 4; j++)
				{
					int num = i * 4 + j;
					if (num < array.Length)
					{
						GUIStyle val = ((value == array[num]) ? gridButtonSelectedStyle : gridButtonStyle);
						if (GUILayout.Button(array[num], val, (GUILayoutOption[])(object)new GUILayoutOption[2]
						{
							GUILayout.Width(130f),
							GUILayout.Height(22f)
						}))
						{
							ConfigManager.DisplayFilter.Value = array[num];
							((ConfigEntryBase)ConfigManager.DisplayFilter).ConfigFile.Save();
						}
					}
				}
				GUILayout.EndHorizontal();
			}
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.EndScrollView();
		}

		private static void DrawHUDOverlaySettings()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			gameplayScrollPosition = GUILayout.BeginScrollView(gameplayScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("Mod QoL Settings", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Run In Background:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			bool value = ConfigManager.DontStopOnFocusLoss.Value;
			bool flag = GUILayout.Toggle(value, value ? " Enabled" : " Disabled", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			if (flag != value)
			{
				ConfigManager.DontStopOnFocusLoss.Value = flag;
				Application.runInBackground = flag;
				((ConfigEntryBase)ConfigManager.DontStopOnFocusLoss).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Preserve Window Size:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			bool value2 = ConfigManager.PreserveWindowSize.Value;
			bool flag2 = GUILayout.Toggle(value2, value2 ? " Enabled" : " Disabled", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			if (flag2 != value2)
			{
				ConfigManager.PreserveWindowSize.Value = flag2;
				((ConfigEntryBase)ConfigManager.PreserveWindowSize).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			DrawSeparator();
			GUILayout.Label("Mod HUD Settings", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			string[] array = new string[7] { "Off", "Top-Left", "Top-Middle", "Top-Right", "Bottom-Left", "Bottom-Middle", "Bottom-Right" };
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Show Clock HUD:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value3 = ConfigManager.ShowClock.Value;
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < 4; i++)
			{
				GUIStyle val = ((value3 == array[i]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array[i], val, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ShowClock.Value = array[i];
					((ConfigEntryBase)ConfigManager.ShowClock).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int j = 4; j < 7; j++)
			{
				GUIStyle val2 = ((value3 == array[j]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array[j], val2, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ShowClock.Value = array[j];
					((ConfigEntryBase)ConfigManager.ShowClock).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Show Timer HUD:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value4 = ConfigManager.ShowSpeedrunTimer.Value;
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int k = 0; k < 4; k++)
			{
				GUIStyle val3 = ((value4 == array[k]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array[k], val3, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ShowSpeedrunTimer.Value = array[k];
					((ConfigEntryBase)ConfigManager.ShowSpeedrunTimer).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int l = 4; l < 7; l++)
			{
				GUIStyle val4 = ((value4 == array[l]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array[l], val4, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ShowSpeedrunTimer.Value = array[l];
					((ConfigEntryBase)ConfigManager.ShowSpeedrunTimer).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			DrawSeparator();
			GUILayout.Label("HUD Appearance & Style", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Clock Size ({ConfigManager.ClockSize.Value}px):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			int num = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)ConfigManager.ClockSize.Value, 10f, 40f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) }));
			if (num != ConfigManager.ClockSize.Value)
			{
				ConfigManager.ClockSize.Value = num;
				((ConfigEntryBase)ConfigManager.ClockSize).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Clock Text Color:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value5 = ConfigManager.ClockColorName.Value;
			string[] array2 = new string[7] { "Green-Cyan", "Hot Pink", "Neon Purple", "Electric Blue", "Sun Gold", "Ice White", "Crimson Red" };
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int m = 0; m < 4; m++)
			{
				GUIStyle val5 = ((value5 == array2[m]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array2[m], val5, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ClockColorName.Value = array2[m];
					((ConfigEntryBase)ConfigManager.ClockColorName).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int n = 4; n < 7; n++)
			{
				GUIStyle val6 = ((value5 == array2[n]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array2[n], val6, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ClockColorName.Value = array2[n];
					((ConfigEntryBase)ConfigManager.ClockColorName).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(12f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Timer Size ({ConfigManager.TimerSize.Value}px):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			int num2 = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)ConfigManager.TimerSize.Value, 10f, 40f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) }));
			if (num2 != ConfigManager.TimerSize.Value)
			{
				ConfigManager.TimerSize.Value = num2;
				((ConfigEntryBase)ConfigManager.TimerSize).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Timer Text Color:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value6 = ConfigManager.TimerColorName.Value;
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int num3 = 0; num3 < 4; num3++)
			{
				GUIStyle val7 = ((value6 == array2[num3]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array2[num3], val7, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.TimerColorName.Value = array2[num3];
					((ConfigEntryBase)ConfigManager.TimerColorName).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int num4 = 4; num4 < 7; num4++)
			{
				GUIStyle val8 = ((value6 == array2[num4]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array2[num4], val8, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(90f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.TimerColorName.Value = array2[num4];
					((ConfigEntryBase)ConfigManager.TimerColorName).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.Space(12f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"HUD Box Opacity ({Mathf.RoundToInt(ConfigManager.HudBgOpacity.Value * 100f)}%):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			float num5 = GUILayout.HorizontalSlider(ConfigManager.HudBgOpacity.Value, 0f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			if (num5 != ConfigManager.HudBgOpacity.Value)
			{
				ConfigManager.HudBgOpacity.Value = (float)Math.Round(num5, 2);
				((ConfigEntryBase)ConfigManager.HudBgOpacity).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("HUD Font Style:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value7 = ConfigManager.HudFontStyle.Value;
			string[] array3 = new string[4] { "Normal", "Bold", "Italic", "BoldItalic" };
			for (int num6 = 0; num6 < array3.Length; num6++)
			{
				GUIStyle val9 = ((value7 == array3[num6]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array3[num6], val9, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(80f),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.HudFontStyle.Value = array3[num6];
					((ConfigEntryBase)ConfigManager.HudFontStyle).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			DrawSeparator();
			GUILayout.Label("Active Bullet Indicator", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Selected Bullet:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			string value8 = ConfigManager.ShowSelectedBullet.Value;
			string[] array4 = new string[4] { "Off", "Dot Queue Only", "Name Only", "Name & Ammo Count" };
			int[] array5 = new int[4] { 50, 115, 95, 145 };
			for (int num7 = 0; num7 < array4.Length; num7++)
			{
				GUIStyle val10 = ((value8 == array4[num7]) ? gridButtonSelectedStyle : gridButtonStyle);
				if (GUILayout.Button(array4[num7], val10, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width((float)array5[num7]),
					GUILayout.Height(22f)
				}))
				{
					ConfigManager.ShowSelectedBullet.Value = array4[num7];
					((ConfigEntryBase)ConfigManager.ShowSelectedBullet).ConfigFile.Save();
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Text Size ({ConfigManager.SelectedBulletSize.Value}px):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			int num8 = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)ConfigManager.SelectedBulletSize.Value, 10f, 30f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) }));
			if (num8 != ConfigManager.SelectedBulletSize.Value)
			{
				ConfigManager.SelectedBulletSize.Value = num8;
				((ConfigEntryBase)ConfigManager.SelectedBulletSize).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Vertical Offset ({ConfigManager.SelectedBulletOffset.Value:F0}px):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			float num9 = GUILayout.HorizontalSlider(ConfigManager.SelectedBulletOffset.Value, 10f, 150f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(180f) });
			if (num9 != ConfigManager.SelectedBulletOffset.Value)
			{
				ConfigManager.SelectedBulletOffset.Value = Mathf.Round(num9);
				((ConfigEntryBase)ConfigManager.SelectedBulletOffset).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Show Bullet Queue:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) });
			bool value9 = ConfigManager.ShowBulletQueue.Value;
			bool flag3 = GUILayout.Toggle(value9, value9 ? " Enabled" : " Disabled", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			if (flag3 != value9)
			{
				ConfigManager.ShowBulletQueue.Value = flag3;
				((ConfigEntryBase)ConfigManager.ShowBulletQueue).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.EndScrollView();
		}

		private static void DrawKeybindsSettings()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
			keybindsScrollPosition = GUILayout.BeginScrollView(keybindsScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("Keybinds Settings", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Open Settings Keybind:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (GUILayout.Button((waitingForKeybind == "Menu") ? "Press any key..." : $"[ {ConfigManager.OpenMenuKey.Value} ]", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(150f),
				GUILayout.Height(30f)
			}))
			{
				waitingForKeybind = "Menu";
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Camera Zoom Keybind:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (GUILayout.Button((waitingForKeybind == "Zoom") ? "Press any key..." : $"[ {ConfigManager.ZoomKey.Value} ]", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(150f),
				GUILayout.Height(30f)
			}))
			{
				waitingForKeybind = "Zoom";
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Quick Restart Keybind:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (GUILayout.Button((waitingForKeybind == "Restart") ? "Press any key..." : $"[ {ConfigManager.QuickRestartKey.Value} ]", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(150f),
				GUILayout.Height(30f)
			}))
			{
				waitingForKeybind = "Restart";
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(20f);
			GUILayout.Label("Click a button and press any key to rebind the respective hotkey.", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndScrollView();
		}

		private static void DrawGameplaySettings()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			gameplayScrollPosition = GUILayout.BeginScrollView(gameplayScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("Gameplay Adjustments", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Game Speed ({ConfigManager.GameSpeed.Value:F1}x):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			float num = GUILayout.HorizontalSlider(ConfigManager.GameSpeed.Value, 0.1f, 5f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (num != ConfigManager.GameSpeed.Value)
			{
				ConfigManager.GameSpeed.Value = num;
				((ConfigEntryBase)ConfigManager.GameSpeed).ConfigFile.Save();
				if (!isMenuOpen)
				{
					Time.timeScale = num;
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Reset", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(60f),
				GUILayout.Height(25f)
			}))
			{
				ConfigManager.GameSpeed.Value = 1f;
				((ConfigEntryBase)ConfigManager.GameSpeed).ConfigFile.Save();
				if (!isMenuOpen)
				{
					Time.timeScale = 1f;
				}
			}
			GUILayout.EndHorizontal();
			DrawSeparator();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Field of View ({ConfigManager.Fov.Value:F0}°):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			float num2 = GUILayout.HorizontalSlider(ConfigManager.Fov.Value, 50f, 130f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (num2 != ConfigManager.Fov.Value)
			{
				ConfigManager.Fov.Value = num2;
				GameControl.ApplyFov();
				((ConfigEntryBase)ConfigManager.Fov).ConfigFile.Save();
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Reset", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(60f),
				GUILayout.Height(25f)
			}))
			{
				ConfigManager.Fov.Value = 60f;
				GameControl.ApplyFov();
				((ConfigEntryBase)ConfigManager.Fov).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			DrawSeparator();
			GUILayout.Label("Camera Zoom Settings", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Enable Camera Zoom:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			bool value = ConfigManager.EnableZoom.Value;
			bool flag = GUILayout.Toggle(value, value ? " Enabled" : " Disabled", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			if (flag != value)
			{
				ConfigManager.EnableZoom.Value = flag;
				((ConfigEntryBase)ConfigManager.EnableZoom).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Zoom Target FOV ({ConfigManager.ZoomFov.Value:F0}°):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			float num3 = GUILayout.HorizontalSlider(ConfigManager.ZoomFov.Value, 10f, 50f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (num3 != ConfigManager.ZoomFov.Value)
			{
				ConfigManager.ZoomFov.Value = num3;
				((ConfigEntryBase)ConfigManager.ZoomFov).ConfigFile.Save();
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Reset", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(60f),
				GUILayout.Height(25f)
			}))
			{
				ConfigManager.ZoomFov.Value = 30f;
				((ConfigEntryBase)ConfigManager.ZoomFov).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Zoom Hold Mode:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			bool flag2 = ConfigManager.ZoomType.Value == "Hold";
			bool flag3 = GUILayout.Toggle(flag2, flag2 ? " Hold to Zoom" : " Toggle Zoom", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			if (flag3 != flag2)
			{
				ConfigManager.ZoomType.Value = (flag3 ? "Hold" : "Toggle");
				((ConfigEntryBase)ConfigManager.ZoomType).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Scale Zoom Sens:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			bool value2 = ConfigManager.ZoomSensitivityScale.Value;
			bool flag4 = GUILayout.Toggle(value2, value2 ? " Enabled" : " Disabled", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
			if (flag4 != value2)
			{
				ConfigManager.ZoomSensitivityScale.Value = flag4;
				((ConfigEntryBase)ConfigManager.ZoomSensitivityScale).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"Zoom Sens Mult ({ConfigManager.ZoomSensitivityMult.Value:F2}x):", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
			float num4 = GUILayout.HorizontalSlider(ConfigManager.ZoomSensitivityMult.Value, 0.1f, 2f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
			if (num4 != ConfigManager.ZoomSensitivityMult.Value)
			{
				ConfigManager.ZoomSensitivityMult.Value = (float)Math.Round(num4, 2);
				((ConfigEntryBase)ConfigManager.ZoomSensitivityMult).ConfigFile.Save();
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Reset", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(60f),
				GUILayout.Height(25f)
			}))
			{
				ConfigManager.ZoomSensitivityMult.Value = 1f;
				((ConfigEntryBase)ConfigManager.ZoomSensitivityMult).ConfigFile.Save();
			}
			GUILayout.EndHorizontal();
			GUILayout.EndScrollView();
		}

		private static void DrawSpeedrunsPage()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Expected O, but got Unknown
			//IL_096b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0955: Unknown result type (might be due to invalid IL or missing references)
			speedrunsScrollPosition = GUILayout.BeginScrollView(speedrunsScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("Speedrun History & Records", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			if (selectedRunForSplits != null)
			{
				GUILayout.Label("Splits for run on " + selectedRunForSplits.DateString + " (" + selectedRunForSplits.WeaponName + ")", headerStyle, Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				splitsDetailScrollPosition = GUILayout.BeginScrollView(splitsDetailScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) });
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("Segment", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
				GUILayout.Label("Duration", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
				GUILayout.Label("Cumulative", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) });
				GUILayout.EndHorizontal();
				DrawSeparator();
				string serializedSplits = selectedRunForSplits.SerializedSplits;
				if (!string.IsNullOrEmpty(serializedSplits))
				{
					string[] array = serializedSplits.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries);
					for (int i = 0; i < array.Length; i++)
					{
						string[] array2 = array[i].Split(':');
						if (array2.Length >= 3)
						{
							GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
							GUILayout.Label(array2[0], labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
							GUILayout.Label($"{float.Parse(array2[1]):F2}s", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
							GUILayout.Label(array2[2] + "s", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) });
							GUILayout.EndHorizontal();
						}
					}
				}
				else
				{
					GUILayout.Label("No splits recorded for this run.", labelStyle, Array.Empty<GUILayoutOption>());
				}
				GUILayout.EndScrollView();
				if (GUILayout.Button("Close Split Viewer", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(140f),
					GUILayout.Height(25f)
				}))
				{
					selectedRunForSplits = null;
				}
				GUILayout.EndVertical();
				GUILayout.Space(15f);
				DrawSeparator();
			}
			GUILayout.Label("Current Run - Segment Splits", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			if (StatsOverlay.currentRunSplits.Count > 0)
			{
				GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("Segment", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
				GUILayout.Label("Duration", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
				GUILayout.Label("Cumulative", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) });
				GUILayout.EndHorizontal();
				DrawSeparator();
				foreach (SpeedrunSplit currentRunSplit in StatsOverlay.currentRunSplits)
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label(currentRunSplit.SegmentName, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
					GUILayout.Label($"{currentRunSplit.SegmentDuration:F2}s", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
					int num = (int)(currentRunSplit.CumulativeTime / 60f);
					int num2 = (int)(currentRunSplit.CumulativeTime % 60f);
					int num3 = (int)(currentRunSplit.CumulativeTime * 100f % 100f);
					GUILayout.Label($"{num:D2}:{num2:D2}.{num3:D2}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) });
					GUILayout.EndHorizontal();
				}
				GUILayout.EndVertical();
			}
			else
			{
				GUILayout.Label("No active splits for the current run. Start a round to begin timing!", labelStyle, Array.Empty<GUILayoutOption>());
			}
			GUILayout.Space(20f);
			DrawSeparator();
			GUILayout.Space(10f);
			GUILayout.Label("Personal Bests (PBs) per Weapon", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			if (StatsOverlay.weaponPBs.Count > 0)
			{
				GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("Weapon", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
				GUILayout.Label("Best Final Time", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
				GUILayout.EndHorizontal();
				DrawSeparator();
				foreach (KeyValuePair<string, float> weaponPB in StatsOverlay.weaponPBs)
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label(weaponPB.Key, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
					int num4 = (int)(weaponPB.Value / 60f);
					int num5 = (int)(weaponPB.Value % 60f);
					int num6 = (int)(weaponPB.Value * 100f % 100f);
					GUILayout.Label($"{num4:D2}:{num5:D2}.{num6:D2}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
					GUILayout.EndHorizontal();
				}
				GUILayout.EndVertical();
			}
			else
			{
				GUILayout.Label("No Personal Best victories recorded yet.", labelStyle, Array.Empty<GUILayoutOption>());
			}
			GUILayout.Space(20f);
			DrawSeparator();
			GUILayout.Space(10f);
			GUILayout.Label("Best Segment Times (Gold Splits)", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			if (StatsOverlay.goldSplits.Count > 0)
			{
				GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("Segment Name", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
				GUILayout.Label("Best Time", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
				GUILayout.EndHorizontal();
				DrawSeparator();
				foreach (KeyValuePair<string, float> goldSplit in StatsOverlay.goldSplits)
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label(goldSplit.Key, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
					GUILayout.Label($"{goldSplit.Value:F2}s", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) });
					GUILayout.EndHorizontal();
				}
				GUILayout.EndVertical();
			}
			else
			{
				GUILayout.Label("No segment records recorded yet.", labelStyle, Array.Empty<GUILayoutOption>());
			}
			GUILayout.Space(20f);
			DrawSeparator();
			GUILayout.Space(10f);
			GUILayout.Label("Past Runs History", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(5f);
			if (StatsOverlay.pastRuns.Count > 0)
			{
				GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) });
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("Date", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
				GUILayout.Label("Weapon", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) });
				GUILayout.Label("Outcome", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) });
				GUILayout.Label("Final Time", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
				GUILayout.Label("Splits", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
				GUILayout.EndHorizontal();
				DrawSeparator();
				foreach (SpeedrunRunRecord pastRun in StatsOverlay.pastRuns)
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label(pastRun.DateString, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
					GUILayout.Label(pastRun.WeaponName, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) });
					GUIStyle val = new GUIStyle(labelStyle);
					val.normal.textColor = (pastRun.Status.StartsWith("Victory") ? new Color(0f, 1f, 0.4f) : new Color(0.9f, 0.3f, 0.3f));
					val.fontStyle = (FontStyle)1;
					GUILayout.Label(pastRun.Status, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) });
					int num7 = (int)(pastRun.FinalTime / 60f);
					int num8 = (int)(pastRun.FinalTime % 60f);
					int num9 = (int)(pastRun.FinalTime * 100f % 100f);
					GUILayout.Label($"{num7:D2}:{num8:D2}.{num9:D2}", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) });
					if (GUILayout.Button("View Splits", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
					{
						GUILayout.Width(90f),
						GUILayout.Height(20f)
					}))
					{
						selectedRunForSplits = pastRun;
					}
					GUILayout.EndHorizontal();
				}
				GUILayout.EndVertical();
				GUILayout.Space(15f);
				if (GUILayout.Button("Clear History", resetButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(140f),
					GUILayout.Height(28f)
				}))
				{
					StatsOverlay.pastRuns.Clear();
					StatsOverlay.weaponPBs.Clear();
					StatsOverlay.goldSplits.Clear();
					StatsOverlay.SaveHistoryToConfig();
				}
			}
			else
			{
				GUILayout.Label("No past runs recorded.", labelStyle, Array.Empty<GUILayoutOption>());
			}
			GUILayout.EndScrollView();
		}

		private static void DrawAboutPage()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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)
			aboutScrollPosition = GUILayout.BeginScrollView(aboutScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.ExpandWidth(true),
				GUILayout.ExpandHeight(true)
			});
			GUILayout.Label("LuckyEnhancements", headerStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			GUILayout.Label("This mod allows customizing graphics and gameplay options at runtime.", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("Features:", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label($"• Toggle settings menu using configurable keybind (Current: {ConfigManager.OpenMenuKey.Value})", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Display FPS counter at different positions (Left, Middle, Right)", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Real-world Clock HUD & Speedrun Timer overlays (independent fonts, colors, and positions)", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Option to run in background (focus loss support)", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Modify Game Speed and Field of View (FOV) in real-time", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Camera Zoom key (Hold vs Toggle) with automatic mouse sensitivity scaling", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Show Selected Bullet name, color, and queue indicator HUD under the crosshair", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Quick restart in-game hotkey (default R)", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Speedrun segment splits, Personal Bests list, Gold splits, and past runs Split Viewer", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Set a custom frame rate cap or play with uncapped FPS", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Expose hidden Unity shadow & quality parameters", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("• Smooth opening and closing animations", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(25f);
			GUILayout.Label("Mod status: Running & active", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndScrollView();
		}
	}
	[BepInPlugin("com.example.luckyenhancements", "LuckyEnhancements", "1.3.2")]
	public class LuckyEnhancementsPlugin : BaseUnityPlugin
	{
		private float fpsCount;

		private float updateInterval = 0.5f;

		private float accum;

		private int frames;

		private float timeleft;

		private bool speedrunTimerRunning;

		private bool hasStartedCurrentRun;

		private float speedrunTime;

		private GamePhase lastPhase = (GamePhase)7;

		private static FieldInfo csSensitivityField;

		private float? originalSensitivity;

		private PlayerCameraController lastCamCtrl;

		private bool isZoomToggled;

		private void Awake()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			ConfigManager.Initialize(((BaseUnityPlugin)this).Config);
			if (ConfigManager.PreserveWindowSize.Value)
			{
				float num = Mathf.Max(ConfigManager.WindowWidth.Value, 950f);
				float num2 = Mathf.Max(ConfigManager.WindowHeight.Value, 600f);
				MenuUI.windowRect = new Rect(ConfigManager.WindowX.Value, ConfigManager.WindowY.Value, num, num2);
			}
			else
			{
				MenuUI.windowRect = new Rect(100f, 100f, 950f, 600f);
			}
			timeleft = updateInterval;
			StatsOverlay.Initialize();
			GameControl.ApplyFpsLimit(MenuUI.isMenuOpen, MenuUI.menuTransitionProgress);
			GameControl.ApplyGraphicsSettings();
			Application.runInBackground = ConfigManager.DontStopOnFocusLoss.Value;
			ManualLogSource logger = ((BaseUnityPlugin)this).Logger;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(76, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("LuckyEnhancements (LiamGaming) loaded successfully! Press ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Key>(ConfigManager.OpenMenuKey.Value);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" to open settings.");
			}
			logger.LogInfo(val);
		}

		private void Update()
		{
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Invalid comparison between Unknown and I4
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Invalid comparison between Unknown and I4
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0518: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Invalid comparison between Unknown and I4
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Invalid comparison between Unknown and I4
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Invalid comparison between Unknown and I4
			Keyboard current = Keyboard.current;
			if (current == null || IsLoadingOrSplashActive())
			{
				return;
			}
			if (Application.runInBackground != ConfigManager.DontStopOnFocusLoss.Value)
			{
				Application.runInBackground = ConfigManager.DontStopOnFocusLoss.Value;
			}
			StatsOverlay.UpdateCpuTracker();
			UpdateSpeedrunTimer();
			float num = 5.5f;
			if (MenuUI.menuTransitionProgress != MenuUI.menuTargetProgress)
			{
				MenuUI.menuTransitionProgress = Mathf.MoveTowards(MenuUI.menuTransitionProgress, MenuUI.menuTargetProgress, Time.unscaledDeltaTime * num);
				if (MenuUI.menuTransitionProgress == 0f && !MenuUI.isMenuOpen)
				{
					Time.timeScale = ConfigManager.GameSpeed.Value;
					Cursor.visible = MenuUI.lastCursorVisible;
					Cursor.lockState = MenuUI.lastLockMode;
					GameControl.ApplyFpsLimit(MenuUI.isMenuOpen, MenuUI.menuTransitionProgress);
					GameControl.EnablePlayerLook();
					GameControl.EnableWeaponInput();
					GameControl.SetGamePauseState(paused: false);
				}
			}
			if (MenuUI.waitingForKeybind != "")
			{
				if (!((ButtonControl)current.anyKey).wasPressedThisFrame)
				{
					return;
				}
				Enumerator<KeyControl> enumerator = current.allKeys.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						KeyControl current2 = enumerator.Current;
						if (!((ButtonControl)current2).wasPressedThisFrame)
						{
							continue;
						}
						Key keyCode = current2.keyCode;
						if ((int)keyCode != 0)
						{
							if (MenuUI.waitingForKeybind == "Menu")
							{
								ConfigManager.OpenMenuKey.Value = keyCode;
								((ConfigEntryBase)ConfigManager.OpenMenuKey).ConfigFile.Save();
							}
							else if (MenuUI.waitingForKeybind == "Zoom")
							{
								ConfigManager.ZoomKey.Value = keyCode;
								((ConfigEntryBase)ConfigManager.ZoomKey).ConfigFile.Save();
							}
							else if (MenuUI.waitingForKeybind == "Restart")
							{
								ConfigManager.QuickRestartKey.Value = keyCode;
								((ConfigEntryBase)ConfigManager.QuickRestartKey).ConfigFile.Save();
							}
							MenuUI.waitingForKeybind = "";
							break;
						}
					}
					return;
				}
				finally
				{
					((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
				}
			}
			if (((ButtonControl)current[ConfigManager.OpenMenuKey.Value]).wasPressedThisFrame)
			{
				MenuUI.ToggleMenu();
			}
			if ((Object)(object)GameManager.Instance != (Object)null && !MenuUI.isMenuOpen && MenuUI.waitingForKeybind == "")
			{
				Key value = ConfigManager.QuickRestartKey.Value;
				if ((int)value != 0 && ((ButtonControl)current[value]).wasPressedThisFrame)
				{
					GamePhase phase = GameManager.Instance.Phase;
					if ((int)phase != 7 && (int)phase != 8)
					{
						MethodInfo method = typeof(GameManager).GetMethod("RestartRunNewSeedKeepLoadout", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
						if (method != null)
						{
							method.Invoke(GameManager.Instance, null);
						}
					}
				}
			}
			timeleft -= Time.unscaledDeltaTime;
			accum += 1f / Time.unscaledDeltaTime;
			frames++;
			if (timeleft <= 0f)
			{
				fpsCount = accum / (float)frames;
				timeleft = updateInterval;
				accum = 0f;
				frames = 0;
			}
			if (MenuUI.isMenuOpen || MenuUI.menuTransitionProgress > 0f)
			{
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
				Time.timeScale = 0f;
				GameControl.SetGamePauseState(paused: true);
			}
			try
			{
				Camera main = Camera.main;
				if ((Object)(object)main != (Object)null)
				{
					string value2 = ConfigManager.DisplayFilter.Value;
					bool flag = false;
					if ((Object)(object)GameManager.Instance != (Object)null)
					{
						GamePhase phase2 = GameManager.Instance.Phase;
						if ((int)phase2 == 3 || (int)phase2 == 7 || (int)phase2 == 6 || SettingsMenuManager.IsPaused)
						{
							flag = true;
						}
					}
					if (MenuUI.isMenuOpen)
					{
						flag = true;
					}
					if (value2 == "Pixelated" && !flag)
					{
						StatsOverlay.UpdatePixelatedTexture();
						if ((Object)(object)main.targetTexture != (Object)(object)StatsOverlay.pixelatedRt)
						{
							main.targetTexture = StatsOverlay.pixelatedRt;
						}
					}
					else
					{
						switch (value2)
						{
						case "Upside Down":
						case "Drunk Vision":
						case "Disco Shaker":
							if (flag)
							{
								break;
							}
							StatsOverlay.UpdateFullResTexture();
							if ((Object)(object)main.targetTexture != (Object)(object)StatsOverlay.fullResRt)
							{
								main.targetTexture = StatsOverlay.fullResRt;
							}
							goto end_IL_0320;
						}
						if ((Object)(object)main.targetTexture == (Object)(object)StatsOverlay.pixelatedRt || (Object)(object)main.targetTexture == (Object)(object)StatsOverlay.fullResRt)
						{
							main.targetTexture = null;
						}
					}
				}
				end_IL_0320:;
			}
			catch
			{
			}
			int num2 = ((MenuUI.isMenuOpen || MenuUI.menuTransitionProgress > 0f) ? (-1) : ConfigManager.FpsLimit.Value);
			if (num2 > 0)
			{
				if (QualitySettings.vSyncCount != 0)
				{
					QualitySettings.vSyncCount = 0;
				}
				if (Application.targetFrameRate != num2)
				{
					Application.targetFrameRate = num2;
				}
			}
			else if (num2 == -1 && Application.targetFrameRate != -1)
			{
				Application.targetFrameRate = -1;
			}
			bool isZooming = false;
			if (ConfigManager.EnableZoom.Value && !MenuUI.isMenuOpen && MenuUI.waitingForKeybind == "")
			{
				Key value3 = ConfigManager.ZoomKey.Value;
				if ((int)value3 != 0)
				{
					if (ConfigManager.ZoomType.Value == "Toggle")
					{
						if (((ButtonControl)current[value3]).wasPressedThisFrame)
						{
							isZoomToggled = !isZoomToggled;
						}
						isZooming = isZoomToggled;
					}
					else
					{
						isZoomToggled = false;
						isZooming = ((ButtonControl)current[value3]).isPressed;
					}
				}
			}
			else
			{
				isZoomToggled = false;
			}
			GameControl.ApplyFov(isZooming);
			UpdateZoomSensitivity(isZooming);
		}

		private void UpdateZoomSensitivity(bool isZooming)
		{
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Expected O, but got Unknown
			try
			{
				PlayerCameraController val = Object.FindFirstObjectByType<PlayerCameraController>();
				if ((Object)(object)val != (Object)null)
				{
					if (csSensitivityField == null)
					{
						csSensitivityField = typeof(PlayerCameraController).GetField("csSensitivity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
					}
					if (!(csSensitivityField != null))
					{
						return;
					}
					if (isZooming && ConfigManager.EnableZoom.Value)
					{
						if (!originalSensitivity.HasValue || (Object)(object)lastCamCtrl != (Object)(object)val)
						{
							originalSensitivity = (float)csSensitivityField.GetValue(val);
							lastCamCtrl = val;
						}
						float num = 1f;
						if (ConfigManager.ZoomSensitivityScale.Value && ConfigManager.Fov.Value > 0f)
						{
							Camera main = Camera.main;
							if ((Object)(object)main != (Object)null)
							{
								num = main.fieldOfView / ConfigManager.Fov.Value;
							}
						}
						float num2 = originalSensitivity.Value * num * ConfigManager.ZoomSensitivityMult.Value;
						csSensitivityField.SetValue(val, num2);
					}
					else if (originalSensitivity.HasValue && (Object)(object)lastCamCtrl != (Object)null)
					{
						csSensitivityField.SetValue(lastCamCtrl, originalSensitivity.Value);
						originalSensitivity = null;
						lastCamCtrl = null;
					}
				}
				else
				{
					originalSensitivity = null;
					lastCamCtrl = null;
				}
			}
			catch (Exception ex)
			{
				ManualLogSource logger = ((BaseUnityPlugin)this).Logger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(52, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[LuckyEnhancements] Error scaling zoom sensitivity: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
				}
				logger.LogError(val2);
			}
		}

		private void OnPhaseChanged(GamePhase oldPhase, GamePhase newPhase)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Invalid comparison between Unknown and I4
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Invalid comparison between Unknown and I4
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Invalid comparison between Unknown and I4
			if ((int)oldPhase == 1)
			{
				StatsOverlay.RecordSplit("Round " + (RoundContext.SelectedZeroBasedRoundIndex + 1), speedrunTime);
			}
			else if ((int)oldPhase == 3)
			{
				StatsOverlay.RecordSplit("Shop " + (RoundContext.SelectedZeroBasedRoundIndex + 1), speedrunTime);
			}
			if ((int)newPhase == 6)
			{
				string weaponName = "Unknown";
				if ((Object)(object)Weapon.Instance != (Object)null && (Object)(object)Weapon.Instance.WeaponData != (Object)null)
				{
					weaponName = Weapon.Instance.WeaponData.TitleResolved ?? ((object)Unsafe.As<WeaponName, WeaponName>(ref Weapon.Instance.WeaponData.weaponName)/*cast due to .constrained prefix*/).ToString();
				}
				bool flag = false;
				if ((Object)(object)GameManager.Instance != (Object)null)
				{
					flag = GameManager.Instance.IsGameOverDueToRunWon;
				}
				string status = (flag ? "Victory" : $"Defeat (Round {RoundContext.SelectedZeroBasedRoundIndex + 1})");
				StatsOverlay.RecordRunRecord(weaponName, status, speedrunTime);
			}
			else if ((int)newPhase == 7 && hasStartedCurrentRun)
			{
				string weaponName2 = "Unknown";
				if ((Object)(object)Weapon.Instance != (Object)null && (Object)(object)Weapon.Instance.WeaponData != (Object)null)
				{
					weaponName2 = Weapon.Instance.WeaponData.TitleResolved ?? ((object)Unsafe.As<WeaponName, WeaponName>(ref Weapon.Instance.WeaponData.weaponName)/*cast due to .constrained prefix*/).ToString();
				}
				StatsOverlay.RecordRunRecord(weaponName2, "Aborted", speedrunTime);
			}
		}

		private void UpdateSpeedrunTimer()
		{
			//IL_0013: 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)
			//IL_0019: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Invalid comparison between Unknown and I4
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Invalid comparison between Unknown and I4
			if ((Object)(object)GameManager.Instance == (Object)null)
			{
				return;
			}
			GamePhase phase = GameManager.Instance.Phase;
			if (phase != lastPhase)
			{
				OnPhaseChanged(lastPhase, phase);
				lastPhase = phase;
			}
			if ((int)phase == 6 || (int)phase == 7 || (int)phase == 8)
			{
				speedrunTimerRunning = false;
				hasStartedCurrentRun = false;
			}
			else if (GameManager.Instance.IsRoundActive)
			{
				if (!hasStartedCurrentRun && RoundContext.SelectedZeroBasedRoundIndex == 0)
				{
					speedrunTime = 0f;
					StatsOverlay.lastSplitTime = 0f;
					StatsOverlay.currentRunSplits.Clear();
					speedrunTimerRunning = true;
					hasStartedCurrentRun = true;
				}
				else if (hasStartedCurrentRun)
				{
					speedrunTimerRunning = true;
				}
			}
			if (speedrunTimerRunning && Time.timeScale != 0f && !SettingsMenuManager.IsPaused)
			{
				speedrunTime += Time.unscaledDeltaTime;
			}
		}

		private bool IsLoadingOrSplashActive()
		{
			//IL_0016: 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_001e: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Invalid comparison between Unknown and I4
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Invalid comparison between Unknown and I4
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Invalid comparison between Unknown and I4
			if ((Object)(object)GameManager.Instance == (Object)null)
			{
				return true;
			}
			GameManager instance = GameManager.Instance;
			GamePhase phase = instance.Phase;
			if ((int)phase == 1 || (int)phase == 3 || (int)phase == 8 || (int)phase == 6 || (int)phase == 5 || (int)phase == 0 || (int)phase == 2)
			{
				return false;
			}
			if ((int)phase == 7)
			{
				FieldInfo field = typeof(GameManager).GetField("mainMenuUI", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				if (field != null)
				{
					object? value = field.GetValue(instance);
					GameObject val = (GameObject)((value is GameObject) ? value : null);
					if ((Object)(object)val != (Object)null && val.activeInHierarchy)
					{
						return false;
					}
				}
			}
			return true;
		}

		private void OnGUI()
		{
			if (!IsLoadingOrSplashActive())
			{
				StatsOverlay.DrawDisplayFilter();
				StatsOverlay.DrawOverlays(MenuUI.isMenuOpen, MenuUI.menuTransitionProgress, fpsCount, speedrunTime);
				MenuUI.DrawMenu();
			}
		}

		private void OnDestroy()
		{
			MenuUI.SaveWindowSettings();
			try
			{
				Camera main = Camera.main;
				if ((Object)(object)main != (Object)null && (Object)(object)main.targetTexture == (Object)(object)StatsOverlay.pixelatedRt)
				{
					main.targetTexture = null;
				}
			}
			catch
			{
			}
		}
	}
	public static class StatsOverlay
	{
		private static Process currentProcess;

		private static TimeSpan lastCpuTime;

		private static DateTime lastRealTime;

		private static double cpuUsagePercent = 0.0;

		private static float cpuUpdateTimer = 0f;

		pr