diff --git a/resource/tasks.json b/resource/tasks.json index 75cb6e234a..fa6155e65b 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -2224,7 +2224,7 @@ "“耀阳”" ], [ - "玛恩.+", + "玛恩.*", "玛恩纳" ], [ @@ -4825,6 +4825,7 @@ }, "InfrastSortByTrustButtonClickAgain": { "action": "ClickSelf", + "templThreshold": 0.7, "cache": false, "roi": [ 1000, diff --git a/src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp b/src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp index 4eb03b9363..224d62cac4 100644 --- a/src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp +++ b/src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp @@ -153,6 +153,9 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order if (!is_dorm_order) { ProcessTask(*this, { "InfrastOperListTabSkillUnClicked", "Stop" }).run(); } + else { + ProcessTask(*this, { "InfrastOperListTabMoodDoubleClickWhenUnclicked" }).run(); + } if (max_num_of_opers() > 1) { click_clear_button(); // 先排序后清空,加速干员变化不大时的选择速度 @@ -205,12 +208,13 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order // 然后滑动到最左边,清空一下,在走后面的识别+按序点击逻辑 if (is_dorm_order) { ProcessTask(*this, { "InfrastOperListTabMoodDoubleClick" }).run(); + sleep(200); } else { ProcessTask(*this, { "InfrastOperListTabWorkStatusUnClicked" }).run(); } - if (room_config.sort || room_config.autofill) { + if (swipe_times) { swipe_to_the_left_of_operlist(swipe_times + 1); swipe_times = 0; } @@ -224,14 +228,10 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order return false; } - if (!is_dorm_order) { - if (swipe_times) swipe_to_the_left_of_operlist(swipe_times + 1); - swipe_times = 0; - if (!select_opers_review(origin_room_config)) { - // 复核失败,说明current_room_config与OCR识别是不符的,current_room_config是无效信息,还原到用户原来的配置,重选 - current_room_config() = std::move(origin_room_config); - return false; - } + if (!is_dorm_order && !select_opers_review(origin_room_config)) { + // 复核失败,说明current_room_config与OCR识别是不符的,current_room_config是无效信息,还原到用户原来的配置,重选 + current_room_config() = std::move(origin_room_config); + return false; } return true; @@ -250,7 +250,7 @@ bool asst::InfrastAbstractTask::select_opers_review(infrast::CustomRoomConfig co const auto image = ctrler()->get_image(); InfrastOperImageAnalyzer oper_analyzer(image); - oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected); + oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected | InfrastOperImageAnalyzer::ToBeCalced::Doing); if (!oper_analyzer.analyze()) { Log.warn("No oper"); return false; @@ -264,6 +264,9 @@ bool asst::InfrastAbstractTask::select_opers_review(infrast::CustomRoomConfig co Log.warn("select opers review fail: 选中干员数与期望不符"); return false; } + if (facility_name() != "Dorm" && (!m_is_custom || room_config.names.empty() && room_config.candidates.empty())) { + return true; + } if (selected_count < room_config.names.size()) { Log.warn("select opers review fail: 存在自定义干员未选中"); return false; @@ -288,7 +291,8 @@ bool asst::InfrastAbstractTask::select_opers_review(infrast::CustomRoomConfig co room_config.names.erase(iter); } else { // 备选干员或自动选择,只要不选工作中的干员即可 if (oper.doing == infrast::Doing::Working) { - Log.warn("select opers review fail: 非自定义情况下,选了正在工作的干员"); + Log.warn("选了工作中的干员:", name); + Log.warn("select opers review fail: 非自定义配置,却选了工作中的干员"); return false; } } @@ -403,7 +407,7 @@ void asst::InfrastAbstractTask::order_opers_selection(const std::vector