mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
perf.为滑动选择干员增加容错操作
This commit is contained in:
@@ -18,26 +18,32 @@ bool asst::InfrastOfficeTask::run()
|
||||
|
||||
swipe_to_the_right_of_main_ui();
|
||||
enter_facility(FacilityName, 0);
|
||||
|
||||
click_bottomleft_tab();
|
||||
swipe_to_the_left_of_operlist();
|
||||
|
||||
opers_detect_with_swipe();
|
||||
swipe_to_the_left_of_operlist();
|
||||
constexpr int retry_times = 1;
|
||||
for (int i = 0; i <= retry_times; ++i) {
|
||||
swipe_to_the_left_of_operlist();
|
||||
opers_detect_with_swipe();
|
||||
swipe_to_the_left_of_operlist();
|
||||
|
||||
auto find_iter = std::find_if(m_all_available_opers.begin(), m_all_available_opers.end(),
|
||||
[&](const InfrastOperSkillInfo& info) -> bool {
|
||||
return info.selected;
|
||||
});
|
||||
// 如果之前有干员在,那就不换人,直接退出办公室
|
||||
if (find_iter != m_all_available_opers.end()) {
|
||||
m_all_available_opers.erase(find_iter);
|
||||
auto find_iter = std::find_if(m_all_available_opers.begin(), m_all_available_opers.end(),
|
||||
[&](const InfrastOperSkillInfo& info) -> bool {
|
||||
return info.selected;
|
||||
});
|
||||
// 如果之前有干员在,那就不换人,直接退出办公室
|
||||
if (find_iter != m_all_available_opers.end()) {
|
||||
m_all_available_opers.erase(find_iter);
|
||||
}
|
||||
else {
|
||||
optimal_calc();
|
||||
bool ret = opers_choose();
|
||||
if (!ret) {
|
||||
m_all_available_opers.clear();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else {
|
||||
optimal_calc();
|
||||
opers_choose();
|
||||
}
|
||||
|
||||
click_confirm_button();
|
||||
click_return_button();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user