From 5e9abd33b4364e0852599212043252f759e6ff4c Mon Sep 17 00:00:00 2001 From: originalnicodr Date: Thu, 18 Jul 2024 09:41:49 -0300 Subject: [PATCH] Added setting to toggle menu UI autoscaling off, and allow the timescale input field to accept values above the slider maximum. --- src/Config/ConfigManager.cs | 5 +++++ src/ExplorerCore.cs | 2 +- src/UI/Widgets/TimeScaleWidget.cs | 12 ++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Config/ConfigManager.cs b/src/Config/ConfigManager.cs index 2a08f9f..277070e 100644 --- a/src/Config/ConfigManager.cs +++ b/src/Config/ConfigManager.cs @@ -29,6 +29,7 @@ namespace UnityExplorer.Config public static ConfigElement CSConsole_Assembly_Blacklist; public static ConfigElement Reflection_Signature_Blacklist; public static ConfigElement Reflection_Hide_NativeInfoPtrs; + public static ConfigElement Auto_Scale_UI; public static ConfigElement Default_Gameplay_Freecam; public static ConfigElement Pause; @@ -180,6 +181,10 @@ namespace UnityExplorer.Config "For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.", false); + Auto_Scale_UI = new("Make the mod UI automatically scale with resolution", + "Especially useful when running games in high resolutions and you are having a hard time reading the mods menu (requires restart).", + true); + Default_Gameplay_Freecam = new("Default Gameplay Freecam", "Turn this on if you want the default gameplay freecam toggle on the Freecam panel to be on on startup.", false); diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 96e2b46..140f086 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -80,7 +80,7 @@ namespace UnityExplorer KeypressListener.Setup(); - MakeUEUIScale(); + if (ConfigManager.Auto_Scale_UI.Value) MakeUEUIScale(); } internal static void Update() diff --git a/src/UI/Widgets/TimeScaleWidget.cs b/src/UI/Widgets/TimeScaleWidget.cs index 725bbe4..b95aff7 100644 --- a/src/UI/Widgets/TimeScaleWidget.cs +++ b/src/UI/Widgets/TimeScaleWidget.cs @@ -74,13 +74,21 @@ namespace UnityExplorer.UI.Widgets { if (float.TryParse(val, out float f)) { - if (f < slider.minValue || f > slider.maxValue){ + if (f < slider.minValue){ ExplorerCore.LogWarning("Error, new time scale value outside of margins."); timeInput.Text = desiredTime.ToString("0.00"); return; } - slider.value = f; // Will update the desiredTime value and extra things + // Allow registering timescale values above the slider max value + if (f > slider.maxValue) { + desiredTime = f; + pause = false; + previousDesiredTime = desiredTime; + } + else { + slider.value = f; // Will update the desiredTime value and extra things + } } }