mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 14:19:52 -06:00
UI: Enable Rainbow cycling in the Settings window
This commit is contained in:
@ -5,6 +5,7 @@ using FluentAvalonia.UI.Controls;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.UI.Models.Input;
|
||||
using Ryujinx.Ava.UI.Views.Input;
|
||||
using Ryujinx.Common.Utilities;
|
||||
using Ryujinx.UI.Views.Input;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
@ -48,6 +49,23 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||
ParentModel = model;
|
||||
model.NotifyChangesEvent += OnParentModelChanged;
|
||||
OnParentModelChanged();
|
||||
config.PropertyChanged += (_, args) =>
|
||||
{
|
||||
if (args.PropertyName is nameof(Config.UseRainbowLed))
|
||||
{
|
||||
if (Config is { UseRainbowLed: true, TurnOffLed: false, EnableLedChanging: true })
|
||||
Rainbow.Updated += color => ParentModel.SelectedGamepad.SetLed((uint)color);
|
||||
else
|
||||
{
|
||||
Rainbow.Reset();
|
||||
|
||||
if (Config.TurnOffLed)
|
||||
ParentModel.SelectedGamepad.ClearLed();
|
||||
else
|
||||
ParentModel.SelectedGamepad.SetLed(Config.LedColor.ToUInt32());
|
||||
}
|
||||
}
|
||||
};
|
||||
Config = config;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user