* Display the Action dropdown window. * @param show_autoreplace If true include the autoreplace item. * @param show_group If true include group-related stuff. * @param show_create If true include group-create item. * @return Itemlist for dropdown */
| 524 | * @return Itemlist for dropdown |
| 525 | */ |
| 526 | DropDownList BaseVehicleListWindow::BuildActionDropdownList(bool show_autoreplace, bool show_group, bool show_create) |
| 527 | { |
| 528 | DropDownList list; |
| 529 | |
| 530 | /* Autoreplace actions. */ |
| 531 | if (show_autoreplace) { |
| 532 | list.push_back(MakeDropDownListStringItem(STR_VEHICLE_LIST_REPLACE_VEHICLES, ADI_REPLACE)); |
| 533 | list.push_back(MakeDropDownListDividerItem()); |
| 534 | } |
| 535 | |
| 536 | /* Group actions. */ |
| 537 | if (show_group) { |
| 538 | list.push_back(MakeDropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED)); |
| 539 | list.push_back(MakeDropDownListStringItem(STR_GROUP_REMOVE_ALL_VEHICLES, ADI_REMOVE_ALL)); |
| 540 | list.push_back(MakeDropDownListDividerItem()); |
| 541 | } else if (show_create) { |
| 542 | list.push_back(MakeDropDownListStringItem(STR_VEHICLE_LIST_CREATE_GROUP, ADI_CREATE_GROUP)); |
| 543 | list.push_back(MakeDropDownListDividerItem()); |
| 544 | } |
| 545 | |
| 546 | /* Depot actions. */ |
| 547 | list.push_back(MakeDropDownListStringItem(STR_VEHICLE_LIST_SEND_FOR_SERVICING, ADI_SERVICE)); |
| 548 | list.push_back(MakeDropDownListStringItem(this->vehicle_depot_name[this->vli.vtype], ADI_DEPOT)); |
| 549 | |
| 550 | return list; |
| 551 | } |
| 552 | |
| 553 | /* cached values for VehicleNameSorter to spare many GetString() calls */ |
| 554 | static const Vehicle *_last_vehicle[2] = { nullptr, nullptr }; |
no test coverage detected