fix: 修复外服基建干员选择列表无法重置 (#12652)

fix #12649
This commit is contained in:
status102
2025-05-11 18:06:32 +08:00
committed by GitHub
parent 204d05288b
commit 6aee8498e9
4 changed files with 29 additions and 26 deletions

View File

@@ -3043,7 +3043,8 @@
},
"InfrastCloseQuickFormationExpandRole": {
"action": "ClickSelf",
"roi": [1163, 0, 117, 133]
"roi": [1163, 0, 117, 133],
"next": ["Stop"]
},
"InfrastClueVacancyNo1": {
"template": "ClueVacancyNo1.png",
@@ -3465,7 +3466,7 @@
"BattleQuickFormationExpandRole": {
"action": "ClickSelf",
"roi": [1152, 0, 128, 138],
"postDelay": 500
"next": ["Stop"]
},
"BattleQuickFormationRole": {
"Doc": "base_task",
@@ -3476,7 +3477,7 @@
"templThreshold": 0.7,
"colorScales": [[90, 150]],
"colorWithClose": false,
"postDelay": 500
"next": ["Stop"]
},
"BattleQuickFormationFilter": {
"action": "ClickSelf",

View File

@@ -113,7 +113,7 @@ bool asst::InfrastAbstractTask::match_operator_groups()
Log.error("already retried");
break;
}
swipe_to_the_left_of_operlist();
swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
retried = true;
}
@@ -130,7 +130,7 @@ bool asst::InfrastAbstractTask::match_operator_groups()
swipe_times++;
}
}
swipe_to_the_left_of_operlist();
swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
Log.info(__FUNCTION__, "available operators for group size:", opers.size());
// 筛选第一个满足要求的干员组
@@ -292,7 +292,7 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order
Log.error("already retring");
break;
}
swipe_to_the_left_of_operlist();
swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
retried = true;
}
@@ -320,7 +320,7 @@ bool asst::InfrastAbstractTask::swipe_and_select_custom_opers(bool is_dorm_order
}
if (swipe_times) {
swipe_to_the_left_of_operlist();
swipe_to_the_left_of_operlist(swipe_times + 1);
swipe_times = 0;
}
// 如果只选了一个人没必要排序
@@ -690,25 +690,27 @@ void asst::InfrastAbstractTask::swipe_of_operlist()
ProcessTask(*this, { "InfrastOperListSlowlySwipeToTheRight" }).run();
}
void asst::InfrastAbstractTask::swipe_to_the_left_of_operlist()
void asst::InfrastAbstractTask::swipe_to_the_left_of_operlist(int loop_times)
{
/*
if (loop_times < 0) {
loop_times = operlist_swipe_times();
}
for (int i = 0; i < loop_times; ++i) {
ProcessTask(*this, { "InfrastOperListSwipeToTheLeft" }).run();
}
ProcessTask(*this, { "SleepAfterOperListQuickSwipe" }).run();
*/
// 通过切换职业栏来实现回正
ProcessTask(*this, { "BattleQuickFormationExpandRole", "BattleQuickFormationRole-All-OCR" }).run();
ProcessTask(*this, { "BattleQuickFormationRole-Caster" }).run();
ProcessTask(*this, { "BattleQuickFormationRole-All" }).run();
// 基建默认收起
ProcessTask(*this, { "InfrastCloseQuickFormationExpandRole" }).run();
sleep(500);
bool ret = ProcessTask(*this, { "BattleQuickFormationExpandRole", "BattleQuickFormationRole-All-OCR" })
.set_retry_times(3)
.run();
if (ret) {
ProcessTask(*this, { "BattleQuickFormationRole-Caster" }).run();
ProcessTask(*this, { "BattleQuickFormationRole-All" }).run();
// 基建默认收起
close_quick_formation_expand_role();
}
else {
if (loop_times < 0) {
loop_times = operlist_swipe_times();
}
for (int i = 0; i < loop_times; ++i) {
ProcessTask(*this, { "InfrastOperListSwipeToTheLeft" }).run();
}
ProcessTask(*this, { "SleepAfterOperListQuickSwipe" }).run();
}
}
void asst::InfrastAbstractTask::swipe_to_the_left_of_main_ui()

View File

@@ -38,7 +38,7 @@ protected:
virtual int operlist_swipe_times() const noexcept { return 2; }
// 滑动到干员列表的最左侧
void swipe_to_the_left_of_operlist();
void swipe_to_the_left_of_operlist(int loop_times = -1);
// 滑动基建的主界面到最左侧
void swipe_to_the_left_of_main_ui();
// 滑动基建的主界面到最右侧

View File

@@ -708,7 +708,7 @@ bool asst::InfrastProductionTask::opers_choose()
}
if (swipe_times) {
swipe_to_the_left_of_operlist();
swipe_to_the_left_of_operlist(swipe_times + 1);
}
// 点两次排序,让已选干员排到最前面
ProcessTask(*this, { "InfrastOperListTabSkillUnClicked" }).run();