diff --git a/src/group_gui.cpp b/src/group_gui.cpp index b6c79b6aa9..d4ee016b9b 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -698,7 +698,8 @@ public: break; case WID_GL_SORT_BY_DROPDOWN: // Select sorting criteria dropdown menu - ShowDropDownMenu(this, this->vehicle_sorter_names, this->vehicles.SortType(), WID_GL_SORT_BY_DROPDOWN, 0, (this->vli.vtype == VEH_TRAIN || this->vli.vtype == VEH_ROAD) ? 0 : (1 << 10)); + ShowDropDownMenu(this, this->vehicle_sorter_names, this->vehicles.SortType(), WID_GL_SORT_BY_DROPDOWN, 0, + (this->vli.vtype == VEH_TRAIN || this->vli.vtype == VEH_ROAD) ? 0 : this->vehicle_sorter_non_ground_veh_disable_mask); return; case WID_GL_ALL_VEHICLES: // All vehicles button diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 43b1f6264c..e769e6a525 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1750,7 +1750,7 @@ public: case WID_VL_SORT_BY_PULLDOWN:// Select sorting criteria dropdown menu ShowDropDownMenu(this, this->vehicle_sorter_names, this->vehicles.SortType(), WID_VL_SORT_BY_PULLDOWN, 0, - (this->vli.vtype == VEH_TRAIN || this->vli.vtype == VEH_ROAD) ? 0 : (1 << 10), 0, DDSF_LOST_FOCUS); + (this->vli.vtype == VEH_TRAIN || this->vli.vtype == VEH_ROAD) ? 0 : this->vehicle_sorter_non_ground_veh_disable_mask, 0, DDSF_LOST_FOCUS); return; case WID_VL_LIST: { // Matrix to show vehicles diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h index 24a2543a2d..08e1c5ff58 100644 --- a/src/vehicle_gui_base.h +++ b/src/vehicle_gui_base.h @@ -40,6 +40,7 @@ struct BaseVehicleListWindow : public Window { static const StringID vehicle_depot_name[]; static const StringID vehicle_sorter_names[]; static GUIVehicleList::SortFunction * const vehicle_sorter_funcs[]; + const uint vehicle_sorter_non_ground_veh_disable_mask = (1 << 11); // STR_SORT_BY_LENGTH BaseVehicleListWindow(WindowDesc *desc, WindowNumber wno) : Window(desc), vli(VehicleListIdentifier::UnPack(wno)) {