Change: Hide unused cargos from vehicle cargo filter. (#11533)

The list of used cargo types is updated when the list is invalidated.
This commit is contained in:
Peter Nelson
2023-12-03 18:11:08 +00:00
committed by GitHub
parent 9a92e02fa7
commit 7ba89b946e
3 changed files with 22 additions and 7 deletions

View File

@@ -424,7 +424,7 @@ public:
break;
case WID_GL_FILTER_BY_CARGO:
size->width = std::max(size->width, GetDropDownListDimension(this->BuildCargoDropDownList()).width + padding.width);
size->width = std::max(size->width, GetDropDownListDimension(this->BuildCargoDropDownList(true)).width + padding.width);
break;
case WID_GL_MANAGE_VEHICLES_DROPDOWN: {
@@ -665,7 +665,7 @@ public:
return;
case WID_GL_FILTER_BY_CARGO: // Select filtering criteria dropdown menu
ShowDropDownList(this, this->BuildCargoDropDownList(), this->cargo_filter_criteria, widget);
ShowDropDownList(this, this->BuildCargoDropDownList(false), this->cargo_filter_criteria, widget);
break;
case WID_GL_ALL_VEHICLES: // All vehicles button