Feature: Option to group vehicle lists by shared orders

This applies to all kinds of vehicle lists, as well as the "vehicle groups" window.
This commit is contained in:
Bernard Teo
2019-01-11 16:50:38 +08:00
committed by Patric Stout
parent 584df548f1
commit e59c400ca6
6 changed files with 298 additions and 56 deletions

View File

@@ -49,6 +49,7 @@ struct BaseVehicleListWindow : public Window {
enum GroupBy : byte {
GB_NONE,
GB_SHARED_ORDERS,
GB_END,
};
@@ -92,12 +93,26 @@ struct BaseVehicleListWindow : public Window {
const StringID *GetVehicleSorterNames()
{
return vehicle_group_none_sorter_names;
switch (this->grouping) {
case GB_NONE:
return vehicle_group_none_sorter_names;
case GB_SHARED_ORDERS:
return vehicle_group_shared_orders_sorter_names;
default:
NOT_REACHED();
}
}
VehicleGroupSortFunction * const *GetVehicleSorterFuncs()
{
return vehicle_group_none_sorter_funcs;
switch (this->grouping) {
case GB_NONE:
return vehicle_group_none_sorter_funcs;
case GB_SHARED_ORDERS:
return vehicle_group_shared_orders_sorter_funcs;
default:
NOT_REACHED();
}
}
};