Don't require TaskScheduler FPS flag (#1938)

This commit is contained in:
pizzaboxer 2024-06-14 22:45:00 +01:00
parent 989ba00995
commit 5fdfc901c4
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
3 changed files with 11 additions and 21 deletions

View File

@ -245,23 +245,6 @@ namespace Bloxstrap
string? val = GetPreset("UI.Menu.Style.EnableV4.1");
if (GetPreset("UI.Menu.Style.EnableV4.2") != val)
SetPreset("UI.Menu.Style.EnableV4.2", val);
if (GetPreset("Rendering.Framerate") is not null)
return;
// set it to be the framerate of the primary display by default
var screen = Screen.AllScreens.Where(x => x.Primary).Single();
var devmode = new DEVMODEW();
PInvoke.EnumDisplaySettings(screen.DeviceName, ENUM_DISPLAY_SETTINGS_MODE.ENUM_CURRENT_SETTINGS, ref devmode);
uint framerate = devmode.dmDisplayFrequency;
if (framerate <= 100)
framerate *= 2;
SetPreset("Rendering.Framerate", framerate);
}
}
}

View File

@ -210,7 +210,7 @@ namespace Bloxstrap
// update migrations
if (App.BuildMetadata.CommitRef.StartsWith("tag"))
if (App.BuildMetadata.CommitRef.StartsWith("tag") && currentVersionInfo.ProductVersion is not null)
{
if (existingVersionInfo.ProductVersion == "2.4.0")
{
@ -227,7 +227,7 @@ namespace Bloxstrap
App.FastFlags.Save();
}
else if (currentVersionInfo.ProductVersion == "2.6.0")
else if (currentVersionInfo.ProductVersion.StartsWith("2.6.0"))
{
if (App.Settings.Prop.UseDisableAppPatch)
{
@ -246,6 +246,13 @@ namespace Bloxstrap
if (App.Settings.Prop.BootstrapperStyle == BootstrapperStyle.ClassicFluentDialog)
App.Settings.Prop.BootstrapperStyle = BootstrapperStyle.FluentDialog;
_ = int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x);
if (x == 0)
{
App.FastFlags.SetPreset("Rendering.Framerate", null);
App.FastFlags.Save();
}
App.Settings.Save();
}
}

View File

@ -64,8 +64,8 @@ namespace Bloxstrap.UI.ViewModels.Menu
public int FramerateLimit
{
get => int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x) ? x : 60;
set => App.FastFlags.SetPreset("Rendering.Framerate", value);
get => int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x) ? x : 0;
set => App.FastFlags.SetPreset("Rendering.Framerate", value == 0 ? null : value);
}
public IReadOnlyDictionary<RenderingMode, string> RenderingModes => FastFlagManager.RenderingModes;