* Draw the details cargo tab for the given vehicle at the given position * * @param item Data to draw * @param left The left most coordinate to draw * @param right The right most coordinate to draw * @param y The y coordinate */
| 208 | * @param y The y coordinate |
| 209 | */ |
| 210 | static void TrainDetailsCargoTab(const CargoSummaryItem *item, int left, int right, int y) |
| 211 | { |
| 212 | std::string str; |
| 213 | if (!IsValidCargoType(item->cargo)) { |
| 214 | str = GetString(STR_QUANTITY_N_A); |
| 215 | } else if (item->amount == 0) { |
| 216 | str = GetString(STR_VEHICLE_DETAILS_CARGO_EMPTY); |
| 217 | } else if (FreightWagonMult(item->cargo) > 1) { |
| 218 | str = GetString(STR_VEHICLE_DETAILS_CARGO_FROM_MULT, item->cargo, item->amount, item->source, _settings_game.vehicle.freight_trains); |
| 219 | } else { |
| 220 | str = GetString(STR_VEHICLE_DETAILS_CARGO_FROM, item->cargo, item->amount, item->source); |
| 221 | } |
| 222 | DrawString(left, right, y, str, TC_LIGHT_BLUE); |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * Draw the details info tab for the given vehicle at the given position |
no test coverage detected