Compare commits

..

1 commit

Author SHA1 Message Date
Goodfeat
88d769fd48 Merge branch 'Master_PR' into 'master'
Improvements and fixes to issues in the controller input menu

See merge request ryubing/ryujinx!2
2025-04-18 19:37:44 -05:00

View file

@ -357,7 +357,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
// This function allows you to output a message about the device configuration found in the file // This function allows you to output a message about the device configuration found in the file
// NOTE: if the configuration is found, we display the message "Waiting for controller connection", // NOTE: if the configuration is found, we display the message "Waiting for controller connection",
// but only if the id gamepad belongs to the selected player // but only if the id gamepad belongs to the selected player
NotificationIsVisible = Config != null && Devices.FirstOrDefault(d => d.Id == Config.Id).Id != Config.Id && Config.PlayerIndex == PlayerId; NotificationIsVisible = Config != null && Devices.FirstOrDefault(d => d.Id == Config.Id).Id != Config.Id && Config.PlayerIndex == PlayerId;
if (NotificationIsVisible) if (NotificationIsVisible)
{ {
@ -370,7 +369,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
NotificationText = $"{LocaleManager.Instance[LocaleKeys.ControllerSettingsWaitingConnectDevice].Format(Config.Name, Config.Id)}"; NotificationText = $"{LocaleManager.Instance[LocaleKeys.ControllerSettingsWaitingConnectDevice].Format(Config.Name, Config.Id)}";
} }
} }
} }
@ -459,31 +457,34 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
} }
} }
private void HandleOnGamepadDisconnected(string id) private async void HandleOnGamepadDisconnected(string id)
{ {
_isChangeTrackingActive = false; // Disable configuration change tracking _isChangeTrackingActive = false; // Disable configuration change tracking
await Dispatcher.UIThread.InvokeAsync(() =>
{
LoadDevices();
LoadDevices(); IsModified = true;
RevertChanges();
IsModified = true; FindPairedDeviceInConfigFile();
RevertChanges();
FindPairedDeviceInConfigFile();
_isChangeTrackingActive = true; // Enable configuration change tracking
_isChangeTrackingActive = true; // Enable configuration change tracking
return System.Threading.Tasks.Task.CompletedTask;
});
} }
private void HandleOnGamepadConnected(string id) private async void HandleOnGamepadConnected(string id)
{ {
_isChangeTrackingActive = false; // Disable configuration change tracking _isChangeTrackingActive = false; // Disable configuration change tracking
await Dispatcher.UIThread.InvokeAsync(() =>
{
LoadDevices();
LoadDevices(); IsModified = true;
RevertChanges();
IsModified = true;
RevertChanges();
_isChangeTrackingActive = true;// Enable configuration change tracking
_isChangeTrackingActive = true;// Enable configuration change tracking
});
} }
private string GetCurrentGamepadId() private string GetCurrentGamepadId()