Replace the "delete" button with "apply" during the game in the custom configuration.

This commit is contained in:
Vova 2025-02-10 21:02:26 +10:00
parent 1d68546aa0
commit 0399af0ff9
3 changed files with 19 additions and 40 deletions

View File

@ -74,42 +74,12 @@ namespace Ryujinx.Ava.UI.ViewModels
private Bitmap _gameIcon;
private string _gameTitle;
private string _gameId;
public Bitmap GameIcon
{
get => _gameIcon;
set
{
if (_gameIcon != value)
{
_gameIcon = value;
}
}
}
public string GameTitle
{
get => _gameTitle;
set
{
if (_gameTitle != value)
{
_gameTitle = value;
}
}
}
public string GameId
{
get => _gameId;
set
{
if (_gameId != value)
{
_gameId = value;
}
}
}
private readonly bool _isGameRunning;
public bool IsGameRunning => _isGameRunning;
public Bitmap GameIcon => _gameIcon;
public string GameTitle => _gameTitle;
public string GameId => _gameId;
public int ResolutionScale
{
@ -385,8 +355,10 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
public SettingsViewModel(VirtualFileSystem virtualFileSystem,
public SettingsViewModel(
VirtualFileSystem virtualFileSystem,
ContentManager contentManager,
bool gameRunning,
string gamePath,
string gameName,
string gameId,
@ -400,12 +372,13 @@ namespace Ryujinx.Ava.UI.ViewModels
{
using (var ms = new MemoryStream(gameIconData))
{
GameIcon = new Bitmap(ms);
_gameIcon = new Bitmap(ms);
}
}
GameTitle = gameName;
GameId = gameId;
_isGameRunning = gameRunning;
_gameTitle = gameName;
_gameId = gameId;
if (enableToLoadCustomConfig) // During the game. If there is no user config, then load the global config window
{

View File

@ -136,6 +136,11 @@
Content="{ext:Locale SettingsButtonClose}"
Command="{Binding CancelButton}" />
<Button
IsVisible="{Binding IsGameRunning}"
Content="{ext:Locale SettingsButtonApply}"
Command="{Binding ApplyButton}" />
<Button
IsVisible="{Binding !IsGameRunning}"
Content="{ext:Locale UserProfilesDelete}"
Command="{Binding DeleteConfigGame}"
Classes="red"/>

View File

@ -35,6 +35,7 @@ namespace Ryujinx.Ava.UI.Windows
DataContext = ViewModel = new SettingsViewModel(
viewModel.VirtualFileSystem,
viewModel.ContentManager,
viewModel.IsGameRunning,
viewModel.SelectedApplication.Path,
viewModel.SelectedApplication.Name,
viewModel.SelectedApplication.IdString,
@ -46,7 +47,7 @@ namespace Ryujinx.Ava.UI.Windows
InitializeComponent();
Load();
#if DEBUG
this.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Alt));
#endif