perf: 自动战斗自动编队期间如有干员属性要求被忽略, 则禁用自动化投票

This commit is contained in:
status102
2026-02-12 19:30:33 +08:00
parent a1a90ff218
commit ee5db4fe02
2 changed files with 8 additions and 1 deletions

View File

@@ -2042,6 +2042,7 @@ public class AsstProxy
case "BattleFormationOperUnavailable":
{
Instances.CopilotViewModel.HasRequirementIgnored = true;
var oper_name = DataHelper.GetLocalizedCharacterName(subTaskDetails!["oper_name"]?.ToString());
var requirement_type = subTaskDetails["requirement_type"]?.ToString() switch {
"level" => LocalizationHelper.GetString("BattleFormationOperUnavailable.Level"),
@@ -2083,6 +2084,7 @@ public class AsstProxy
case "CopilotListLoadTaskFileSuccess":
Instances.CopilotViewModel.AddLog($"Parse {subTaskDetails!["file_name"]}[{subTaskDetails["stage_name"]}] Success");
Instances.CopilotViewModel.HasRequirementIgnored = false;
break;
case "SSSStage":

View File

@@ -365,6 +365,11 @@ public partial class CopilotViewModel : Screen
/// </summary>
public bool IgnoreRequirements { get => field; set => SetAndNotify(ref field, value); }
/// <summary>
/// Gets or sets a value indicating whether 真正有干员被忽略了要求
/// </summary>
public bool HasRequirementIgnored { get; set; } = false;
public bool UseSanityPotion { get => field; set => SetAndNotify(ref field, value); }
/// <summary>
@@ -1699,7 +1704,7 @@ public partial class CopilotViewModel : Screen
model.IsChecked = false;
if (model.CopilotId > 0 && _copilotIdList.Remove(model.CopilotId) && _copilotIdList.IndexOf(model.CopilotId) == -1 && !IgnoreRequirements)
if (model.CopilotId > 0 && _copilotIdList.Remove(model.CopilotId) && _copilotIdList.IndexOf(model.CopilotId) == -1 && !HasRequirementIgnored)
{
_ = RateCopilot(model.CopilotId);
}