Quellcode durchsuchen

Fix LED turning on in input settings, despite TurnOffLed being set to true (#583)

The ColorPicker auotmatically sets the LED to the selected Color
whenever the Input Settings are opened. Therefore it now checks if the
setting is turned off before changing the color.
Otozinclus vor 1 Jahr
Ursprung
Commit
f15aa8fba0
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs

+ 4 - 2
src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs

@@ -252,7 +252,8 @@ namespace Ryujinx.Ava.UI.Views.Input
             if (!args.NewColor.HasValue) return;
             if (!args.NewColor.HasValue) return;
             if (DataContext is not ControllerInputViewModel cVm) return;
             if (DataContext is not ControllerInputViewModel cVm) return;
             if (!cVm.Config.EnableLedChanging) return;
             if (!cVm.Config.EnableLedChanging) return;
-
+            if (cVm.Config.TurnOffLed) return;
+            
             cVm.ParentModel.SelectedGamepad.SetLed(args.NewColor.Value.ToUInt32());
             cVm.ParentModel.SelectedGamepad.SetLed(args.NewColor.Value.ToUInt32());
         }
         }
 
 
@@ -260,7 +261,8 @@ namespace Ryujinx.Ava.UI.Views.Input
         {
         {
             if (DataContext is not ControllerInputViewModel cVm) return;
             if (DataContext is not ControllerInputViewModel cVm) return;
             if (!cVm.Config.EnableLedChanging) return;
             if (!cVm.Config.EnableLedChanging) return;
-
+            if (cVm.Config.TurnOffLed) return;
+            
             cVm.ParentModel.SelectedGamepad.SetLed(cVm.Config.LedColor.ToUInt32());
             cVm.ParentModel.SelectedGamepad.SetLed(cVm.Config.LedColor.ToUInt32());
         }
         }
     }
     }