feat: 自动编队允许指定助战单位 (#11075)

* feat: 自动编队自动借助战

Revert d78fc68

fix: 招募助战后继续(缺少点击快速招募)

i18n: 翻译

style: clang-format

fix: basetask template

fix: werror

perf: 注释、format

i18n: en

perf: 完成功能实现,复用task,进行gui输出

perf: 更改默认状态

feat: BattleFormationTask

Revert 05baeb4 (Back to 739aa03)

* fix: 缺干员回到主界面的时候应该点确认而不是返回

* feat: 助战干员职业选择栏模版

* refactor: UseSupportUnitTaskPlugin

* chore: Auto update by pre-commit hooks [skip changelog]

* perf: 默认值适配国服

* chore: Auto update by pre-commit hooks [skip changelog]

* feat: try_find_and_apply_support_unit

* chore: Auto update by pre-commit hooks [skip changelog]

* fix: 大概可以用了

* fix: 补充 struct 的构造函数

* chore: Auto update by pre-commit hooks [skip changelog]

* fix: 添加默认构造函数

* chore: Auto update by pre-commit hooks [skip changelog]

* fix: 改改类型

* fix: callback[what] 纠正

* perf: roi及初始化优化

* perf: 简化中英文查找

* perf: rename func

* perf: click roi

* fix: 在点击助战干员的行动后添加 LoadingText

* fix: 打点 Log

* fix: remove unused function

---------

Co-authored-by: status102 <102887808+status102@users.noreply.github.com>
Co-authored-by: 晓丶梦丶仁 <74444214+Daydreamer114@users.noreply.github.com>
This commit is contained in:
Weiyou Wang
2024-11-06 00:37:43 +11:00
committed by GitHub
parent 7216c94889
commit f0174a6541
44 changed files with 753 additions and 22 deletions

View File

@@ -64,6 +64,8 @@ bool asst::CopilotTask::set_params(const json::value& params)
{
LogTraceFunction;
using SupportUnitUsage = BattleFormationTask::SupportUnitUsage;
if (m_running) {
return false;
}
@@ -85,6 +87,8 @@ bool asst::CopilotTask::set_params(const json::value& params)
int select_formation = params.get("select_formation", 0); // 选择第几个编队0为不选择
bool add_trust = params.get("add_trust", false); // 是否自动补信赖
bool add_user_additional = params.contains("user_additional"); // 是否自动补用户自定义干员
auto support_unit_usage = static_cast<SupportUnitUsage>(
params.get("support_unit_usage", static_cast<int>(SupportUnitUsage::WhenNeeded))); // 助战干员使用模式
std::string support_unit_name = params.get("support_unit_name", std::string());
if (params.contains("add_user_additional")) {
@@ -145,7 +149,8 @@ bool asst::CopilotTask::set_params(const json::value& params)
m_formation_task_ptr->set_enable(with_formation && navigate_name.find("TR") == std::string::npos);
m_formation_task_ptr->set_select_formation(select_formation);
m_formation_task_ptr->set_add_trust(add_trust);
m_formation_task_ptr->set_support_unit_name(std::move(support_unit_name));
m_formation_task_ptr->set_support_unit_usage(support_unit_usage);
m_formation_task_ptr->set_specific_support_unit(support_unit_name);
if (auto opt = params.find<json::array>("user_additional"); add_user_additional && opt) {
std::vector<std::pair<std::string, int>> user_additional;