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 22 additions and 14 deletions
Showing only changes of commit 38ecb3d5bc - Show all commits

View File

@ -19,7 +19,6 @@ using Ryujinx.Common.Logging;
using Ryujinx.Common.SystemInterop;
using Ryujinx.Graphics.Vulkan.MoltenVK;
using Ryujinx.Headless;
using Ryujinx.Input.SDL2;
using Ryujinx.SDL2.Common;
using System;
using System.Collections.Generic;

View File

@ -379,22 +379,31 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
LoadDevice();
_isLoaded = true;
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());
}
UpdateGamepadLed();
});
}
private void UpdateGamepadLed()
{
if (ConfigViewModel is not ControllerInputViewModel controllerInputViewModel) return;
GamepadInputConfig inputConfig = controllerInputViewModel.Config;
if (inputConfig is not { EnableLedChanging: true }) return;
if (inputConfig.TurnOffLed)
{
SelectedGamepad.ClearLed();
}
else if(inputConfig.UseRainbowLed)
{
SelectedGamepad.SetLed((uint)Rainbow.Color.ToArgb());
}
else
{
SelectedGamepad.SetLed(inputConfig.LedColor.ToUInt32());
}
}
private string GetCurrentGamepadId()
{
if (_device < 0)