From c6e82046dd0331bedfbb75fffa5f915cf1864b95 Mon Sep 17 00:00:00 2001 From: uncavo-hdmi Date: Sat, 22 Feb 2025 18:37:01 +0100 Subject: [PATCH] minor fixes --- src/Ryujinx/Input/AutoAssignController.cs | 2 +- src/Ryujinx/Input/ControllerAssignmentManager.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx/Input/AutoAssignController.cs b/src/Ryujinx/Input/AutoAssignController.cs index 49fceed71..f3d59b01f 100644 --- a/src/Ryujinx/Input/AutoAssignController.cs +++ b/src/Ryujinx/Input/AutoAssignController.cs @@ -52,7 +52,6 @@ namespace Ryujinx.Ava.Input List 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 diff --git a/src/Ryujinx/Input/ControllerAssignmentManager.cs b/src/Ryujinx/Input/ControllerAssignmentManager.cs index 9e9612d12..d161b2e7d 100644 --- a/src/Ryujinx/Input/ControllerAssignmentManager.cs +++ b/src/Ryujinx/Input/ControllerAssignmentManager.cs @@ -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 ReorderControllers(List newConfig, List oldConfig) { + if(newConfig == null || oldConfig == null || newConfig.Count == 0 || oldConfig.Count == 0) return []; + List reorderedConfig = oldConfig.Select(config => new GamepadInputConfig(config).GetConfig()).ToList(); foreach (var config in newConfig)