mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 14:19:52 -06:00
UI: fix: when switching players, it would show old config (#122)
When switching between players' gamepads while saving settings, then returning to the previous player, the settings show the default settings instead of the actual settings applied
This commit is contained in:
@ -25,17 +25,27 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||
|
||||
private async void PlayerIndexBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (PlayerIndexBox != null)
|
||||
{
|
||||
if (PlayerIndexBox.SelectedIndex != (int)ViewModel.PlayerId)
|
||||
{
|
||||
PlayerIndexBox.SelectedIndex = (int)ViewModel.PlayerId;
|
||||
}
|
||||
}
|
||||
|
||||
if (ViewModel.IsModified && !_dialogOpen)
|
||||
{
|
||||
_dialogOpen = true;
|
||||
|
||||
var result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
var result = await ContentDialogHelper.CreateConfirmationDialogExtended(
|
||||
LocaleManager.Instance[LocaleKeys.DialogControllerSettingsModifiedConfirmMessage],
|
||||
LocaleManager.Instance[LocaleKeys.DialogControllerSettingsModifiedConfirmSubMessage],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||
LocaleManager.Instance[LocaleKeys.Cancel],
|
||||
LocaleManager.Instance[LocaleKeys.RyujinxConfirm]);
|
||||
|
||||
|
||||
if (result == UserResult.Yes)
|
||||
{
|
||||
ViewModel.Save();
|
||||
@ -43,14 +53,30 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||
|
||||
_dialogOpen = false;
|
||||
|
||||
if (result == UserResult.Cancel)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ViewModel.IsModified = false;
|
||||
|
||||
if (e.AddedItems.Count > 0)
|
||||
if (result != UserResult.Cancel)
|
||||
{
|
||||
var player = (PlayerModel)e.AddedItems[0];
|
||||
ViewModel.PlayerId = player.Id;
|
||||
ViewModel.PlayerId = ViewModel.PlayerIdChoose;
|
||||
}
|
||||
|
||||
if (result == UserResult.Cancel)
|
||||
{
|
||||
if (e.AddedItems.Count > 0)
|
||||
{
|
||||
ViewModel.IsModified = true;
|
||||
var player = (PlayerModel)e.AddedItems[0];
|
||||
ViewModel.PlayerId = player.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
Reference in New Issue
Block a user