Fixed a ban where a custom setting was mistakenly created when starting the game if it did not exist.

Now when starting the game, if a custom setting was created, the current game will be displayed in the settings window.
Code cleanup.
This commit is contained in:
Vova
2025-02-08 18:29:31 +10:00
parent a92475b8fd
commit 5f5c76107c
9 changed files with 55 additions and 60 deletions

View File

@@ -37,21 +37,6 @@ namespace Ryujinx.Ava.UI.Controls
AvaloniaXamlLoader.Load(this);
}
public void ToggleUserControl_Click(object sender, RoutedEventArgs args)
{
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
return;
viewModel.SelectedApplication.Favorite = !viewModel.SelectedApplication.Favorite;
ApplicationLibrary.LoadAndSaveMetaData(viewModel.SelectedApplication.IdString, appMetadata =>
{
appMetadata.Favorite = viewModel.SelectedApplication.Favorite;
});
viewModel.RefreshView();
}
public void ToggleFavorite_Click(object sender, RoutedEventArgs args)
{
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })

View File

@@ -43,19 +43,6 @@ namespace Ryujinx.Ava.UI.Controls
await CompatibilityList.Show((string)playabilityLabel.Tag);
}
public async void EditGameConfiguration_Click(object sender, RoutedEventArgs args)
{
if (sender is MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
{
await new UserConfigWindows(viewModel).ShowDialog((Window)viewModel.TopLevel);
//viewModel.SelectedApplication.UserConfig = File.Exists(Program.GetDirGameUserConfig(viewModel.SelectedApplication.IdString));
viewModel.RefreshView();
}
}
private async void IdString_OnClick(object sender, RoutedEventArgs e)
{
if (DataContext is not MainWindowViewModel mwvm)