diff --git a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs index 1b1f8a2a5..812438932 100644 --- a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs @@ -49,8 +49,7 @@ namespace Ryujinx.Ava.UI.ViewModels private int _graphicsBackendMultithreadingIndex; private float _volume; [ObservableProperty] private bool _isVulkanAvailable = true; - [ObservableProperty] private bool _gameDirectoryChanged; - [ObservableProperty] private bool _autoloadDirectoryChanged; + [ObservableProperty] private bool _gameListNeedsRefresh; private readonly List _gpuIds = []; private int _graphicsBackendIndex; private int _scalingFilter; @@ -593,16 +592,8 @@ namespace Ryujinx.Ava.UI.ViewModels config.HideCursor.Value = (HideCursorMode)HideCursor; config.UpdateCheckerType.Value = (UpdaterType)UpdateCheckerType; config.FocusLostActionType.Value = (FocusLostType)FocusLostActionType; - - if (GameDirectoryChanged) - { - config.UI.GameDirs.Value = [..GameDirectories]; - } - - if (AutoloadDirectoryChanged) - { - config.UI.AutoloadDirs.Value = [..AutoloadDirectories]; - } + config.UI.GameDirs.Value = [..GameDirectories]; + config.UI.AutoloadDirs.Value = [..AutoloadDirectories]; config.UI.BaseStyle.Value = BaseStyleIndex switch { @@ -623,8 +614,11 @@ namespace Ryujinx.Ava.UI.ViewModels // System config.System.Region.Value = (Region)Region; + + if (config.System.Language.Value != (Language)Language) + GameListNeedsRefresh = true; + config.System.Language.Value = (Language)Language; - if (_validTzRegions.Contains(TimeZone)) { config.System.TimeZone.Value = TimeZone; @@ -715,8 +709,7 @@ namespace Ryujinx.Ava.UI.ViewModels SaveSettingsEvent?.Invoke(); - GameDirectoryChanged = false; - AutoloadDirectoryChanged = false; + GameListNeedsRefresh = false; } private static void RevertIfNotSaved() diff --git a/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs index 22a4adf51..2b0e57cb5 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs +++ b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs @@ -36,11 +36,8 @@ namespace Ryujinx.Ava.UI.Views.Settings directories.Add(path); addDirBox.Clear(); - - if (isGameList) - ViewModel.GameDirectoryChanged = true; - else - ViewModel.AutoloadDirectoryChanged = true; + + ViewModel.GameListNeedsRefresh = true; } else { @@ -50,10 +47,7 @@ namespace Ryujinx.Ava.UI.Views.Settings { directories.Add(folder.Value.Path.LocalPath); - if (isGameList) - ViewModel.GameDirectoryChanged = true; - else - ViewModel.AutoloadDirectoryChanged = true; + ViewModel.GameListNeedsRefresh = true; } } } @@ -65,7 +59,7 @@ namespace Ryujinx.Ava.UI.Views.Settings foreach (string path in new List(GameDirsList.SelectedItems.Cast())) { ViewModel.GameDirectories.Remove(path); - ViewModel.GameDirectoryChanged = true; + ViewModel.GameListNeedsRefresh = true; } if (GameDirsList.ItemCount > 0) @@ -81,7 +75,7 @@ namespace Ryujinx.Ava.UI.Views.Settings foreach (string path in new List(AutoloadDirsList.SelectedItems.Cast())) { ViewModel.AutoloadDirectories.Remove(path); - ViewModel.AutoloadDirectoryChanged = true; + ViewModel.GameListNeedsRefresh = true; } if (AutoloadDirsList.ItemCount > 0) diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs index 36f451fe4..701c3ddaf 100644 --- a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs @@ -45,7 +45,7 @@ namespace Ryujinx.Ava.UI.Windows { InputPage.InputView?.SaveCurrentProfile(); - if (Owner is MainWindow window && (ViewModel.GameDirectoryChanged || ViewModel.AutoloadDirectoryChanged)) + if (Owner is MainWindow window && ViewModel.GameListNeedsRefresh) { window.LoadApplications(); }