mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-24 22:59:54 -06:00
Add option to change controller LED color (#572)
This allows the user to change the controller LED while using Ryujinx. Useful for PS4 and PS5 controllers as an example. You can also use a spectrum-cycling Rainbow color option, or turn the LED off for DualSense controllers. --------- Co-authored-by: Evan Husted <greem@greemdev.net>
This commit is contained in:
@ -3,6 +3,7 @@ using Avalonia.Controls;
|
||||
using Avalonia.Svg.Skia;
|
||||
using Avalonia.Threading;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Input;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
@ -54,7 +55,18 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||
|
||||
public IGamepadDriver AvaloniaKeyboardDriver { get; }
|
||||
public IGamepad SelectedGamepad { get; private set; }
|
||||
|
||||
private IGamepad _selectedGamepad;
|
||||
|
||||
public IGamepad SelectedGamepad
|
||||
{
|
||||
get => _selectedGamepad;
|
||||
private set
|
||||
{
|
||||
_selectedGamepad = value;
|
||||
OnPropertiesChanged(nameof(HasLed), nameof(CanClearLed));
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<PlayerModel> PlayerIndexes { get; set; }
|
||||
public ObservableCollection<(DeviceType Type, string Id, string Name)> Devices { get; set; }
|
||||
@ -69,8 +81,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
public bool IsRight { get; set; }
|
||||
public bool IsLeft { get; set; }
|
||||
|
||||
public bool HasLed => false; //temporary
|
||||
//SelectedGamepad.Features.HasFlag(GamepadFeaturesFlag.Led);
|
||||
public bool HasLed => SelectedGamepad.Features.HasFlag(GamepadFeaturesFlag.Led);
|
||||
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
|
||||
|
||||
public bool IsModified { get; set; }
|
||||
public event Action NotifyChangesEvent;
|
||||
|
Reference in New Issue
Block a user