|
|
|
@ -3894,18 +3894,14 @@ public:
|
|
|
|
|
this->depot_select_ctrl_pressed = _ctrl_pressed;
|
|
|
|
|
this->depot_select_active = true;
|
|
|
|
|
}
|
|
|
|
|
} else if (_settings_client.gui.show_depot_sell_gui && v->current_order.IsType(OT_GOTO_DEPOT)) {
|
|
|
|
|
if (_ctrl_pressed) {
|
|
|
|
|
OrderDepotActionFlags flags = v->current_order.GetDepotActionType() & (ODATFB_HALT | ODATFB_SELL);
|
|
|
|
|
DropDownList list;
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(STR_VEHICLE_LIST_SEND_FOR_SERVICING, DEPOT_SERVICE | DEPOT_DONT_CANCEL, !flags));
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(BaseVehicleListWindow::vehicle_depot_name[v->type], DEPOT_DONT_CANCEL, flags == ODATFB_HALT));
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(BaseVehicleListWindow::vehicle_depot_sell_name[v->type], DEPOT_SELL | DEPOT_DONT_CANCEL, flags == (ODATFB_HALT | ODATFB_SELL)));
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(STR_VEHICLE_LIST_CANCEL_DEPOT_SERVICE, DEPOT_CANCEL, false));
|
|
|
|
|
ShowDropDownList(this, std::move(list), -1, widget, 0, true);
|
|
|
|
|
} else {
|
|
|
|
|
DoCommandP(v->tile, v->index | DEPOT_CANCEL, 0, GetCmdSendToDepot(v));
|
|
|
|
|
}
|
|
|
|
|
} else if (_ctrl_pressed && _settings_client.gui.show_depot_sell_gui && v->current_order.IsType(OT_GOTO_DEPOT)) {
|
|
|
|
|
OrderDepotActionFlags flags = v->current_order.GetDepotActionType() & (ODATFB_HALT | ODATFB_SELL);
|
|
|
|
|
DropDownList list;
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(STR_VEHICLE_LIST_SEND_FOR_SERVICING, DEPOT_SERVICE | DEPOT_DONT_CANCEL, !flags));
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(BaseVehicleListWindow::vehicle_depot_name[v->type], DEPOT_DONT_CANCEL, flags == ODATFB_HALT));
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(BaseVehicleListWindow::vehicle_depot_sell_name[v->type], DEPOT_SELL | DEPOT_DONT_CANCEL, flags == (ODATFB_HALT | ODATFB_SELL)));
|
|
|
|
|
list.emplace_back(new DropDownListStringItem(STR_VEHICLE_LIST_CANCEL_DEPOT_SERVICE, DEPOT_CANCEL, false));
|
|
|
|
|
ShowDropDownList(this, std::move(list), -1, widget, 0, true);
|
|
|
|
|
} else {
|
|
|
|
|
this->HandleButtonClick(WID_VV_GOTO_DEPOT);
|
|
|
|
|
DoCommandP(v->tile, v->index | (_ctrl_pressed ? DEPOT_SERVICE : 0U), 0, GetCmdSendToDepot(v));
|
|
|
|
|