rft: WpfGui重构 一键长草任务callback拆分 (#11548)

* rft: 通知拆分

* rft: 移动InvokeProcSubTaskMsg至TaskQueueViewModel

* perf: 优化调用
This commit is contained in:
status102
2025-01-17 10:05:20 +08:00
committed by GitHub
parent 22986f7a19
commit f333c420f0
4 changed files with 69 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
// <copyright file="ConnectSettingsUserControlModel.cs" company="MaaAssistantArknights">
// <copyright file="StartUpSettingsUserControlModel.cs" company="MaaAssistantArknights">
// MaaWpfGui - A part of the MaaCoreArknights project
// Copyright (C) 2021 MistEO and Contributors
//
@@ -13,11 +13,12 @@
#nullable enable
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using Stylet;
using MaaWpfGui.Main;
using Newtonsoft.Json.Linq;
namespace MaaWpfGui.ViewModels.UserControl.TaskQueue;
public class StartUpSettingsUserControlModel : PropertyChangedBase
public class StartUpSettingsUserControlModel : TaskViewModel
{
static StartUpSettingsUserControlModel()
{
@@ -44,4 +45,12 @@ public class StartUpSettingsUserControlModel : PropertyChangedBase
{
Instances.TaskQueueViewModel.QuickSwitchAccount();
}
public override void ProcSubTaskMsg(AsstMsg msg, JObject details)
{
if (msg == AsstMsg.SubTaskExtraInfo && details["what"]?.ToString() == "AccountSwitch")
{
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("AccountSwitch") + $" -->> {details["details"]!["account_name"]}", UiLogColor.Info); // subTaskDetails!["current_account"]
}
}
}