mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-13 02:52:37 +00:00
Change: In the industry directory window an industry will be greyed out if it temporarily does not accept the cargo selected by the acceptance cargo filter.
This commit is contained in:
parent
808253c29c
commit
596fb5d54a
@ -1565,8 +1565,17 @@ public:
|
|||||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_INDUSTRY_DIRECTORY_NONE);
|
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_INDUSTRY_DIRECTORY_NONE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
TextColour tc;
|
||||||
|
const CargoID acf_cid = this->cargo_filter[this->accepted_cargo_filter_criteria];
|
||||||
for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) {
|
for (uint i = this->vscroll->GetPosition(); i < this->industries.size(); i++) {
|
||||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, this->GetIndustryString(this->industries[i]));
|
tc = TC_FROMSTRING;
|
||||||
|
if (acf_cid != CF_ANY && acf_cid != CF_NONE) {
|
||||||
|
Industry *ind = const_cast<Industry *>(this->industries[i]);
|
||||||
|
if (IndustryTemporarilyRefusesCargo(ind, acf_cid)) {
|
||||||
|
tc = TC_GREY | TC_FORCED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, this->GetIndustryString(this->industries[i]), tc);
|
||||||
|
|
||||||
y += this->resize.step_height;
|
y += this->resize.step_height;
|
||||||
if (++n == this->vscroll->GetCapacity()) break; // max number of industries in 1 window
|
if (++n == this->vscroll->GetCapacity()) break; // max number of industries in 1 window
|
||||||
|
Loading…
Reference in New Issue
Block a user