1
0
Fork 0

Fix: Missing error messages with sell- and autoreplace-all commands. (#13469)

If these commands failed then then the error message part was blank.
pull/13470/head
Peter Nelson 2025-02-04 22:30:42 +00:00 committed by GitHub
parent 603630c1ae
commit ffb5e71a28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 2 deletions

View File

@ -839,7 +839,7 @@ struct DepotWindow : Window {
break;
case WID_D_AUTOREPLACE:
Command<CMD_DEPOT_MASS_AUTOREPLACE>::Post(TileIndex(this->window_number), this->type);
Command<CMD_DEPOT_MASS_AUTOREPLACE>::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<CMD_DEPOT_SELL_ALL_VEHICLES>::Post(tile, vehtype);
Command<CMD_DEPOT_SELL_ALL_VEHICLES>::Post(GetCmdSellAllVehMsg(vehtype), tile, vehtype);
}
}

View File

@ -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...

View File

@ -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,

View File

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