Преглед на файлове

misc: Move the LowPowerPtc event handler that changes Optimizations.LowPower into the ConfigurationState ctor

Evan Husted преди 1 година
родител
ревизия
826ffd4a04
променени са 2 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5 2
      src/Ryujinx.UI.Common/Configuration/ConfigurationState.Model.cs
  2. 0 2
      src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs

+ 5 - 2
src/Ryujinx.UI.Common/Configuration/ConfigurationState.Model.cs

@@ -1,4 +1,5 @@
-using Ryujinx.Common;
+using ARMeilleure;
+using Ryujinx.Common;
 using Ryujinx.Common.Configuration;
 using Ryujinx.Common.Configuration.Hid;
 using Ryujinx.Common.Configuration.Multiplayer;
@@ -12,7 +13,7 @@ namespace Ryujinx.UI.Common.Configuration
 {
     public partial class ConfigurationState
     {
-                /// <summary>
+        /// <summary>
         /// UI configuration section
         /// </summary>
         public class UISection
@@ -376,6 +377,8 @@ namespace Ryujinx.UI.Common.Configuration
                 EnablePtc.LogChangesToValue(nameof(EnablePtc));
                 EnableLowPowerPtc = new ReactiveObject<bool>();
                 EnableLowPowerPtc.LogChangesToValue(nameof(EnableLowPowerPtc));
+                EnableLowPowerPtc.Event += (_, evnt) 
+                    => Optimizations.LowPower = evnt.NewValue;
                 EnableInternetAccess = new ReactiveObject<bool>();
                 EnableInternetAccess.LogChangesToValue(nameof(EnableInternetAccess));
                 EnableFsIntegrityChecks = new ReactiveObject<bool>();

+ 0 - 2
src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs

@@ -24,8 +24,6 @@ namespace Ryujinx.UI.Common.Configuration
             }
 
             Instance = new ConfigurationState();
-
-            Instance.System.EnableLowPowerPtc.Event += (_, evnt) => Optimizations.LowPower = evnt.NewValue;
         }
         
         public ConfigurationFileFormat ToFileFormat()