From 826ffd4a04f53e2c209706160c1f7f10639d35d5 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sun, 10 Nov 2024 22:31:26 -0600 Subject: [PATCH] misc: Move the LowPowerPtc event handler that changes Optimizations.LowPower into the ConfigurationState ctor --- .../Configuration/ConfigurationState.Model.cs | 7 +++++-- src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.Model.cs b/src/Ryujinx.UI.Common/Configuration/ConfigurationState.Model.cs index 3b9ffb5d3..2b43b2032 100644 --- a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.Model.cs +++ b/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 { - /// + /// /// UI configuration section /// public class UISection @@ -376,6 +377,8 @@ namespace Ryujinx.UI.Common.Configuration EnablePtc.LogChangesToValue(nameof(EnablePtc)); EnableLowPowerPtc = new ReactiveObject(); EnableLowPowerPtc.LogChangesToValue(nameof(EnableLowPowerPtc)); + EnableLowPowerPtc.Event += (_, evnt) + => Optimizations.LowPower = evnt.NewValue; EnableInternetAccess = new ReactiveObject(); EnableInternetAccess.LogChangesToValue(nameof(EnableInternetAccess)); EnableFsIntegrityChecks = new ReactiveObject(); diff --git a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs b/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs index 5023e48c0..6fd5cfb93 100644 --- a/src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs +++ b/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()