Change: Add dividers in vehicle group action dropdown (#12284)

This commit is contained in:
Tyler Trahan 2024-03-24 07:44:25 -04:00 committed by GitHub
parent caa7c44052
commit 8928f4979a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 3 deletions

View File

@ -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;
}