From 54421760c33f77de78fee58d637552d2e00d464b Mon Sep 17 00:00:00 2001 From: MutantAura <44103205+MutantAura@users.noreply.github.com> Date: Sun, 21 Aug 2022 14:07:28 +0100 Subject: Check if game directories have been updated before refreshing GUI (#3607) * Check if game directories have been updated before refreshing list on save. * Cleanup spacing * Add Avalonia and reset value after saving * Fix Avalonia * Fix multiple directories not being added in GTK --- Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Ava/Ui/ViewModels') diff --git a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs index a7cf710e..32f08ff9 100644 --- a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs @@ -49,6 +49,7 @@ namespace Ryujinx.Ava.Ui.ViewModels private float _previousVolumeLevel; private float _volume; private bool _isVulkanAvailable = true; + private bool _directoryChanged = false; private List _gpuIds = new List(); private KeyboardHotkeys _keyboardHotkeys; private int _graphicsBackendIndex; @@ -112,6 +113,17 @@ namespace Ryujinx.Ava.Ui.ViewModels } } + public bool DirectoryChanged + { + get => _directoryChanged; + set + { + _directoryChanged = value; + + OnPropertyChanged(); + } + } + public bool EnableDiscordIntegration { get; set; } public bool CheckUpdatesOnStart { get; set; } public bool ShowConfirmExit { get; set; } @@ -397,10 +409,14 @@ namespace Ryujinx.Ava.Ui.ViewModels public async Task SaveSettings() { - List gameDirs = new List(GameDirectories); - ConfigurationState config = ConfigurationState.Instance; + if (_directoryChanged) + { + List gameDirs = new List(GameDirectories); + config.Ui.GameDirs.Value = gameDirs; + } + if (_validTzRegions.Contains(TimeZone)) { config.System.TimeZone.Value = TimeZone; @@ -465,7 +481,6 @@ namespace Ryujinx.Ava.Ui.ViewModels config.System.SystemTimeOffset.Value = systemTimeOffset.Seconds; config.Graphics.ShadersDumpPath.Value = ShaderDumpPath; - config.Ui.GameDirs.Value = gameDirs; config.System.FsGlobalAccessLogMode.Value = FsGlobalAccessLogMode; config.System.MemoryManagerMode.Value = (MemoryManagerMode)MemoryMode; -- cgit v1.2.3