diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 4cb1acb7a7..3c819ee3eb 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -839,7 +839,7 @@ struct DepotWindow : Window { break; case WID_D_AUTOREPLACE: - Command::Post(TileIndex(this->window_number), this->type); + Command::Post(GetCmdAutoreplaceVehMsg(this->type), TileIndex(this->window_number), this->type); break; } @@ -1152,7 +1152,7 @@ static void DepotSellAllConfirmationCallback(Window *win, bool confirmed) DepotWindow *w = (DepotWindow*)win; TileIndex tile(w->window_number); VehicleType vehtype = w->type; - Command::Post(tile, vehtype); + Command::Post(GetCmdSellAllVehMsg(vehtype), tile, vehtype); } } diff --git a/src/lang/english.txt b/src/lang/english.txt index f2c16f0720..13a62887b6 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5319,6 +5319,18 @@ STR_ERROR_CAN_T_SELL_ROAD_VEHICLE :{WHITE}Can't se STR_ERROR_CAN_T_SELL_SHIP :{WHITE}Can't sell ship... STR_ERROR_CAN_T_SELL_AIRCRAFT :{WHITE}Can't sell aircraft... +###length VEHICLE_TYPES +STR_ERROR_CAN_T_SELL_ALL_TRAIN :{WHITE}Can't sell all railway vehicles... +STR_ERROR_CAN_T_SELL_ALL_ROAD_VEHICLE :{WHITE}Can't sell all road vehicles... +STR_ERROR_CAN_T_SELL_ALL_SHIP :{WHITE}Can't sell all ship... +STR_ERROR_CAN_T_SELL_ALL_AIRCRAFT :{WHITE}Can't sell all aircrafts... + +###length VEHICLE_TYPES +STR_ERROR_CAN_T_AUTOREPLACE_TRAIN :{WHITE}Can't autoreplace railway vehicles... +STR_ERROR_CAN_T_AUTOREPLACE_ROAD_VEHICLE :{WHITE}Can't autoreplace road vehicles... +STR_ERROR_CAN_T_AUTOREPLACE_SHIP :{WHITE}Can't autoreplace ships... +STR_ERROR_CAN_T_AUTOREPLACE_AIRCRAFT :{WHITE}Can't autoreplace aircraft... + STR_ERROR_TOO_MANY_VEHICLES_IN_GAME :{WHITE}Too many vehicles in game STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't change servicing interval... diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index b13ceaf6ea..ee4b731cbd 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -59,6 +59,20 @@ const StringID _veh_sell_msg_table[] = { STR_ERROR_CAN_T_SELL_AIRCRAFT, }; +const StringID _veh_sell_all_msg_table[] = { + STR_ERROR_CAN_T_SELL_ALL_TRAIN, + STR_ERROR_CAN_T_SELL_ALL_ROAD_VEHICLE, + STR_ERROR_CAN_T_SELL_ALL_SHIP, + STR_ERROR_CAN_T_SELL_ALL_AIRCRAFT, +}; + +const StringID _veh_autoreplace_msg_table[] = { + STR_ERROR_CAN_T_AUTOREPLACE_TRAIN, + STR_ERROR_CAN_T_AUTOREPLACE_ROAD_VEHICLE, + STR_ERROR_CAN_T_AUTOREPLACE_SHIP, + STR_ERROR_CAN_T_AUTOREPLACE_AIRCRAFT, +}; + const StringID _veh_refit_msg_table[] = { STR_ERROR_CAN_T_REFIT_TRAIN, STR_ERROR_CAN_T_REFIT_ROAD_VEHICLE, diff --git a/src/vehicle_func.h b/src/vehicle_func.h index 25c1027c6e..e5207e969e 100644 --- a/src/vehicle_func.h +++ b/src/vehicle_func.h @@ -111,6 +111,8 @@ SpriteID GetVehiclePalette(const Vehicle *v); extern const StringID _veh_build_msg_table[]; extern const StringID _veh_sell_msg_table[]; +extern const StringID _veh_sell_all_msg_table[]; +extern const StringID _veh_autoreplace_msg_table[]; extern const StringID _veh_refit_msg_table[]; extern const StringID _send_to_depot_msg_table[]; @@ -135,6 +137,16 @@ inline StringID GetCmdSellVehMsg(const BaseVehicle *v) return GetCmdSellVehMsg(v->type); } +inline StringID GetCmdSellAllVehMsg(VehicleType type) +{ + return _veh_sell_all_msg_table[type]; +} + +inline StringID GetCmdAutoreplaceVehMsg(VehicleType type) +{ + return _veh_autoreplace_msg_table[type]; +} + inline StringID GetCmdRefitVehMsg(VehicleType type) { return _veh_refit_msg_table[type];