UI: Enable Rainbow cycling in the Settings window

This commit is contained in:
Evan Husted 2025-01-29 20:27:01 -06:00
parent 0ed7fd14ba
commit 023bd5f00f
4 changed files with 31 additions and 3 deletions

View file

@ -20,6 +20,7 @@ using Ryujinx.Common.Configuration.Hid.Keyboard;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Utilities;
using Ryujinx.Input;
using Ryujinx.Input.SDL2;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -63,7 +64,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
get => _selectedGamepad;
private set
{
Rainbow.Reset();
_selectedGamepad = value;
if (ConfigViewModel is ControllerInputViewModel { Config.UseRainbowLed: true })
Rainbow.Updated += color => _selectedGamepad.SetLed((uint)color);
OnPropertiesChanged(nameof(HasLed), nameof(CanClearLed));
}
}