mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
perf: 仅在LinkStart时执行完成后动作, 避免单次运行时触发
This commit is contained in:
@@ -1176,6 +1176,8 @@ public class AsstProxy
|
||||
|
||||
case AsstMsg.AllTasksCompleted:
|
||||
bool isMainTaskQueueAllCompleted = false;
|
||||
bool startByLinkStart = Instances.TaskQueueViewModel.StartByLinkStart;
|
||||
Instances.TaskQueueViewModel.StartByLinkStart = false;
|
||||
var taskList = details["finished_tasks"]?.ToObject<AsstTaskId[]>();
|
||||
if (taskList?.Length > 0)
|
||||
{
|
||||
@@ -1287,12 +1289,15 @@ public class AsstProxy
|
||||
}
|
||||
|
||||
// Instances.TaskQueueViewModel.CheckAndShutdown();
|
||||
_ = Instances.TaskQueueViewModel.CheckAfterCompleted();
|
||||
|
||||
if (Instances.OverlayViewModel.IsCreated)
|
||||
{
|
||||
AchievementTrackerHelper.Instance.Unlock(AchievementIds.LogSupervisor);
|
||||
}
|
||||
|
||||
if (startByLinkStart)
|
||||
{
|
||||
_ = Instances.TaskQueueViewModel.CheckAfterCompleted();
|
||||
}
|
||||
}
|
||||
else if (isCopilotTaskChain)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using JetBrains.Annotations;
|
||||
using MaaWpfGui.Configuration;
|
||||
using MaaWpfGui.Configuration.Factory;
|
||||
using MaaWpfGui.Configuration.Single.MaaTask;
|
||||
using MaaWpfGui.Constants;
|
||||
@@ -212,6 +211,8 @@ public class TaskQueueViewModel : Screen
|
||||
});
|
||||
}
|
||||
|
||||
#region Overlay
|
||||
|
||||
public static void ChooseOverlayTarget()
|
||||
{
|
||||
try
|
||||
@@ -275,6 +276,8 @@ public class TaskQueueViewModel : Screen
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Overlay
|
||||
|
||||
/// <summary>
|
||||
/// Gets or private sets the view models of log items.
|
||||
/// </summary>
|
||||
@@ -435,6 +438,8 @@ public class TaskQueueViewModel : Screen
|
||||
|
||||
#region ActionAfterTasks
|
||||
|
||||
public bool StartByLinkStart { get; set; }
|
||||
|
||||
private bool _enableAfterActionSetting;
|
||||
|
||||
/// <summary>
|
||||
@@ -1769,6 +1774,7 @@ public class TaskQueueViewModel : Screen
|
||||
/// <returns>Task</returns>
|
||||
public async Task LinkStart()
|
||||
{
|
||||
StartByLinkStart = true;
|
||||
using var log = new LogScope(_logger);
|
||||
await TaskQueueSerializingLock.WaitAsync();
|
||||
await LinkStartWithTasks(ConfigFactory.CurrentConfig.TaskQueue);
|
||||
|
||||
Reference in New Issue
Block a user