mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
feat: 自动战斗引入干员头像缓存机制
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "Utils/NoWarningCV.h"
|
||||
|
||||
#include "Config/Miscellaneous/BattleDataConfig.h"
|
||||
#include "Config/Miscellaneous/CopilotConfig.h"
|
||||
#include "Config/Miscellaneous/TilePack.h"
|
||||
#include "Config/TaskData.h"
|
||||
@@ -35,6 +36,7 @@ bool asst::BattleProcessTask::_run()
|
||||
return false;
|
||||
}
|
||||
|
||||
load_cache();
|
||||
update_deployment(true);
|
||||
to_group();
|
||||
|
||||
@@ -63,6 +65,23 @@ bool asst::BattleProcessTask::set_stage_name(const std::string& stage_name)
|
||||
return true;
|
||||
}
|
||||
|
||||
void asst::BattleProcessTask::load_cache()
|
||||
{
|
||||
LogTraceFunction;
|
||||
|
||||
for (const auto& oper_list : m_combat_data.groups | views::values) {
|
||||
for (const auto& oper : oper_list) {
|
||||
load_avatar_cache(oper.name);
|
||||
if (auto tokens = BattleData.get_tokens(oper.name); !tokens.empty()) {
|
||||
for (const std::string& token_name : tokens) {
|
||||
load_avatar_cache(token_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: 识别编队,额外加载编队中有的干员的缓存
|
||||
}
|
||||
|
||||
bool asst::BattleProcessTask::to_group()
|
||||
{
|
||||
std::unordered_map<std::string, std::vector<std::string>> groups;
|
||||
|
||||
Reference in New Issue
Block a user