1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2025-07-18 17:38:01 +08:00

Added setting to toggle menu UI autoscaling off, and allow the timescale input field to accept values above the slider maximum.

This commit is contained in:
originalnicodr
2024-07-18 09:41:49 -03:00
parent 6ebf19dfa0
commit 5e9abd33b4
3 changed files with 16 additions and 3 deletions

View File

@ -29,6 +29,7 @@ namespace UnityExplorer.Config
public static ConfigElement<string> CSConsole_Assembly_Blacklist;
public static ConfigElement<string> Reflection_Signature_Blacklist;
public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs;
public static ConfigElement<bool> Auto_Scale_UI;
public static ConfigElement<bool> Default_Gameplay_Freecam;
public static ConfigElement<KeyCode> 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);

View File

@ -80,7 +80,7 @@ namespace UnityExplorer
KeypressListener.Setup();
MakeUEUIScale();
if (ConfigManager.Auto_Scale_UI.Value) MakeUEUIScale();
}
internal static void Update()

View File

@ -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
}
}
}