Skip to content

Commit

Permalink
Change: Add dividers in vehicle group action dropdown (OpenTTD#12284)
Browse files Browse the repository at this point in the history
  • Loading branch information
2TallTyler authored Mar 24, 2024
1 parent caa7c44 commit 8928f49
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/vehicle_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,26 @@ DropDownList BaseVehicleListWindow::BuildActionDropdownList(bool show_autoreplac
{
DropDownList list;

if (show_autoreplace) list.push_back(std::make_unique<DropDownListStringItem>(STR_VEHICLE_LIST_REPLACE_VEHICLES, ADI_REPLACE, false));
list.push_back(std::make_unique<DropDownListStringItem>(STR_VEHICLE_LIST_SEND_FOR_SERVICING, ADI_SERVICE, false));
list.push_back(std::make_unique<DropDownListStringItem>(this->vehicle_depot_name[this->vli.vtype], ADI_DEPOT, false));
/* Autoreplace actions. */
if (show_autoreplace) {
list.push_back(std::make_unique<DropDownListStringItem>(STR_VEHICLE_LIST_REPLACE_VEHICLES, ADI_REPLACE, false));
list.push_back(std::make_unique<DropDownListDividerItem>(-1, false));
}

/* Group actions. */
if (show_group) {
list.push_back(std::make_unique<DropDownListStringItem>(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED, false));
list.push_back(std::make_unique<DropDownListStringItem>(STR_GROUP_REMOVE_ALL_VEHICLES, ADI_REMOVE_ALL, false));
list.push_back(std::make_unique<DropDownListDividerItem>(-1, false));
} else if (show_create) {
list.push_back(std::make_unique<DropDownListStringItem>(STR_VEHICLE_LIST_CREATE_GROUP, ADI_CREATE_GROUP, false));
list.push_back(std::make_unique<DropDownListDividerItem>(-1, false));
}

/* Depot actions. */
list.push_back(std::make_unique<DropDownListStringItem>(STR_VEHICLE_LIST_SEND_FOR_SERVICING, ADI_SERVICE, false));
list.push_back(std::make_unique<DropDownListStringItem>(this->vehicle_depot_name[this->vli.vtype], ADI_DEPOT, false));

return list;
}

Expand Down

0 comments on commit 8928f49

Please sign in to comment.