mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
fix(wpf): 自动战斗在开启战斗列表时导入作业后,关闭战斗列表开始任务时作业使用错误
This commit is contained in:
@@ -1130,6 +1130,12 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
_runningState.SetIdle(true);
|
||||
return;
|
||||
}
|
||||
else if (_taskType == AsstTaskType.Copilot && !UseCopilotList && _copilotCache is null)
|
||||
{
|
||||
AddLog("copilot is empty", UiLogColor.Error, showTime: false);
|
||||
_runningState.SetIdle(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (SettingsViewModel.GameSettings.CopilotWithScript)
|
||||
{
|
||||
@@ -1194,6 +1200,20 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsDataFromWeb)
|
||||
{
|
||||
try
|
||||
{
|
||||
await File.WriteAllTextAsync(TempCopilotFile, JsonConvert.SerializeObject(_copilotCache, Formatting.Indented));
|
||||
}
|
||||
catch
|
||||
{
|
||||
AddLog("Could not save copilot task to file: " + TempCopilotFile, UiLogColor.Error);
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var task = new AsstCopilotTask()
|
||||
{
|
||||
FileName = IsDataFromWeb ? TempCopilotFile : Filename,
|
||||
|
||||
Reference in New Issue
Block a user