diff --git a/resource/tasks.json b/resource/tasks.json index 6386d7c5ff..02ab3a84df 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -9616,16 +9616,16 @@ 110 ], "next": [ - "OperatorRarityTab" + "OperatorRoleTabSelect" ] }, "OperatorRoleTabSelect": { "action": "ClickSelf", "roi": [ - 1210, - 30, - 68, - 23 + 1200, + 20, + 80, + 50 ], "next": [ "OperatorRoleTab" @@ -9634,9 +9634,9 @@ "OperatorRoleTab": { "action": "DoNothing", "roi": [ - 1197, - 14, - 82, + 1195, + 15, + 80, 50 ] }, diff --git a/resource/template/OperatorRoleTab.png b/resource/template/OperatorRoleTab.png index 64bd65fcbf..51f39f98c7 100644 Binary files a/resource/template/OperatorRoleTab.png and b/resource/template/OperatorRoleTab.png differ diff --git a/resource/template/OperatorRoleTabSelect.png b/resource/template/OperatorRoleTabSelect.png index 4f84ed1a33..c6b0869a06 100644 Binary files a/resource/template/OperatorRoleTabSelect.png and b/resource/template/OperatorRoleTabSelect.png differ diff --git a/src/MaaCore/Config/Miscellaneous/BattleDataConfig.cpp b/src/MaaCore/Config/Miscellaneous/BattleDataConfig.cpp index a6dd536a87..e5503119e0 100644 --- a/src/MaaCore/Config/Miscellaneous/BattleDataConfig.cpp +++ b/src/MaaCore/Config/Miscellaneous/BattleDataConfig.cpp @@ -3,7 +3,6 @@ #include "Utils/Logger.hpp" #include "Utils/Ranges.hpp" #include -#include bool asst::BattleDataConfig::parse(const json::value& json) { diff --git a/src/MaaCore/Vision/Miscellaneous/OperImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/OperImageAnalyzer.cpp index c4b6c9570c..53b7c06859 100644 --- a/src/MaaCore/Vision/Miscellaneous/OperImageAnalyzer.cpp +++ b/src/MaaCore/Vision/Miscellaneous/OperImageAnalyzer.cpp @@ -26,6 +26,8 @@ bool asst::OperImageAnalyzer::analyze() bool asst::OperImageAnalyzer::analyzer_opers() { + std::vector oper_names_result; + oper_names_result.clear(); const auto& ocr_replace = Task.get("CharsNameOcrReplace"); OcrWithFlagTemplImageAnalyzer oper_name_analyzer(m_image); @@ -34,7 +36,20 @@ bool asst::OperImageAnalyzer::analyzer_opers() oper_name_analyzer.set_replace(ocr_replace->replace_map, ocr_replace->replace_full); oper_name_analyzer.analyze(); - auto oper_names_result = oper_name_analyzer.get_result(); + oper_names_result = oper_name_analyzer.get_result(); + // 按位置排个序-先直接copy代码过来,后面可能重构 ( + // +---+ + // |1 3| + // |2 4| + // +---+ + ranges::sort(oper_names_result, [](const TextRect& lhs, const TextRect& rhs) -> bool { + if (std::abs(lhs.rect.x - rhs.rect.x) < 5) { // x差距较小则理解为是同一排的,按y排序 + return lhs.rect.y < rhs.rect.y; + } + else { + return lhs.rect.x < rhs.rect.x; + } + }); if (oper_names_result.empty()) { return false; @@ -43,7 +58,7 @@ bool asst::OperImageAnalyzer::analyzer_opers() for (auto& opername : oper_names_result) { OperBoxInfo oper_info; oper_info.name = std::move(opername.text); - current_page_opers.push_back(oper_info); + current_page_opers.emplace_back(oper_info); #ifdef ASST_DEBUG m_image_draw_oper = m_image; cv::rectangle(m_image_draw_oper, make_rect(opername.rect), cv::Scalar(0, 255, 0), 2);