mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-29 22:32:24 -05:00
Fully disconnect gamepad handler for rainbow color if configuration is set with UseRainbowLed false
Also check if its even enabled before setting the rainbow color Fixes strobing
This commit is contained in:
@@ -226,6 +226,13 @@ namespace Ryujinx.Input.SDL2
|
||||
|
||||
private static Vector3 GsToMs2(Vector3 gs) => gs / SDL_STANDARD_GRAVITY;
|
||||
|
||||
private void RainbowColorChanged(int packedRgb)
|
||||
{
|
||||
if (!_configuration.Led.UseRainbow) return;
|
||||
|
||||
SetLed((uint)packedRgb);
|
||||
}
|
||||
|
||||
public void SetConfiguration(InputConfig configuration)
|
||||
{
|
||||
lock (_userMappingLock)
|
||||
@@ -237,10 +244,12 @@ namespace Ryujinx.Input.SDL2
|
||||
if (_configuration.Led.TurnOffLed)
|
||||
(this as IGamepad).ClearLed();
|
||||
else if (_configuration.Led.UseRainbow)
|
||||
Rainbow.RainbowColorUpdated += clr => SetLed((uint)clr);
|
||||
Rainbow.RainbowColorUpdated += RainbowColorChanged;
|
||||
else
|
||||
SetLed(_configuration.Led.LedColor);
|
||||
|
||||
if (!_configuration.Led.UseRainbow)
|
||||
Rainbow.RainbowColorUpdated -= RainbowColorChanged;
|
||||
}
|
||||
|
||||
_buttonsUserMapping.Clear();
|
||||
|
||||
Reference in New Issue
Block a user