Changeset - r28108:3e35cbbbefed
[Not reviewed]
master
0 1 0
Peter Nelson - 13 months ago 2023-11-04 14:32:39
peter1138@openttd.org
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.
1 file changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/industry_gui.cpp
Show inline comments
 
@@ -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();
 
	}
 

	
0 comments (0 inline, 0 general)