From be674bc681d33c2277e4a54b280a45260c083e25 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Mon, 19 Jan 2026 21:01:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=B7=E7=90=86=E6=99=BA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=BA=90=E7=9F=B3=20CheckBox=20=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Configuration/Single/MaaTask/FightTask.cs | 11 ++++++++++- .../TaskQueue/FightSettingsUserControlModel.cs | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/MaaWpfGui/Configuration/Single/MaaTask/FightTask.cs b/src/MaaWpfGui/Configuration/Single/MaaTask/FightTask.cs index 0729855134..a1b4c9eecb 100644 --- a/src/MaaWpfGui/Configuration/Single/MaaTask/FightTask.cs +++ b/src/MaaWpfGui/Configuration/Single/MaaTask/FightTask.cs @@ -15,6 +15,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using static MaaWpfGui.Main.AsstProxy; namespace MaaWpfGui.Configuration.Single.MaaTask; @@ -22,7 +23,7 @@ namespace MaaWpfGui.Configuration.Single.MaaTask; /// /// η†ζ™Ίδ½œζˆ˜ /// -public class FightTask : BaseTask +public class FightTask : BaseTask, IJsonOnDeserialized { public FightTask() => TaskType = TaskType.Fight; @@ -132,4 +133,12 @@ public class FightTask : BaseTask public bool UseWeeklySchedule { get; set; } public Dictionary WeeklySchedule { get; set; } = Enum.GetValues().ToDictionary(i => i, _ => true); + + public void OnDeserialized() + { + if (UseStoneAllowSave == false) + { + UseStone = false; + } + } } diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs index a078306564..e43fe0fda3 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs @@ -227,12 +227,9 @@ public class FightSettingsUserControlModel : TaskSettingsViewModel } SetFightParams(); - if (GetTaskConfig().UseStoneAllowSave) - { SetTaskConfig(t => t.UseStone == value, t => t.UseStone = value); } } - } /// /// Gets or sets a value indicating whether to use originiums.