mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-10 04:39:11 +00:00
Hide back button when folders are disabled, reload game list when the folder setting is changed
This commit is contained in:
parent
1ef15e5107
commit
7761382740
4 changed files with 32 additions and 3 deletions
|
@ -86,6 +86,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
private string _lastScannedAmiiboId;
|
private string _lastScannedAmiiboId;
|
||||||
private bool _statusBarVisible;
|
private bool _statusBarVisible;
|
||||||
private bool _isInFolder;
|
private bool _isInFolder;
|
||||||
|
private bool _foldersEnabled;
|
||||||
private ReadOnlyObservableCollection<ApplicationData> _appsObservableList;
|
private ReadOnlyObservableCollection<ApplicationData> _appsObservableList;
|
||||||
|
|
||||||
private string _showUiKey = "F4";
|
private string _showUiKey = "F4";
|
||||||
|
@ -123,6 +124,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
_rendererWaitEvent = new AutoResetEvent(false);
|
_rendererWaitEvent = new AutoResetEvent(false);
|
||||||
_pathHistory = new Stack<string>();
|
_pathHistory = new Stack<string>();
|
||||||
|
FoldersEnabled = ConfigurationState.Instance.UI.UseSystemGameFolders;
|
||||||
|
|
||||||
if (Program.PreviewerDetached)
|
if (Program.PreviewerDetached)
|
||||||
{
|
{
|
||||||
|
@ -683,6 +685,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool FoldersEnabled
|
||||||
|
{
|
||||||
|
get => _foldersEnabled;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_foldersEnabled = value;
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal void Sort(bool isAscending)
|
internal void Sort(bool isAscending)
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,6 +116,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public bool IsHypervisorAvailable => OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
public bool IsHypervisorAvailable => OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
||||||
|
|
||||||
|
public bool FolderModeChanged;
|
||||||
public bool DirectoryChanged
|
public bool DirectoryChanged
|
||||||
{
|
{
|
||||||
get => _directoryChanged;
|
get => _directoryChanged;
|
||||||
|
@ -491,7 +492,6 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
||||||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||||
config.UI.UseSystemGameFolders.Value = UseSystemGameFolders;
|
|
||||||
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||||
|
|
||||||
if (_directoryChanged)
|
if (_directoryChanged)
|
||||||
|
@ -500,6 +500,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
config.UI.GameDirs.Value = gameDirs;
|
config.UI.GameDirs.Value = gameDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (UseSystemGameFolders != config.UI.UseSystemGameFolders.Value)
|
||||||
|
{
|
||||||
|
FolderModeChanged = true;
|
||||||
|
}
|
||||||
|
config.UI.UseSystemGameFolders.Value = UseSystemGameFolders;
|
||||||
|
|
||||||
config.UI.BaseStyle.Value = BaseStyleIndex == 0 ? "Light" : "Dark";
|
config.UI.BaseStyle.Value = BaseStyleIndex == 0 ? "Light" : "Dark";
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
|
@ -590,6 +596,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
SaveSettingsEvent?.Invoke();
|
SaveSettingsEvent?.Invoke();
|
||||||
|
|
||||||
_directoryChanged = false;
|
_directoryChanged = false;
|
||||||
|
FolderModeChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RevertIfNotSaved()
|
private static void RevertIfNotSaved()
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
Margin="5,2,0,2"
|
Margin="5,2,0,2"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Command="{Binding NavigateBack}"
|
Command="{Binding NavigateBack}"
|
||||||
|
IsVisible="{Binding FoldersEnabled}"
|
||||||
IsEnabled="{Binding IsInFolder}">
|
IsEnabled="{Binding IsInFolder}">
|
||||||
<ui:FontIcon
|
<ui:FontIcon
|
||||||
Margin="0"
|
Margin="0"
|
||||||
|
|
|
@ -39,10 +39,19 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
{
|
{
|
||||||
InputPage.ControllerSettings?.SaveCurrentProfile();
|
InputPage.ControllerSettings?.SaveCurrentProfile();
|
||||||
|
|
||||||
if (Owner is MainWindow window && ViewModel.DirectoryChanged)
|
if (Owner is MainWindow window)
|
||||||
|
{
|
||||||
|
if (ViewModel.DirectoryChanged)
|
||||||
{
|
{
|
||||||
window.LoadApplications();
|
window.LoadApplications();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ViewModel.FolderModeChanged)
|
||||||
|
{
|
||||||
|
window.LoadApplications();
|
||||||
|
window.ViewModel.FoldersEnabled = ViewModel.UseSystemGameFolders;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Load()
|
private void Load()
|
||||||
|
|
Loading…
Reference in a new issue