|
|
@@ -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;
|
|
|
}
|
|
|
|