Revert "UI: Enable Rainbow cycling in the Settings window"

This reverts commit 023bd5f00fcedb3933cdb95d0b974cf397a147de.
This commit is contained in:
madwind 2025-01-31 23:16:14 +08:00
parent 693c3bb00d
commit b042368d75
4 changed files with 3 additions and 31 deletions

View File

@ -2,6 +2,8 @@ using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Configuration.Hid.Controller; using Ryujinx.Common.Configuration.Hid.Controller;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Common.Utilities; using Ryujinx.Common.Utilities;
using Ryujinx.HLE.HOS.Services.Hid;
using SDL2;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Numerics; using System.Numerics;
@ -10,7 +12,7 @@ using static SDL2.SDL;
namespace Ryujinx.Input.SDL2 namespace Ryujinx.Input.SDL2
{ {
public class SDL2Gamepad : IGamepad class SDL2Gamepad : IGamepad
{ {
private bool HasConfiguration => _configuration != null; private bool HasConfiguration => _configuration != null;

View File

@ -5,7 +5,6 @@ using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.Models.Input; using Ryujinx.Ava.UI.Models.Input;
using Ryujinx.Ava.UI.Views.Input; using Ryujinx.Ava.UI.Views.Input;
using Ryujinx.Common.Utilities;
using Ryujinx.UI.Views.Input; using Ryujinx.UI.Views.Input;
namespace Ryujinx.Ava.UI.ViewModels.Input namespace Ryujinx.Ava.UI.ViewModels.Input
@ -49,23 +48,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
ParentModel = model; ParentModel = model;
model.NotifyChangesEvent += OnParentModelChanged; model.NotifyChangesEvent += OnParentModelChanged;
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; Config = config;
} }

View File

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

View File

@ -133,13 +133,8 @@ namespace Ryujinx.Ava.UI.Views.Main
{ {
Window.SettingsWindow = new(Window.VirtualFileSystem, Window.ContentManager); Window.SettingsWindow = new(Window.VirtualFileSystem, Window.ContentManager);
Rainbow.Enable();
await Window.SettingsWindow.ShowDialog(Window); await Window.SettingsWindow.ShowDialog(Window);
Rainbow.Disable();
Rainbow.Reset();
Window.SettingsWindow = null; Window.SettingsWindow = null;
ViewModel.LoadConfigurableHotKeys(); ViewModel.LoadConfigurableHotKeys();