minor fixes

This commit is contained in:
uncavo-hdmi 2025-02-22 18:37:01 +01:00
parent 538a9c83bd
commit c6e82046dd
2 changed files with 5 additions and 3 deletions

View File

@ -52,7 +52,6 @@ namespace Ryujinx.Ava.Input
List<InputConfig> newConfig = ControllerAssignmentManager.GetConfiguredControllers(
controllers, oldConfig, out bool hasNewControllersConnected);
_viewModel.AppHost?.NpadManager.ReloadConfiguration(newConfig, _configurationState.Hid.EnableKeyboard, _configurationState.Hid.EnableMouse);
if (!hasNewControllersConnected)
{
@ -62,6 +61,7 @@ namespace Ryujinx.Ava.Input
newConfig = ControllerAssignmentManager.ReorderControllers(newConfig, oldConfig);
}
_viewModel.AppHost?.NpadManager.ReloadConfiguration(newConfig, _configurationState.Hid.EnableKeyboard, _configurationState.Hid.EnableMouse);
_configurationState.Hid.InputConfig.Value = newConfig;
// we want to save the configuration only if a *new* controller was connected

View File

@ -14,8 +14,8 @@ namespace Ryujinx.Ava.Input
{
private static readonly uint[] _playerColors =
[
0xFFFF0000, // Player 1 - Red
0xFF0000FF, // Player 2 - Blue
0xFF0000FF, // Player 1 - Blue
0xFFFF0000, // Player 2 - Red
0xFF00FF00, // Player 3 - Green
0xFFFFFF00, // Player 4 - Yellow
0xFFFF00FF, // Player 5 - Magenta
@ -28,6 +28,8 @@ namespace Ryujinx.Ava.Input
public static List<InputConfig> ReorderControllers(List<InputConfig> newConfig, List<InputConfig> oldConfig)
{
if(newConfig == null || oldConfig == null || newConfig.Count == 0 || oldConfig.Count == 0) return [];
List<InputConfig> reorderedConfig = oldConfig.Select(config => new GamepadInputConfig(config).GetConfig()).ToList();
foreach (var config in newConfig)