fix: 删多了

This commit is contained in:
status102
2026-05-22 16:05:13 +08:00
parent 3ba810d1d5
commit 9c15e82ff8

View File

@@ -122,6 +122,31 @@ public class FightSettingsUserControlModel : TaskSettingsViewModel, FightSetting
StagePlan.Remove(plan);
}
/// <summary>
/// Gets or sets a value indicating whether to use custom stage code.
/// </summary>
public bool CustomStageCode
{
get => GetTaskConfig<FightTask>().IsStageManually;
set {
bool ret = SetTaskConfig<FightTask>(t => t.IsStageManually == value, t => t.IsStageManually = value);
if (ret && !value)
{
var stagePlan = GetTaskConfig<FightTask>().StagePlan;
for (int i = 0; i < stagePlan.Count; i++)
{
var stage = stagePlan[i];
if (!Instances.StageManager.GetStageList().Any(p => p.Value == stage))
{
stagePlan[i] = string.Empty;
}
}
SetTaskConfig<FightTask>(t => t.StagePlan.SequenceEqual(stagePlan), t => t.StagePlan = stagePlan);
RefreshCurrentStagePlan();
}
}
}
/// <summary>
/// Reset unsaved battle parameters.
/// </summary>