Codechange: Don't filter industry list by cargo type every 3-sec refresh.

The 3-sec refresh is to update the list sorting. The filter only needs to
be applied once rebuilding the list.
This commit is contained in:
Peter Nelson 2023-11-04 14:32:39 +00:00 committed by Peter Nelson
parent 4033750968
commit 6b9dc8cfcf
1 changed files with 7 additions and 7 deletions

View File

@ -1422,18 +1422,18 @@ protected:
this->industries.shrink_to_fit();
this->industries.RebuildDone();
auto filter = std::make_pair(this->cargo_filter[this->accepted_cargo_filter_criteria],
this->cargo_filter[this->produced_cargo_filter_criteria]);
this->industries.Filter(filter);
this->hscroll->SetCount(this->GetIndustryListWidth());
}
auto filter = std::make_pair(this->cargo_filter[this->accepted_cargo_filter_criteria],
this->cargo_filter[this->produced_cargo_filter_criteria]);
this->industries.Filter(filter);
IndustryDirectoryWindow::produced_cargo_filter = this->cargo_filter[this->produced_cargo_filter_criteria];
this->industries.Sort();
this->vscroll->SetCount(this->industries.size()); // Update scrollbar as well.
this->SetDirty();
}