mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-26 18:43:04 +00:00
Change SettingsWindow title on dirty
This commit is contained in:
parent
f195198608
commit
c141b248a8
3 changed files with 32 additions and 4 deletions
|
@ -91,6 +91,7 @@
|
||||||
"LinuxVmMaxMapCountWarningTextPrimary": "Max amount of memory mappings is lower than recommended.",
|
"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.",
|
"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",
|
"Settings": "Settings",
|
||||||
|
"SettingsDirty": "Unsaved Changes",
|
||||||
"SettingsTabGeneral": "User Interface",
|
"SettingsTabGeneral": "User Interface",
|
||||||
"SettingsTabGeneralGeneral": "General",
|
"SettingsTabGeneralGeneral": "General",
|
||||||
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
|
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
|
||||||
|
|
|
@ -49,11 +49,24 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
private int _graphicsBackendIndex;
|
private int _graphicsBackendIndex;
|
||||||
private int _scalingFilter;
|
private int _scalingFilter;
|
||||||
private int _scalingFilterLevel;
|
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 CloseWindow;
|
||||||
public event Action SaveSettingsEvent;
|
public event Action SaveSettingsEvent;
|
||||||
private int _networkInterfaceIndex;
|
public event Action<bool> DirtyEvent;
|
||||||
private int _multiplayerModeIndex;
|
|
||||||
|
|
||||||
public int ResolutionScale
|
public int ResolutionScale
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,17 +10,18 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
public partial class SettingsWindow : StyleableWindow
|
public partial class SettingsWindow : StyleableWindow
|
||||||
{
|
{
|
||||||
internal SettingsViewModel ViewModel { get; set; }
|
private SettingsViewModel ViewModel { get; }
|
||||||
|
|
||||||
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
public SettingsWindow(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
||||||
{
|
{
|
||||||
Title = $"Ryujinx {Program.Version} - {LocaleManager.Instance[LocaleKeys.Settings]}";
|
Title = $"{LocaleManager.Instance[LocaleKeys.Settings]}";
|
||||||
|
|
||||||
ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
ViewModel = new SettingsViewModel(virtualFileSystem, contentManager);
|
||||||
DataContext = ViewModel;
|
DataContext = ViewModel;
|
||||||
|
|
||||||
ViewModel.CloseWindow += Close;
|
ViewModel.CloseWindow += Close;
|
||||||
ViewModel.SaveSettingsEvent += SaveSettings;
|
ViewModel.SaveSettingsEvent += SaveSettings;
|
||||||
|
ViewModel.DirtyEvent += UpdateDirtyTitle;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Load();
|
Load();
|
||||||
|
@ -35,6 +36,19 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
Load();
|
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()
|
public void SaveSettings()
|
||||||
{
|
{
|
||||||
InputPage.InputView?.SaveCurrentProfile();
|
InputPage.InputView?.SaveCurrentProfile();
|
||||||
|
|
Loading…
Reference in a new issue