mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
fix: 修复过程中无法删除'退出游戏'任务的问题
This commit is contained in:
@@ -300,6 +300,11 @@ namespace MeoAsstGui
|
||||
{
|
||||
isMainTaskQueueAllCompleted = false;
|
||||
}
|
||||
if (unique_runned_task == (_latestTaskId.TryGetValue(TaskType.CloseDown, out var closeDownTaskId) ? closeDownTaskId : 0))
|
||||
{
|
||||
isMainTaskQueueAllCompleted = false;
|
||||
_latestTaskId.Clear();
|
||||
}
|
||||
}
|
||||
mainModel.Idle = true;
|
||||
mainModel.UseStone = false;
|
||||
@@ -315,7 +320,11 @@ namespace MeoAsstGui
|
||||
//mainModel.CheckAndShutdown();
|
||||
mainModel.CheckAfterCompleted();
|
||||
}
|
||||
_latestTaskId.Clear();
|
||||
|
||||
if (!_latestTaskId.TryGetValue(TaskType.CloseDown, out _))
|
||||
{
|
||||
_latestTaskId.Clear();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -884,7 +893,7 @@ namespace MeoAsstGui
|
||||
{
|
||||
TaskId id = AsstAppendTaskWithEncoding("CloseDown");
|
||||
_latestTaskId[TaskType.CloseDown] = id;
|
||||
return id != 0 && AsstStart();
|
||||
return id != 0 && !AsstStart();
|
||||
}
|
||||
|
||||
public bool AsstAppendVisit()
|
||||
|
||||
@@ -350,11 +350,6 @@ namespace MeoAsstGui
|
||||
return;
|
||||
}
|
||||
|
||||
if (ActionAfterCompleted == ActionType.StopGame)
|
||||
{
|
||||
ret &= asstProxy.AsstStartCloseDown();
|
||||
}
|
||||
|
||||
ret &= asstProxy.AsstStart();
|
||||
|
||||
if (ret)
|
||||
@@ -630,6 +625,21 @@ namespace MeoAsstGui
|
||||
case ActionType.DoNothing:
|
||||
break;
|
||||
|
||||
case ActionType.StopGame:
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
if (!asstProxy.AsstStartCloseDown())
|
||||
{
|
||||
Execute.OnUIThread(() =>
|
||||
{
|
||||
using (var toast = new ToastNotification("游戏关闭失败"))
|
||||
{
|
||||
toast.AppendContentText("请手动关闭游戏")
|
||||
.Show(lifeTime: 5, row: 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case ActionType.ExitSelf:
|
||||
if (!new ToastNotification().CheckToastSystem())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user