fixed led live update while in settings

This commit is contained in:
uncavo-hdmi 2025-02-18 11:27:30 +01:00
parent b8cb70ef32
commit fd9bce0f6b
2 changed files with 17 additions and 2 deletions

View File

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

View File

@ -378,7 +378,20 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
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());
}
});
}