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 ShowFps { get; private set; } public static ConfigEntry FpsLimit { get; private set; } public static ConfigEntry OpenMenuKey { get; private set; } public static ConfigEntry GameSpeed { get; private set; } public static ConfigEntry Fov { get; private set; } public static ConfigEntry ShowStats { get; private set; } public static ConfigEntry ShadowDistance { get; private set; } public static ConfigEntry LodBias { get; private set; } public static ConfigEntry AntiAliasing { get; private set; } public static ConfigEntry TextureQuality { get; private set; } public static ConfigEntry PreserveWindowSize { get; private set; } public static ConfigEntry WindowX { get; private set; } public static ConfigEntry WindowY { get; private set; } public static ConfigEntry WindowWidth { get; private set; } public static ConfigEntry WindowHeight { get; private set; } public static ConfigEntry ShowClock { get; private set; } public static ConfigEntry ClockSize { get; private set; } public static ConfigEntry ClockColorName { get; private set; } public static ConfigEntry ShowSpeedrunTimer { get; private set; } public static ConfigEntry TimerSize { get; private set; } public static ConfigEntry TimerColorName { get; private set; } public static ConfigEntry HudBgOpacity { get; private set; } public static ConfigEntry HudFontStyle { get; private set; } public static ConfigEntry DontStopOnFocusLoss { get; private set; } public static ConfigEntry HudSize { get; private set; } public static ConfigEntry HudColorName { get; private set; } public static ConfigEntry DisplayFilter { get; private set; } public static ConfigEntry EnableZoom { get; private set; } public static ConfigEntry ZoomKey { get; private set; } public static ConfigEntry ZoomFov { get; private set; } public static ConfigEntry ZoomType { get; private set; } public static ConfigEntry ZoomSensitivityScale { get; private set; } public static ConfigEntry ZoomSensitivityMult { get; private set; } public static ConfigEntry ShowSelectedBullet { get; private set; } public static ConfigEntry SelectedBulletSize { get; private set; } public static ConfigEntry SelectedBulletOffset { get; private set; } public static ConfigEntry ShowBulletQueue { get; private set; } public static ConfigEntry QuickRestartKey { get; private set; } public static ConfigEntry SpeedrunHistoryData { get; private set; } public static ConfigEntry SpeedrunPBsData { get; private set; } public static ConfigEntry SpeedrunGoldsData { get; private set; } public static void Initialize(ConfigFile config) { ShowFps = config.Bind("Graphics", "ShowFPS", "Off", "Where to show the FPS counter (Off, Left, Right, Middle)"); FpsLimit = config.Bind("Graphics", "FPSLimit", -1, "Target frame rate limit (e.g. 30, 60, 120, 144, -1 for unlimited)"); OpenMenuKey = config.Bind("Keybinds", "OpenMenuKey", (Key)95, "The key used to open/close the mod settings menu."); GameSpeed = config.Bind("Gameplay", "GameSpeed", 1f, "Game speed multiplier."); Fov = config.Bind("Gameplay", "FieldOfView", 60f, "Custom camera Field of View."); ShowStats = config.Bind("Graphics", "ShowStats", false, "Show the real-time statistics overlay on the left-middle of the screen."); ShadowDistance = config.Bind("Graphics", "ShadowDistance", 150f, "Custom shadow rendering distance limit."); LodBias = config.Bind("Graphics", "LodBias", 1f, "Custom Level of Detail (LOD) bias multiplier."); AntiAliasing = config.Bind("Graphics", "AntiAliasing", QualitySettings.antiAliasing, "Anti-Aliasing level (0 for Off, 2, 4, or 8)."); TextureQuality = config.Bind("Graphics", "TextureQuality", 0, "Global Texture Mipmap Limit (0 for Full Res, 1 for Half, 2 for Quarter)."); PreserveWindowSize = config.Bind("UI", "PreserveWindowSize", true, "Save the window size and position and restore them on startup."); WindowX = config.Bind("UI", "WindowX", 100f, "Saved window X position."); WindowY = config.Bind("UI", "WindowY", 100f, "Saved window Y position."); WindowWidth = config.Bind("UI", "WindowWidth", 950f, "Saved window width."); WindowHeight = config.Bind("UI", "WindowHeight", 600f, "Saved window height."); ShowClock = config.Bind("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("UI", "ClockSize", 16, "Font size of the HUD Clock overlay (10-40)."); ClockColorName = config.Bind("UI", "ClockColor", "Green-Cyan", "Color of the Clock overlay."); ShowSpeedrunTimer = config.Bind("UI", "ShowSpeedrunTimerMode", "Off", "Where to show the speedrun stopwatch HUD."); TimerSize = config.Bind("UI", "TimerSize", 16, "Font size of the speedrun timer overlay (10-40)."); TimerColorName = config.Bind("UI", "TimerColor", "Green-Cyan", "Color of the Speedrun Timer overlay."); HudBgOpacity = config.Bind("UI", "HudBgOpacity", 0f, "Opacity of the dark background box behind HUD overlays (0.0 = transparent, 1.0 = opaque)."); HudFontStyle = config.Bind("UI", "HudFontStyle", "Bold", "Font style for HUD text (Normal, Bold, Italic, BoldItalic)."); DontStopOnFocusLoss = config.Bind("UI", "DontStopOnFocusLoss", true, "Keep the game running when it loses focus."); HudSize = config.Bind("UI", "HUDSize", 16, "Font size of the HUD (Legacy)."); HudColorName = config.Bind("UI", "HUDColor", "Green-Cyan", "Color of the HUD (Legacy)."); DisplayFilter = config.Bind("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("Gameplay", "EnableZoom", true, "Enable the camera zoom hotkey."); ZoomKey = config.Bind("Keybinds", "ZoomKey", (Key)40, "Key used to zoom in the camera."); ZoomFov = config.Bind("Gameplay", "ZoomFOV", 30f, "Target FOV when zoomed in (10-50)."); ZoomType = config.Bind("Gameplay", "ZoomType", "Hold", "How the zoom key behaves (Hold = zoom while pressed, Toggle = press to toggle zoom)."); ZoomSensitivityScale = config.Bind("Gameplay", "ZoomSensitivityScale", true, "Scale mouse sensitivity down while zoomed in to maintain relative speed."); ZoomSensitivityMult = config.Bind("Gameplay", "ZoomSensitivityMultiplier", 1f, "Manual sensitivity multiplier applied during zoom (0.1 to 2.0)."); ShowSelectedBullet = config.Bind("UI", "ShowSelectedBullet", "Dot Queue Only", "Display the next bullet name and details under the crosshair."); SelectedBulletSize = config.Bind("UI", "SelectedBulletSize", 13, "Font size of the selected bullet text (10-30)."); SelectedBulletOffset = config.Bind("UI", "SelectedBulletOffset", 40f, "Vertical pixel distance of bullet name below the crosshair."); ShowBulletQueue = config.Bind("UI", "ShowBulletQueue", true, "Show the next 3 upcoming bullets as colored indicators below the crosshair."); QuickRestartKey = config.Bind("Keybinds", "QuickRestartKey", (Key)32, "Key used to instantly restart the current run in-game."); SpeedrunHistoryData = config.Bind("Hidden", "SpeedrunHistoryData", "", "Serialized speedrun history records."); SpeedrunPBsData = config.Bind("Hidden", "SpeedrunPBsData", "", "Serialized Personal Best times per weapon."); SpeedrunGoldsData = config.Bind("Hidden", "SpeedrunGoldsData", "", "Serialized best round segment times (Gold Splits)."); ConfigEntry val = config.Bind("UI", "ShowClock", false, ""); if (val.Value && ShowClock.Value == "Off") { ShowClock.Value = "Top-Left"; val.Value = false; config.Save(); } ConfigEntry val2 = config.Bind("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("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(); 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(); 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()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); 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()); 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()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); 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()); for (int i = 0; i < 5; i++) { GUILayout.BeginHorizontal(Array.Empty()); 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()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); GUILayout.Label("Show Clock HUD:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); string value3 = ConfigManager.ShowClock.Value; GUILayout.BeginVertical(Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); GUILayout.Label("Show Timer HUD:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); string value4 = ConfigManager.ShowSpeedrunTimer.Value; GUILayout.BeginVertical(Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); GUILayout.Label("Timer Text Color:", labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); string value6 = ConfigManager.TimerColorName.Value; GUILayout.BeginVertical(Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); 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()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); 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()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); 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()); GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); GUILayout.Space(5f); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); 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()); 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()); 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()); GUILayout.Space(10f); if (selectedRunForSplits != null) { GUILayout.Label("Splits for run on " + selectedRunForSplits.DateString + " (" + selectedRunForSplits.WeaponName + ")", headerStyle, Array.Empty()); 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()); 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()); 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()); } 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()); GUILayout.Space(5f); if (StatsOverlay.currentRunSplits.Count > 0) { GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); } GUILayout.Space(20f); DrawSeparator(); GUILayout.Space(10f); GUILayout.Label("Personal Bests (PBs) per Weapon", headerStyle, Array.Empty()); GUILayout.Space(5f); if (StatsOverlay.weaponPBs.Count > 0) { GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.BeginHorizontal(Array.Empty()); 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 weaponPB in StatsOverlay.weaponPBs) { GUILayout.BeginHorizontal(Array.Empty()); 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()); } GUILayout.Space(20f); DrawSeparator(); GUILayout.Space(10f); GUILayout.Label("Best Segment Times (Gold Splits)", headerStyle, Array.Empty()); GUILayout.Space(5f); if (StatsOverlay.goldSplits.Count > 0) { GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.BeginHorizontal(Array.Empty()); 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 goldSplit in StatsOverlay.goldSplits) { GUILayout.BeginHorizontal(Array.Empty()); 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()); } GUILayout.Space(20f); DrawSeparator(); GUILayout.Space(10f); GUILayout.Label("Past Runs History", headerStyle, Array.Empty()); GUILayout.Space(5f); if (StatsOverlay.pastRuns.Count > 0) { GUILayout.BeginVertical(StatsOverlay.statsBoxStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.BeginHorizontal(Array.Empty()); 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()); 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()); } 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()); GUILayout.Space(10f); GUILayout.Label("This mod allows customizing graphics and gameplay options at runtime.", labelStyle, Array.Empty()); GUILayout.Label("Features:", labelStyle, Array.Empty()); GUILayout.Label($"• Toggle settings menu using configurable keybind (Current: {ConfigManager.OpenMenuKey.Value})", labelStyle, Array.Empty()); GUILayout.Label("• Display FPS counter at different positions (Left, Middle, Right)", labelStyle, Array.Empty()); GUILayout.Label("• Real-world Clock HUD & Speedrun Timer overlays (independent fonts, colors, and positions)", labelStyle, Array.Empty()); GUILayout.Label("• Option to run in background (focus loss support)", labelStyle, Array.Empty()); GUILayout.Label("• Modify Game Speed and Field of View (FOV) in real-time", labelStyle, Array.Empty()); GUILayout.Label("• Camera Zoom key (Hold vs Toggle) with automatic mouse sensitivity scaling", labelStyle, Array.Empty()); GUILayout.Label("• Show Selected Bullet name, color, and queue indicator HUD under the crosshair", labelStyle, Array.Empty()); GUILayout.Label("• Quick restart in-game hotkey (default R)", labelStyle, Array.Empty()); GUILayout.Label("• Speedrun segment splits, Personal Bests list, Gold splits, and past runs Split Viewer", labelStyle, Array.Empty()); GUILayout.Label("• Set a custom frame rate cap or play with uncapped FPS", labelStyle, Array.Empty()); GUILayout.Label("• Expose hidden Unity shadow & quality parameters", labelStyle, Array.Empty()); GUILayout.Label("• Smooth opening and closing animations", labelStyle, Array.Empty()); GUILayout.Space(25f); GUILayout.Label("Mod status: Running & active", labelStyle, Array.Empty()); 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(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 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(); 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(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(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(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; private static string gpuName = ""; public static List currentRunSplits = new List(); public static List pastRuns = new List(); public static Dictionary weaponPBs = new Dictionary(); public static Dictionary goldSplits = new Dictionary(); public static float lastSplitTime = 0f; private static Texture2D blackTexture; private static Texture2D whiteTexture; private static Texture2D scanlineTexture; private static Texture2D amberTexture; private static Texture2D greenTexture; private static Texture2D sepiaTexture; private static Texture2D vignetteTexture; private static Texture2D iceVignetteTexture; public static RenderTexture pixelatedRt = null; public static RenderTexture fullResRt = null; private static int lastScreenWidth = 0; private static int lastScreenHeight = 0; public static GUIStyle statsBoxStyle; public static GUIStyle statsLabelStyle; public static GUIStyle hudLabelStyle; private static bool stylesInitialized = false; private static float[] matrixColumnsY = null; private static string[] matrixColumnsText = null; public static double CpuUsage => cpuUsagePercent; public static string GpuName => gpuName; public static void Initialize() { try { currentProcess = Process.GetCurrentProcess(); lastCpuTime = currentProcess.TotalProcessorTime; lastRealTime = DateTime.UtcNow; string graphicsDeviceName = SystemInfo.graphicsDeviceName; gpuName = ((graphicsDeviceName.Length > 22) ? (graphicsDeviceName.Substring(0, 20) + "..") : graphicsDeviceName); LoadHistoryFromConfig(); } catch (Exception ex) { Debug.LogError((object)("[LuckyEnhancements] Error initializing stats tracker: " + ex.Message)); } } public static void UpdateCpuTracker() { if (currentProcess == null) { return; } cpuUpdateTimer += Time.unscaledDeltaTime; if (!(cpuUpdateTimer >= 1f)) { return; } try { DateTime utcNow = DateTime.UtcNow; TimeSpan totalProcessorTime = currentProcess.TotalProcessorTime; double totalMilliseconds = (utcNow - lastRealTime).TotalMilliseconds; double totalMilliseconds2 = (totalProcessorTime - lastCpuTime).TotalMilliseconds; if (totalMilliseconds > 0.0) { cpuUsagePercent = totalMilliseconds2 / totalMilliseconds / (double)Environment.ProcessorCount * 100.0; } lastCpuTime = totalProcessorTime; lastRealTime = utcNow; } catch { } cpuUpdateTimer = 0f; } 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!stylesInitialized) { Texture2D background = CreateColorTexture(new Color(0.08f, 0.08f, 0.09f, 0.85f)); statsBoxStyle = new GUIStyle(GUI.skin.box); statsBoxStyle.normal.background = background; statsBoxStyle.border = new RectOffset(2, 2, 2, 2); statsLabelStyle = new GUIStyle(); statsLabelStyle.normal.textColor = new Color(0.9f, 0.9f, 0.9f); statsLabelStyle.fontSize = 13; statsLabelStyle.margin = new RectOffset(0, 0, 2, 2); hudLabelStyle = new GUIStyle(); hudLabelStyle.normal.textColor = new Color(0f, 1f, 0.4f, 1f); hudLabelStyle.fontSize = 16; hudLabelStyle.fontStyle = (FontStyle)1; 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 CreateVignetteTexture() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)vignetteTexture != (Object)null) { return; } int num = 128; vignetteTexture = new Texture2D(num, num); ((Texture)vignetteTexture).wrapMode = (TextureWrapMode)1; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = ((float)j - (float)num / 2f) / ((float)num / 2f); float num3 = ((float)i - (float)num / 2f) / ((float)num / 2f); float num4 = Mathf.Clamp01((Mathf.Sqrt(num2 * num2 + num3 * num3) - 0.5f) / 0.5f); vignetteTexture.SetPixel(j, i, new Color(0f, 0f, 0f, num4 * 0.9f)); } } vignetteTexture.Apply(); } private static void CreateIceVignetteTexture() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)iceVignetteTexture != (Object)null) { return; } int num = 128; iceVignetteTexture = new Texture2D(num, num); ((Texture)iceVignetteTexture).wrapMode = (TextureWrapMode)1; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = ((float)j - (float)num / 2f) / ((float)num / 2f); float num3 = ((float)i - (float)num / 2f) / ((float)num / 2f); float num4 = Mathf.Clamp01((Mathf.Sqrt(num2 * num2 + num3 * num3) - 0.4f) / 0.6f); iceVignetteTexture.SetPixel(j, i, new Color(0.8f, 0.92f, 1f, num4 * 0.6f)); } } iceVignetteTexture.Apply(); } private static FontStyle GetHudFontStyle() { return (FontStyle)(ConfigManager.HudFontStyle.Value switch { "Normal" => 0, "Italic" => 2, "BoldItalic" => 3, _ => 1, }); } public static void DrawOverlays(bool isMenuOpen, float menuTransitionProgress, float fpsCount, float elapsedSpeedrunTime) { InitStyles(); List list = new List(); DrawFpsOverlay(fpsCount, list); DrawClockOverlay(list); DrawSpeedrunTimerOverlay(elapsedSpeedrunTime, list); DrawPositionGroup(list, "Top-Left"); DrawPositionGroup(list, "Top-Middle"); DrawPositionGroup(list, "Top-Right"); DrawPositionGroup(list, "Bottom-Left"); DrawPositionGroup(list, "Bottom-Middle"); DrawPositionGroup(list, "Bottom-Right"); DrawStatsOverlayPanel(isMenuOpen, menuTransitionProgress); DrawSelectedBulletHUD(); } private static void DrawFpsOverlay(float fpsCount, List elements) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) string value = ConfigManager.ShowFps.Value; if (!string.IsNullOrEmpty(value)) { string position = value switch { "Middle" => "Top-Middle", "Left" => "Top-Left", _ => "Top-Right", }; elements.Add(new HudElementToDraw { Text = $"FPS: {fpsCount:F0}", Size = 16, Color = GetColorByName("Green-Cyan"), Position = position, Width = 90f, Height = 22f }); } } private static void DrawClockOverlay(List elements) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) string value = ConfigManager.ShowClock.Value; if (!string.IsNullOrEmpty(value)) { object obj; switch (value) { case "false": return; default: obj = value; break; case "true": obj = "Top-Left"; break; } string position = (string)obj; elements.Add(new HudElementToDraw { Text = DateTime.Now.ToString("HH:mm:ss"), Size = ConfigManager.ClockSize.Value, Color = GetColorByName(ConfigManager.ClockColorName.Value), Position = position, Width = 90 + (ConfigManager.ClockSize.Value - 10) * 5, Height = ConfigManager.ClockSize.Value + 6 }); } } private static void DrawSpeedrunTimerOverlay(float elapsedTime, List elements) { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) string value = ConfigManager.ShowSpeedrunTimer.Value; if (!string.IsNullOrEmpty(value)) { object obj; switch (value) { case "false": return; default: obj = value; break; case "true": obj = "Top-Left"; break; } string position = (string)obj; int num = (int)(elapsedTime / 60f); int num2 = (int)(elapsedTime % 60f); int num3 = (int)(elapsedTime * 100f % 100f); string text = $"{num:D2}:{num2:D2}.{num3:D2}"; elements.Add(new HudElementToDraw { Text = text, Size = ConfigManager.TimerSize.Value, Color = GetColorByName(ConfigManager.TimerColorName.Value), Position = position, Width = 100 + (ConfigManager.TimerSize.Value - 10) * 6, Height = ConfigManager.TimerSize.Value + 6 }); } } private static void DrawPositionGroup(List allElements, string position) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) List list = allElements.FindAll((HudElementToDraw e) => e.Position == position); if (list.Count == 0) { return; } bool flag = position.StartsWith("Top-"); float num = (flag ? 15f : ((float)Screen.height - 15f)); Rect val = default(Rect); foreach (HudElementToDraw item in list) { float num2 = 15f; if (position.EndsWith("-Middle")) { num2 = ((float)Screen.width - item.Width) / 2f; } else if (position.EndsWith("-Right")) { num2 = (float)Screen.width - item.Width - 15f; } float num3 = (flag ? num : (num - item.Height)); ((Rect)(ref val))..ctor(num2, num3, item.Width, item.Height); float value = ConfigManager.HudBgOpacity.Value; if (value > 0f) { if ((Object)(object)blackTexture == (Object)null) { blackTexture = CreateColorTexture(Color.black); } Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, value); GUI.DrawTexture(val, (Texture)(object)blackTexture); GUI.color = color; } GUIStyle val2 = new GUIStyle(); val2.fontSize = item.Size; val2.fontStyle = GetHudFontStyle(); val2.normal.textColor = item.Color; val2.alignment = (TextAnchor)(position.EndsWith("-Middle") ? 4 : (position.EndsWith("-Right") ? 5 : 3)); GUIStyle val3 = new GUIStyle(val2); val3.normal.textColor = new Color(0f, 0f, 0f, 0.7f); float num4 = Mathf.Max(1f, (float)item.Size / 12f); GUI.Label(new Rect(((Rect)(ref val)).x + num4, ((Rect)(ref val)).y + num4, ((Rect)(ref val)).width, ((Rect)(ref val)).height), item.Text, val3); GUI.Label(val, item.Text, val2); num = ((!flag) ? (num - (item.Height + 5f)) : (num + (item.Height + 5f))); } } private static void DrawSelectedBulletHUD() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameManager.Instance == (Object)null || (int)GameManager.Instance.Phase != 1 || SettingsMenuManager.IsPaused || MenuUI.isMenuOpen || MenuUI.menuTransitionProgress > 0f) { return; } string value = ConfigManager.ShowSelectedBullet.Value; if (string.IsNullOrEmpty(value) || value == "Off") { return; } Weapon instance = Weapon.Instance; if ((Object)(object)instance == (Object)null || instance.BulletMagazine == null || instance.BulletMagazine.Count == 0) { return; } BulletItemData val = instance.BulletMagazine[0]; if ((Object)(object)val == (Object)null) { return; } float num = (float)Screen.width / 2f; float num2 = (float)Screen.height / 2f + ConfigManager.SelectedBulletOffset.Value; if (value != "Dot Queue Only") { string text = "Normal Bullet"; if (!val.isNormalBullet && val.shopItem != null) { text = LocalizationManager.Get(val.shopItem.nameKey, val.shopItem.nameKey); } else if (val.isNormalBullet && val.shopItem != null && !string.IsNullOrEmpty(val.shopItem.nameKey)) { text = LocalizationManager.Get(val.shopItem.nameKey, val.shopItem.nameKey); } string text2 = text; if (value == "Name & Ammo Count") { text2 += $" ({instance.CurrentAmmo}/{instance.MaxAmmo})"; } GUIStyle val2 = new GUIStyle(); val2.fontSize = ConfigManager.SelectedBulletSize.Value; val2.fontStyle = (FontStyle)1; val2.alignment = (TextAnchor)4; val2.normal.textColor = val.bulletUIColor; GUIStyle val3 = new GUIStyle(val2); val3.normal.textColor = new Color(0f, 0f, 0f, 0.7f); float num3 = 1f; GUI.Label(new Rect(num - 150f + num3, num2 + num3, 300f, 30f), text2, val3); GUI.Label(new Rect(num - 150f, num2, 300f, 30f), text2, val2); } if (!ConfigManager.ShowBulletQueue.Value || instance.BulletMagazine.Count <= 0) { return; } int num4 = Mathf.Min(instance.BulletMagazine.Count, 5); float num5 = 10f; float num6 = 5f; float num7 = (float)num4 * num5 + (float)(num4 - 1) * num6; float num8 = (float)Screen.width / 2f - num7 / 2f; float num9 = num2; if (value != "Dot Queue Only") { num9 = num2 + (float)ConfigManager.SelectedBulletSize.Value + 8f; } if ((Object)(object)whiteTexture == (Object)null) { whiteTexture = CreateColorTexture(Color.white); } Rect val5 = default(Rect); for (int i = 0; i < num4; i++) { BulletItemData val4 = instance.BulletMagazine[i]; if ((Object)(object)val4 != (Object)null) { ((Rect)(ref val5))..ctor(num8 + (float)i * (num5 + num6), num9, num5, num5); Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, 0.75f); GUI.DrawTexture(new Rect(((Rect)(ref val5)).x - 1f, ((Rect)(ref val5)).y - 1f, ((Rect)(ref val5)).width + 2f, ((Rect)(ref val5)).height + 2f), (Texture)(object)whiteTexture); GUI.color = val4.bulletUIColor; GUI.DrawTexture(val5, (Texture)(object)whiteTexture); GUI.color = color; } } } private static void DrawStatsOverlayPanel(bool isMenuOpen, float menuTransitionProgress) { //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!ConfigManager.ShowStats.Value) { return; } string value = "N/A"; string value2 = "No"; string value3 = "N/A"; string value4 = "None"; string value5 = "0"; string value6 = "N/A"; if ((Object)(object)GameManager.Instance != (Object)null) { value = (RoundContext.SelectedZeroBasedRoundIndex + 1).ToString(); value2 = ((Time.timeScale == 0f && !isMenuOpen && menuTransitionProgress == 0f) ? "Yes" : "No"); value5 = GameManager.Instance.TargetsDestroyedThisRound.ToString(); value6 = ((object)GameManager.Instance.Phase/*cast due to .constrained prefix*/).ToString(); } if ((Object)(object)Weapon.Instance != (Object)null) { value3 = $"{Weapon.Instance.CurrentAmmo} / {Weapon.Instance.MaxAmmo}"; if ((Object)(object)Weapon.Instance.WeaponData != (Object)null) { value4 = Weapon.Instance.WeaponData.TitleResolved ?? ((object)Unsafe.As(ref Weapon.Instance.WeaponData.weaponName)/*cast due to .constrained prefix*/).ToString(); } } long num = Profiler.GetTotalAllocatedMemoryLong() / 1048576; long num2 = Profiler.GetTotalReservedMemoryLong() / 1048576; float num3 = 260f; float num4 = 240f; float num5 = 15f; float num6 = ((float)Screen.height - num4) / 2f; GUILayout.BeginArea(new Rect(num5, num6, num3, num4), statsBoxStyle); GUILayout.BeginVertical(Array.Empty()); GUIStyle val = new GUIStyle(statsLabelStyle); val.fontStyle = (FontStyle)1; val.normal.textColor = new Color(0.18f, 0.48f, 0.82f, 1f); val.fontSize = 14; GUILayout.Label("LuckyEnhancements Stats", val, Array.Empty()); GUILayout.Space(5f); DrawStatRow("Round:", value); DrawStatRow("Paused:", value2); DrawStatRow("Ammo Left:", value3); DrawStatRow("Weapon:", value4); DrawStatRow("Targets Hit:", value5); DrawStatRow("Game Phase:", value6); GUILayout.Space(8f); DrawStatRow("CPU Usage:", $"{cpuUsagePercent:F1}%"); DrawStatRow("RAM Allocated:", $"{num}MB / {num2}MB"); DrawStatRow("GPU Info:", gpuName ?? ""); GUILayout.Space(8f); DrawStatRow("Shadow Distance:", $"{QualitySettings.shadowDistance:F0}m"); DrawStatRow("LOD Bias:", $"{QualitySettings.lodBias:F2}x"); GUILayout.EndVertical(); GUILayout.EndArea(); } private static void DrawStatRow(string label, string value) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, statsLabelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }); GUIStyle val = new GUIStyle(statsLabelStyle); val.normal.textColor = Color.white; val.fontStyle = (FontStyle)1; GUILayout.Label(value, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); GUILayout.EndHorizontal(); } public static Color GetColorByName(string name) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) return (Color)(name switch { "Hot Pink" => new Color(1f, 0.07f, 0.57f, 1f), "Neon Purple" => new Color(0.7f, 0f, 1f, 1f), "Electric Blue" => new Color(0f, 0.6f, 1f, 1f), "Sun Gold" => new Color(1f, 0.84f, 0f, 1f), "Ice White" => new Color(0.95f, 0.95f, 0.95f, 1f), "Crimson Red" => new Color(0.9f, 0.1f, 0.1f, 1f), _ => new Color(0f, 1f, 0.4f, 1f), }); } private static void DrawMatrixDigitalOverlay() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) int num = 15; if (matrixColumnsY == null || matrixColumnsY.Length != num) { matrixColumnsY = new float[num]; matrixColumnsText = new string[num]; for (int i = 0; i < num; i++) { matrixColumnsY[i] = Random.Range(-200f, 0f); matrixColumnsText[i] = "1010101"; } } GUIStyle val = new GUIStyle(); val.normal.textColor = new Color(0f, 1f, 0.2f, 0.4f); val.fontSize = 11; float num2 = (float)Screen.width / (float)num; for (int j = 0; j < num; j++) { matrixColumnsY[j] += Time.unscaledDeltaTime * 180f; if (matrixColumnsY[j] > (float)Screen.height) { matrixColumnsY[j] = -200f; } if (Random.value < 0.15f) { StringBuilder stringBuilder = new StringBuilder(); for (int k = 0; k < 8; k++) { stringBuilder.Append((Random.value < 0.5f) ? "0" : "1"); } matrixColumnsText[j] = stringBuilder.ToString(); } GUI.Label(new Rect((float)j * num2 + 10f, matrixColumnsY[j], 50f, 200f), matrixColumnsText[j], val); } } public static void DrawDisplayFilter() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0a6b: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_0791: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_08c6: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09b7: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09da: Unknown result type (might be due to invalid IL or missing references) string value = ConfigManager.DisplayFilter.Value; if (string.IsNullOrEmpty(value) || value == "None") { return; } if ((Object)(object)blackTexture == (Object)null) { blackTexture = CreateColorTexture(Color.black); } if ((Object)(object)whiteTexture == (Object)null) { whiteTexture = CreateColorTexture(Color.white); } if ((Object)(object)amberTexture == (Object)null) { amberTexture = CreateColorTexture(new Color(1f, 0.6f, 0f, 0.24f)); } if ((Object)(object)greenTexture == (Object)null) { greenTexture = CreateColorTexture(new Color(0f, 1f, 0.2f, 0.24f)); } if ((Object)(object)sepiaTexture == (Object)null) { sepiaTexture = CreateColorTexture(new Color(0.7f, 0.55f, 0.4f, 0.3f)); } Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)Screen.width, (float)Screen.height); Color color = GUI.color; switch (value) { case "Very Dark": GUI.color = new Color(1f, 1f, 1f, 0.75f); GUI.DrawTexture(val, (Texture)(object)blackTexture); break; case "Very Bright": GUI.color = new Color(1f, 1f, 1f, 0.35f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); break; case "Retro Amber": GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)amberTexture); DrawTiledScanlines(0.45f, 0.3f); break; case "Fallout Green": GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)greenTexture); DrawTiledScanlines(0.45f, 0.3f); break; case "Sepia": GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)sepiaTexture); break; case "Scanlines": GUI.color = Color.white; DrawTiledScanlines(0.65f, 0.4f); break; case "RGB Lights": { Color color3 = Color.HSVToRGB(Time.unscaledTime * 0.4f % 1f, 0.85f, 0.85f); color3.a = 0.15f; GUI.color = color3; GUI.DrawTexture(val, (Texture)(object)whiteTexture); break; } case "Cinematic Letterbox": { GUI.color = Color.white; float num14 = (float)Screen.height * 0.12f; GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, num14), (Texture)(object)blackTexture); GUI.DrawTexture(new Rect(0f, (float)Screen.height - num14, (float)Screen.width, num14), (Texture)(object)blackTexture); break; } case "Matrix Digital": GUI.color = new Color(0f, 1f, 0f, 0.1f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = Color.white; DrawTiledScanlines(0.45f, 0.35f); DrawMatrixDigitalOverlay(); break; case "Rainbow Wave": { Color color2 = Color.HSVToRGB(Time.unscaledTime * 0.15f % 1f, 0.9f, 0.75f); color2.a = 0.16f; GUI.color = color2; GUI.DrawTexture(val, (Texture)(object)whiteTexture); break; } case "CRT Retro Arcade": CreateVignetteTexture(); GUI.color = new Color(1f, 0.55f, 0.2f, 0.18f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)vignetteTexture); DrawTiledScanlines(0.6f, 0.3f); break; case "VHS Static": { GUI.color = new Color(0.5f, 0.5f, 0.5f, 0.07f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = Color.white; float num9 = Time.unscaledTime * 110f % (float)Screen.height; float num10 = (Time.unscaledTime * 190f + (float)Screen.height / 2f) % (float)Screen.height; GUI.color = new Color(1f, 1f, 1f, 0.28f); GUI.DrawTexture(new Rect(0f, num9, (float)Screen.width, 10f), (Texture)(object)whiteTexture); GUI.DrawTexture(new Rect(0f, num10, (float)Screen.width, 5f), (Texture)(object)whiteTexture); float num11 = Random.Range(0.12f, 0.22f); GUI.color = new Color(1f, 1f, 1f, num11); float scrollSpeed = 12f + Random.Range(-3f, 3f); DrawTiledScanlines(0.65f, scrollSpeed); break; } case "Night Vision": { CreateVignetteTexture(); GUI.color = new Color(0f, 0.95f, 0.1f, 0.25f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)vignetteTexture); DrawTiledScanlines(0.4f, 0.5f); float num15 = Random.Range(0f, (float)Screen.height); GUI.color = new Color(0f, 1f, 0.2f, 0.35f); GUI.DrawTexture(new Rect(0f, num15, (float)Screen.width, 3f), (Texture)(object)whiteTexture); break; } case "Doom Red": CreateVignetteTexture(); GUI.color = new Color(0.9f, 0.05f, 0.05f, 0.26f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = new Color(0.35f, 0f, 0f, 1f); GUI.DrawTexture(val, (Texture)(object)vignetteTexture); break; case "Blizzard Ice": CreateIceVignetteTexture(); GUI.color = new Color(0.75f, 0.88f, 1f, 0.18f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)iceVignetteTexture); break; case "Pixelated": { Camera main4 = Camera.main; if ((Object)(object)pixelatedRt != (Object)null && (Object)(object)main4 != (Object)null && (Object)(object)main4.targetTexture == (Object)(object)pixelatedRt) { GUI.color = Color.white; GUI.DrawTexture(val, (Texture)(object)pixelatedRt, (ScaleMode)0, false); } break; } case "Upside Down": { Camera main3 = Camera.main; if ((Object)(object)fullResRt != (Object)null && (Object)(object)main3 != (Object)null && (Object)(object)main3.targetTexture == (Object)(object)fullResRt) { GUI.color = Color.white; GUI.matrix = Matrix4x4.TRS(new Vector3(0f, (float)Screen.height, 0f), Quaternion.identity, new Vector3(1f, -1f, 1f)); GUI.DrawTexture(val, (Texture)(object)fullResRt, (ScaleMode)0, false); GUI.matrix = Matrix4x4.identity; } break; } case "Drunk Vision": { Camera main2 = Camera.main; if ((Object)(object)fullResRt != (Object)null && (Object)(object)main2 != (Object)null && (Object)(object)main2.targetTexture == (Object)(object)fullResRt) { float num12 = Mathf.Sin(Time.time * 2f) * 15f; float num13 = Mathf.Cos(Time.time * 1.5f) * 10f; GUI.color = new Color(1f, 0.2f, 0.2f, 0.4f); GUI.DrawTexture(new Rect(num12, num13, (float)Screen.width, (float)Screen.height), (Texture)(object)fullResRt); GUI.color = new Color(0.2f, 1f, 0.2f, 0.4f); GUI.DrawTexture(new Rect(0f - num12, 0f - num13, (float)Screen.width, (float)Screen.height), (Texture)(object)fullResRt); GUI.color = new Color(1f, 1f, 1f, 0.7f); GUI.DrawTexture(val, (Texture)(object)fullResRt); } break; } case "Disco Shaker": { Camera main = Camera.main; if ((Object)(object)fullResRt != (Object)null && (Object)(object)main != (Object)null && (Object)(object)main.targetTexture == (Object)(object)fullResRt) { float num4 = Random.Range(-10f, 10f); float num5 = Random.Range(-10f, 10f); float num6 = Mathf.Sin(Time.time * 8f) * 0.5f + 0.5f; float num7 = Mathf.Sin(Time.time * 8f + 2f) * 0.5f + 0.5f; float num8 = Mathf.Sin(Time.time * 8f + 4f) * 0.5f + 0.5f; GUI.color = new Color(num6, num7, num8, 0.15f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); GUI.color = Color.white; GUI.DrawTexture(new Rect(num4, num5, (float)Screen.width, (float)Screen.height), (Texture)(object)fullResRt); } break; } case "Rainbow Rave": { float num = Mathf.Sin(Time.time * 5f) * 0.5f + 0.5f; float num2 = Mathf.Sin(Time.time * 5f + 2f) * 0.5f + 0.5f; float num3 = Mathf.Sin(Time.time * 5f + 4f) * 0.5f + 0.5f; GUI.color = new Color(num, num2, num3, 0.22f); GUI.DrawTexture(val, (Texture)(object)whiteTexture); break; } } GUI.color = color; } public static void UpdatePixelatedTexture() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown int num = 4; int num2 = Mathf.Max(32, Screen.width / num); int num3 = Mathf.Max(18, Screen.height / num); if ((Object)(object)pixelatedRt == (Object)null || lastScreenWidth != Screen.width || lastScreenHeight != Screen.height) { if ((Object)(object)pixelatedRt != (Object)null) { pixelatedRt.Release(); } pixelatedRt = new RenderTexture(num2, num3, 24, (RenderTextureFormat)0); ((Texture)pixelatedRt).filterMode = (FilterMode)0; ((Texture)pixelatedRt).wrapMode = (TextureWrapMode)1; pixelatedRt.Create(); lastScreenWidth = Screen.width; lastScreenHeight = Screen.height; } } public static void UpdateFullResTexture() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown if ((Object)(object)fullResRt == (Object)null || lastScreenWidth != Screen.width || lastScreenHeight != Screen.height) { if ((Object)(object)fullResRt != (Object)null) { fullResRt.Release(); } fullResRt = new RenderTexture(Screen.width, Screen.height, 24, (RenderTextureFormat)0); ((Texture)fullResRt).filterMode = (FilterMode)1; ((Texture)fullResRt).wrapMode = (TextureWrapMode)1; fullResRt.Create(); lastScreenWidth = Screen.width; lastScreenHeight = Screen.height; } } private static void CreateScanlineTexture() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)scanlineTexture != (Object)null)) { scanlineTexture = new Texture2D(1, 8); ((Texture)scanlineTexture).filterMode = (FilterMode)0; ((Texture)scanlineTexture).wrapMode = (TextureWrapMode)0; Color val = default(Color); ((Color)(ref val))..ctor(0f, 0f, 0f, 0.85f); scanlineTexture.SetPixel(0, 0, val); scanlineTexture.SetPixel(0, 1, val); scanlineTexture.SetPixel(0, 2, val); scanlineTexture.SetPixel(0, 3, val); scanlineTexture.SetPixel(0, 4, Color.clear); scanlineTexture.SetPixel(0, 5, Color.clear); scanlineTexture.SetPixel(0, 6, Color.clear); scanlineTexture.SetPixel(0, 7, Color.clear); scanlineTexture.Apply(); } } private static void DrawTiledScanlines(float opacity, float scrollSpeed = 0f) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) CreateScanlineTexture(); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, opacity); float num = (float)Screen.height / 8f; float num2 = 0f; if (scrollSpeed != 0f) { num2 = Time.unscaledTime * scrollSpeed % 1f; } GUI.DrawTextureWithTexCoords(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)scanlineTexture, new Rect(0f, num2, (float)Screen.width, num)); GUI.color = color; } public static void RecordSplit(string segmentName, float currentTime) { float num = currentTime - lastSplitTime; if (!(num <= 0.05f)) { currentRunSplits.Add(new SpeedrunSplit { SegmentName = segmentName, SegmentDuration = num, CumulativeTime = currentTime }); lastSplitTime = currentTime; if (!goldSplits.ContainsKey(segmentName) || num < goldSplits[segmentName]) { goldSplits[segmentName] = num; } } } public static void RecordRunRecord(string weaponName, string status, float finalTime) { List list = new List(); foreach (SpeedrunSplit currentRunSplit in currentRunSplits) { list.Add($"{currentRunSplit.SegmentName}:{currentRunSplit.SegmentDuration:F2}:{currentRunSplit.CumulativeTime:F2}"); } string serializedSplits = string.Join(",", list); pastRuns.Insert(0, new SpeedrunRunRecord { DateString = DateTime.Now.ToString("dd.MM HH:mm"), WeaponName = weaponName, Status = status, FinalTime = finalTime, SerializedSplits = serializedSplits }); if (pastRuns.Count > 10) { pastRuns.RemoveAt(pastRuns.Count - 1); } if (status.StartsWith("Victory") && (!weaponPBs.ContainsKey(weaponName) || finalTime < weaponPBs[weaponName])) { weaponPBs[weaponName] = finalTime; } SaveHistoryToConfig(); } public static void SaveHistoryToConfig() { try { StringBuilder stringBuilder = new StringBuilder(); foreach (SpeedrunRunRecord pastRun in pastRuns) { string text = pastRun.SerializedSplits ?? ""; stringBuilder.Append(pastRun.DateString + "|" + pastRun.WeaponName + "|" + pastRun.Status + "|" + pastRun.FinalTime.ToString("F2") + "|" + text + ";"); } ConfigManager.SpeedrunHistoryData.Value = stringBuilder.ToString(); ((ConfigEntryBase)ConfigManager.SpeedrunHistoryData).ConfigFile.Save(); StringBuilder stringBuilder2 = new StringBuilder(); foreach (KeyValuePair weaponPB in weaponPBs) { stringBuilder2.Append(weaponPB.Key + "|" + weaponPB.Value.ToString("F2") + ";"); } ConfigManager.SpeedrunPBsData.Value = stringBuilder2.ToString(); ((ConfigEntryBase)ConfigManager.SpeedrunPBsData).ConfigFile.Save(); StringBuilder stringBuilder3 = new StringBuilder(); foreach (KeyValuePair goldSplit in goldSplits) { stringBuilder3.Append(goldSplit.Key + "|" + goldSplit.Value.ToString("F2") + ";"); } ConfigManager.SpeedrunGoldsData.Value = stringBuilder3.ToString(); ((ConfigEntryBase)ConfigManager.SpeedrunGoldsData).ConfigFile.Save(); } catch { } } public static void LoadHistoryFromConfig() { try { pastRuns.Clear(); string value = ConfigManager.SpeedrunHistoryData.Value; string[] array; if (!string.IsNullOrEmpty(value)) { array = value.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('|'); if (array2.Length >= 4) { string serializedSplits = ((array2.Length >= 5) ? array2[4] : ""); pastRuns.Add(new SpeedrunRunRecord { DateString = array2[0], WeaponName = array2[1], Status = array2[2], FinalTime = float.Parse(array2[3]), SerializedSplits = serializedSplits }); } } } weaponPBs.Clear(); string value2 = ConfigManager.SpeedrunPBsData.Value; if (!string.IsNullOrEmpty(value2)) { array = value2.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string[] array3 = array[i].Split('|'); if (array3.Length >= 2) { weaponPBs[array3[0]] = float.Parse(array3[1]); } } } goldSplits.Clear(); string value3 = ConfigManager.SpeedrunGoldsData.Value; if (string.IsNullOrEmpty(value3)) { return; } array = value3.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string[] array4 = array[i].Split('|'); if (array4.Length >= 2) { goldSplits[array4[0]] = float.Parse(array4[1]); } } } catch { } } } public class SpeedrunSplit { public string SegmentName { get; set; } public float SegmentDuration { get; set; } public float CumulativeTime { get; set; } } public class SpeedrunRunRecord { public string DateString { get; set; } public string WeaponName { get; set; } public string Status { get; set; } public float FinalTime { get; set; } public string SerializedSplits { get; set; } } public class HudElementToDraw { public string Text { get; set; } public int Size { get; set; } public Color Color { get; set; } public string Position { get; set; } public float Width { get; set; } public float Height { get; set; } } }