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

@@ -90,6 +90,7 @@ struct BaseVehicleListWindow : public Window {
VehicleID vehicle_sel; ///< Selected vehicle
CargoID cargo_filter_criteria; ///< Selected cargo filter index
uint order_arrow_width; ///< Width of the arrow in the small order list.
CargoTypes used_cargoes;
typedef GUIVehicleGroupList::SortFunction VehicleGroupSortFunction;
typedef GUIVehicleList::SortFunction VehicleIndividualSortFunction;
@@ -124,7 +125,7 @@ struct BaseVehicleListWindow : public Window {
void SetCargoFilterArray();
void FilterVehicleList();
StringID GetCargoFilterLabel(CargoID cid) const;
DropDownList BuildCargoDropDownList() const;
DropDownList BuildCargoDropDownList(bool full) const;
Dimension GetActionDropdownSize(bool show_autoreplace, bool show_group, bool show_create);
DropDownList BuildActionDropdownList(bool show_autoreplace, bool show_group, bool show_create);