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

This commit is contained in:
Evan Husted 2024-11-10 22:31:26 -06:00
parent 7369079459
commit 826ffd4a04
2 changed files with 5 additions and 4 deletions

View file

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

View file

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