mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
fix: 肉鸽重新编队应先回到首页
This commit is contained in:
@@ -97,7 +97,7 @@ void asst::RoguelikeFormationTaskPlugin::clear_and_reselect()
|
||||
|
||||
m_last_detected_oper_names.clear();
|
||||
oper_list.clear();
|
||||
cur_page = 1;
|
||||
swipe_to_first_page();
|
||||
|
||||
while (analyze()) { // 返回true说明新增了干员,可能还有下一页
|
||||
ProcessTask(*this, { "RoguelikeRecruitOperListSlowlySwipeToTheRight" }).run();
|
||||
@@ -199,11 +199,7 @@ bool asst::RoguelikeFormationTaskPlugin::select(RoguelikeFormationImageAnalyzer:
|
||||
Log.info(__FUNCTION__, "swipe from page", cur_page, "to page", oper.page);
|
||||
// 在最大页码时(当总页数>=2),从右往左划可能会有对不齐的问题,直接划动到底
|
||||
if ((cur_page > oper.page && max_page >= 2 && cur_page == max_page) || max_page == 1) {
|
||||
for (; cur_page > 0; --cur_page) { // 多划一次到不存在的第0页
|
||||
ProcessTask(*this, { "RoguelikeRecruitOperListSwipeToTheLeft" }).run();
|
||||
}
|
||||
ProcessTask(*this, { "SleepAfterOperListQuickSwipe" }).run();
|
||||
cur_page = 1;
|
||||
swipe_to_first_page();
|
||||
}
|
||||
// 中间页面划动姑且当成是相对准确的
|
||||
while (cur_page > oper.page) {
|
||||
@@ -219,3 +215,12 @@ bool asst::RoguelikeFormationTaskPlugin::select(RoguelikeFormationImageAnalyzer:
|
||||
ctrler()->click(oper.rect);
|
||||
return true;
|
||||
}
|
||||
|
||||
void asst::RoguelikeFormationTaskPlugin::swipe_to_first_page()
|
||||
{
|
||||
for (; cur_page > 0; --cur_page) { // 多划一次到不存在的第0页
|
||||
ProcessTask(*this, { "RoguelikeRecruitOperListSwipeToTheLeft" }).run();
|
||||
}
|
||||
ProcessTask(*this, { "SleepAfterOperListQuickSwipe" }).run();
|
||||
cur_page = 1;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace asst
|
||||
void clear_and_reselect();
|
||||
bool analyze();
|
||||
bool select(RoguelikeFormationImageAnalyzer::FormationOper oper);
|
||||
void swipe_to_first_page();
|
||||
|
||||
private:
|
||||
int cur_page = 0;
|
||||
|
||||
Reference in New Issue
Block a user