fix: 刷理智使用源石 CheckBox 勾选后不生效

This commit is contained in:
status102
2026-01-19 21:01:49 +08:00
parent fd03b66f83
commit be674bc681
2 changed files with 10 additions and 4 deletions

View File

@@ -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;
/// <summary>
/// 理智作战
/// </summary>
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<DayOfWeek, bool> WeeklySchedule { get; set; } = Enum.GetValues<DayOfWeek>().ToDictionary(i => i, _ => true);
public void OnDeserialized()
{
if (UseStoneAllowSave == false)
{
UseStone = false;
}
}
}

View File

@@ -227,12 +227,9 @@ public class FightSettingsUserControlModel : TaskSettingsViewModel
}
SetFightParams();
if (GetTaskConfig<FightTask>().UseStoneAllowSave)
{
SetTaskConfig<FightTask>(t => t.UseStone == value, t => t.UseStone = value);
}
}
}
/// <summary>
/// Gets or sets a value indicating whether to use originiums.