fix: 修复自定义基建宿舍始终autofill的问题,优化部分自定义基建判断逻辑

This commit is contained in:
MistEO
2022-09-21 12:16:39 +08:00
parent b8a010333a
commit dfa6f52a2b
8 changed files with 19 additions and 18 deletions

View File

@@ -134,13 +134,11 @@ void asst::InfrastAbstractTask::async_swipe_of_operlist(bool reverse)
}
}
bool asst::InfrastAbstractTask::is_use_custom_config()
bool asst::InfrastAbstractTask::is_use_custom_opers()
{
if (!m_is_custom) {
return false;
}
return !m_current_room_custom_config.names.empty() || !m_current_room_custom_config.candidates.empty() ||
!m_current_room_custom_config.autofill;
return m_is_custom &&
(!m_current_room_custom_config.names.empty()
|| !m_current_room_custom_config.candidates.empty());
}
void asst::InfrastAbstractTask::await_swipe()

View File

@@ -36,7 +36,7 @@ namespace asst
void swipe_of_operlist(bool reverse = false);
void async_swipe_of_operlist(bool reverse = false);
void await_swipe();
bool is_use_custom_config();
bool is_use_custom_opers();
bool swipe_and_select_custom_opers(bool is_dorm_order = false);
bool select_custom_opers();
void order_opers_selection(const std::vector<std::string>& names);

View File

@@ -25,7 +25,7 @@ bool asst::InfrastControlTask::_run()
}
click_clear_button();
if (is_use_custom_config()) {
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
if (name_select_ret) {
break;

View File

@@ -41,6 +41,12 @@ bool asst::InfrastDormTask::_run()
return false;
}
click_clear_button();
if (is_use_custom_opers()) {
swipe_and_select_custom_opers(true);
}
Log.trace("m_dorm_notstationed_enabled:", m_dorm_notstationed_enabled);
if (m_dorm_notstationed_enabled && !m_if_filter_notstationed_haspressed) {
Log.trace("click_filter_menu_not_stationed_button");
@@ -48,12 +54,9 @@ bool asst::InfrastDormTask::_run()
m_if_filter_notstationed_haspressed = true;
}
click_clear_button();
if (is_use_custom_config()) {
swipe_and_select_custom_opers(true);
if (!m_is_custom || m_current_room_custom_config.autofill) {
opers_choose();
}
opers_choose();
click_confirm_button();
click_return_button();

View File

@@ -22,7 +22,7 @@ bool asst::InfrastOfficeTask::_run()
if (need_exit()) {
return false;
}
if (is_use_custom_config()) {
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
if (name_select_ret) {
break;

View File

@@ -30,7 +30,7 @@ bool asst::InfrastPowerTask::_run()
}
for (int j = 0; j <= OperSelectRetryTimes; ++j) {
if (is_use_custom_config()) {
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
if (name_select_ret) {
break;

View File

@@ -92,7 +92,7 @@ bool asst::InfrastProductionTask::shift_facility_list()
}
if (m_cur_facility_index != 0) {
callback(AsstMsg::SubTaskExtraInfo, basic_info_with_what("EnterFacility"));
if (is_use_custom_config()) {
if (is_use_custom_opers()) {
if (m_cur_facility_index < m_custom_config.size()) {
m_current_room_custom_config = m_custom_config.at(m_cur_facility_index);
}
@@ -165,7 +165,7 @@ bool asst::InfrastProductionTask::shift_facility_list()
}
click_clear_button();
if (is_use_custom_config()) {
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
if (name_select_ret) {
break;

View File

@@ -177,7 +177,7 @@ bool asst::InfrastReceptionTask::shift()
}
click_clear_button();
if (is_use_custom_config()) {
if (is_use_custom_opers()) {
bool name_select_ret = swipe_and_select_custom_opers();
if (name_select_ret) {
break;