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); BaseDirectory = Path.Combine(Directories.LocalAppData, ProjectName);
InitLog(); InitLog();
// we have reshade enabled by default so we need this
FastFlags.SetRenderingMode("Direct3D 11");
if (!IsQuiet) if (!IsQuiet)
{ {
IsSetupComplete = false; IsSetupComplete = false;

View File

@ -72,6 +72,10 @@ namespace Bloxstrap.Helpers
// set to 9999 by default if it doesnt already exist // set to 9999 by default if it doesnt already exist
if (GetValue("DFIntTaskSchedulerTargetFps") is null) if (GetValue("DFIntTaskSchedulerTargetFps") is null)
SetValue("DFIntTaskSchedulerTargetFps", 9999); 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() public override void Save()

View File

@ -78,14 +78,6 @@ namespace Bloxstrap.Helpers
Bootstrapper.Register(); 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) if (isAutoUpgrade)
{ {
NotifyIcon notification = new() NotifyIcon notification = new()

View File

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

View File

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