Change how default flag values are handled

they're now all handled before they're saved/loaded
This commit is contained in:
pizzaboxer 2023-04-13 21:04:54 +02:00
parent d7dc198a8b
commit c5d46f5d46
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
5 changed files with 8 additions and 19 deletions

View File

@ -173,9 +173,6 @@ namespace Bloxstrap
BaseDirectory = Path.Combine(Directories.LocalAppData, ProjectName);
InitLog();
// we have reshade enabled by default so we need this
FastFlags.SetRenderingMode("Direct3D 11");
if (!IsQuiet)
{
IsSetupComplete = false;

View File

@ -72,6 +72,10 @@ namespace Bloxstrap.Helpers
// set to 9999 by default if it doesnt already exist
if (GetValue("DFIntTaskSchedulerTargetFps") is null)
SetValue("DFIntTaskSchedulerTargetFps", 9999);
// reshade / exclusive fullscreen requires direct3d 11 to work
if (GetValue(RenderingModes["Direct3D 11"]) != "True" && (App.Settings.Prop.UseReShade || App.FastFlags.GetValue("FFlagHandleAltEnterFullscreenManually") == "False"))
SetRenderingMode("Direct3D 11");
}
public override void Save()

View File

@ -78,14 +78,6 @@ namespace Bloxstrap.Helpers
Bootstrapper.Register();
// update check: if we're upgrading to v2.1.0 and have reshade enabled,
// we need to set our renderer to direct3d 11
if (App.Settings.Prop.UseReShade && App.FastFlags.GetValue(FastFlagManager.RenderingModes["Direct3D 11"]) is null)
{
App.FastFlags.SetRenderingMode("Direct3D 11");
App.FastFlags.Save();
}
if (isAutoUpgrade)
{
NotifyIcon notification = new()

View File

@ -15,10 +15,7 @@ namespace Bloxstrap.ViewModels
public ICommand OpenModsFolderCommand => new RelayCommand(OpenModsFolder);
private void OpenModsFolder()
{
Process.Start("explorer.exe", Directories.Modifications);
}
private void OpenModsFolder() => Process.Start("explorer.exe", Directories.Modifications);
public bool OldDeathSoundEnabled
{
@ -43,7 +40,7 @@ namespace Bloxstrap.ViewModels
public int FramerateLimit
{
get => Int32.TryParse(App.FastFlags.GetValue("DFIntTaskSchedulerTargetFps"), out int x) ? x : 60;
set => App.FastFlags.Changes["DFIntTaskSchedulerTargetFps"] = value;
set => App.FastFlags.SetValue("DFIntTaskSchedulerTargetFps", value);
}
public string SelectedRenderingMode
@ -68,7 +65,7 @@ namespace Bloxstrap.ViewModels
get => App.FastFlags.GetValue("FFlagHandleAltEnterFullscreenManually") == "False";
set
{
App.FastFlags.SetValue("FFlagHandleAltEnterFullscreenManually", value ? false : null);
App.FastFlags.SetValue("FFlagHandleAltEnterFullscreenManually", value ? "False" : null);
if (value)
{

View File

@ -13,7 +13,6 @@ namespace Bloxstrap.Views.Pages
{
public ModsPage()
{
if (!App.IsFirstRun)
App.FastFlags.Load();
DataContext = new ModsViewModel();