Feature: Auto-Assign Controllers #706

Open
uncavo-hdmi wants to merge 31 commits from uncavo-hdmi/auto-assign-controller into master
2 changed files with 17 additions and 2 deletions
Showing only changes of commit fd9bce0f6b - Show all commits

View File

@ -94,6 +94,8 @@ namespace Ryujinx.Ava.Input
{
desiredIndex = GetFirstAvailableIndex(usedIndices);
}
if(desiredIndex == -1) continue;
InputConfig config = new GamepadInputConfig(existingConfig).GetConfig();
config.PlayerIndex = (PlayerIndex)desiredIndex;

View File

@ -375,10 +375,23 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
Dispatcher.UIThread.Post(() => {
LoadDevices();
_isLoaded = false;
LoadConfiguration();
LoadConfiguration();
LoadDevice();
_isLoaded = true;
NotifyChanges();
if (ConfigViewModel is not ControllerInputViewModel controllerInputViewModel) return;
GamepadInputConfig inputConfig = controllerInputViewModel.Config;
if (inputConfig is not { EnableLedChanging: true }) return;
if (inputConfig.TurnOffLed)
{
SelectedGamepad.ClearLed();
}
else
{
SelectedGamepad.SetLed(inputConfig.LedColor.ToUInt32());
}
});
}