diff --git a/src/Ryujinx/Assets/Locales/en_US.json b/src/Ryujinx/Assets/Locales/en_US.json index 8df0f96a1..30936a2a1 100644 --- a/src/Ryujinx/Assets/Locales/en_US.json +++ b/src/Ryujinx/Assets/Locales/en_US.json @@ -91,6 +91,7 @@ "LinuxVmMaxMapCountWarningTextPrimary": "Max amount of memory mappings is lower than recommended.", "LinuxVmMaxMapCountWarningTextSecondary": "The current value of vm.max_map_count ({0}) is lower than {1}. Some games might try to create more memory mappings than currently allowed. Ryujinx will crash as soon as this limit gets exceeded.\n\nYou might want to either manually increase the limit or install pkexec, which allows Ryujinx to assist with that.", "Settings": "Settings", + "SettingsDirty": "Unsaved Changes", "SettingsTabGeneral": "User Interface", "SettingsTabGeneralGeneral": "General", "SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence", diff --git a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs index 70e5fa5c7..3fda90a64 100644 --- a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs @@ -49,11 +49,24 @@ namespace Ryujinx.Ava.UI.ViewModels private int _graphicsBackendIndex; private int _scalingFilter; private int _scalingFilterLevel; + private int _networkInterfaceIndex; + private int _multiplayerModeIndex; + + private bool _isModified; + + public bool IsModified + { + get => _isModified; + set + { + DirtyEvent?.Invoke(value); + _isModified = value; + } + } public event Action CloseWindow; public event Action SaveSettingsEvent; - private int _networkInterfaceIndex; - private int _multiplayerModeIndex; + public event Action DirtyEvent; public int ResolutionScale { diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs index 314501c52..8d21636a8 100644 --- a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs @@ -10,17 +10,18 @@ namespace Ryujinx.Ava.UI.Windows { public partial class SettingsWindow : StyleableWindow { - internal SettingsViewModel ViewModel { get; set; } + private SettingsViewModel ViewModel { get; } public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager) { - Title = $"Ryujinx {Program.Version} - {LocaleManager.Instance[LocaleKeys.Settings]}"; + Title = $"{LocaleManager.Instance[LocaleKeys.Settings]}"; ViewModel = new SettingsViewModel(virtualFileSystem, contentManager); DataContext = ViewModel; ViewModel.CloseWindow += Close; ViewModel.SaveSettingsEvent += SaveSettings; + ViewModel.DirtyEvent += UpdateDirtyTitle; InitializeComponent(); Load(); @@ -35,6 +36,19 @@ namespace Ryujinx.Ava.UI.Windows Load(); } + public void UpdateDirtyTitle(bool isDirty) + { + if (isDirty) + { + Title = $"{LocaleManager.Instance[LocaleKeys.Settings]} - {LocaleManager.Instance[LocaleKeys.SettingsDirty]}"; + } + else + { + Title = $"{LocaleManager.Instance[LocaleKeys.Settings]}"; + + } + } + public void SaveSettings() { InputPage.InputView?.SaveCurrentProfile();