fix: wpf开始唤醒任务在未选择官服/B服时,不再提供账号切换输入

This commit is contained in:
status102
2025-03-05 21:35:53 +08:00
parent 8419dc567e
commit 81e1eb5660
3 changed files with 28 additions and 10 deletions

View File

@@ -14,6 +14,9 @@
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Main;
using MaaWpfGui.Models.AsstTasks;
using MaaWpfGui.Services;
using MaaWpfGui.ViewModels.UI;
using Newtonsoft.Json.Linq;
namespace MaaWpfGui.ViewModels.UserControl.TaskQueue;
@@ -54,4 +57,23 @@ public class StartUpSettingsUserControlModel : TaskViewModel
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("AccountSwitch") + $" -->> {details["details"]!["account_name"]}", UiLogColor.Info); // subTaskDetails!["current_account"]
}
}
public override (AsstTaskType Type, JObject Params) Serialize()
{
var clientType = SettingsViewModel.GameSettings.ClientType;
var accountName = clientType switch
{
"Official" or "Bilibili" => AccountName,
_ => string.Empty,
};
var task = new AsstStartUpTask()
{
ClientType = clientType,
StartGame = !string.IsNullOrEmpty(clientType),
AccountName = accountName,
};
return task.Serialize();
}
}