fix: 基建换班宿舍任务期间重进宿舍后,重置过滤状态记录 (#11007)

- link #10968
This commit is contained in:
status102
2024-11-01 23:58:26 +08:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@@ -23,6 +23,12 @@ asst::InfrastDormTask& asst::InfrastDormTask::set_trust_enabled(bool dorm_trust_
return *this;
}
bool asst::InfrastDormTask::on_run_fails()
{
m_if_filter_notstationed_haspressed = false;
return asst::InfrastAbstractTask::on_run_fails();
}
bool asst::InfrastDormTask::_run()
{
for (; m_cur_facility_index < m_max_num_of_dorm; ++m_cur_facility_index) {
@@ -50,13 +56,10 @@ bool asst::InfrastDormTask::_run()
}
Log.trace("m_dorm_notstationed_enabled:", m_dorm_notstationed_enabled);
if (m_dorm_notstationed_enabled) {
if (m_dorm_notstationed_enabled && !m_if_filter_notstationed_haspressed) {
Log.trace("click_filter_menu_not_stationed_button");
// 在此处不进行 m_if_filter_notstationed_haspressed 的判断,即必须重新选择一次筛选条件
if (click_filter_menu_not_stationed_button()) {
Log.info("successfully set filter to [Not Assigned]");
m_if_filter_notstationed_haspressed = true;
}
click_filter_menu_not_stationed_button();
m_if_filter_notstationed_haspressed = true;
}
if (!m_is_custom || current_room_config().autofill) {

View File

@@ -14,6 +14,9 @@ public:
InfrastDormTask& set_notstationed_enabled(bool dorm_notstationed_enabled) noexcept;
InfrastDormTask& set_trust_enabled(bool m_dorm_trust_enabled) noexcept;
protected:
virtual bool on_run_fails() override;
private:
virtual bool _run() override;
// virtual bool click_confirm_button() override;