mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 02:10:21 +08:00
feat: 初步完成自定义换班协议解析,operators字段支持,重构一小部分代码
This commit is contained in:
@@ -22,40 +22,23 @@ bool asst::InfrastOfficeTask::_run()
|
||||
if (!opers_detect_with_swipe()) {
|
||||
return false;
|
||||
}
|
||||
swipe_to_the_left_of_operlist();
|
||||
|
||||
auto find_iter =
|
||||
ranges::find_if(m_all_available_opers, [&](const infrast::Oper& info) -> bool { return info.selected; });
|
||||
|
||||
bool need_shift = true;
|
||||
if (find_iter != m_all_available_opers.end()) {
|
||||
switch (m_work_mode) {
|
||||
case infrast::WorkMode::Gentle:
|
||||
// 如果之前有干员在,那就不换人,直接退出
|
||||
m_all_available_opers.erase(find_iter);
|
||||
need_shift = false;
|
||||
break;
|
||||
case infrast::WorkMode::Aggressive:
|
||||
need_shift = true;
|
||||
// TODO,这里有个bug,全部干员中的selected,和当前的,不一定是同一个页面
|
||||
// 不过目前没影响,反正滑动到最前面了,selected的一定是在最前面
|
||||
// m_ctrler->click(find_iter->rect);
|
||||
// sleep(300);
|
||||
break;
|
||||
case infrast::WorkMode::Extreme: // TODO
|
||||
break;
|
||||
default:
|
||||
if (is_use_custom_config()) {
|
||||
bool name_select_ret = swipe_and_select_opers_by_name(m_current_room_custom_config.names);
|
||||
if (name_select_ret) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (need_shift) {
|
||||
optimal_calc();
|
||||
if (!opers_choose()) {
|
||||
m_all_available_opers.clear();
|
||||
else {
|
||||
swipe_to_the_left_of_operlist();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
optimal_calc();
|
||||
if (!opers_choose()) {
|
||||
m_all_available_opers.clear();
|
||||
swipe_to_the_left_of_operlist();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
click_confirm_button();
|
||||
|
||||
Reference in New Issue
Block a user