MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / TrainDetailsInfoTab

Function TrainDetailsInfoTab

src/train_gui.cpp:233–242  ·  view source on GitHub ↗

* Draw the details info tab for the given vehicle at the given position * * @param v current vehicle * @param left The left most coordinate to draw * @param right The right most coordinate to draw * @param y The y coordinate */

Source from the content-addressed store, hash-verified

231 * @param y The y coordinate
232 */
233static void TrainDetailsInfoTab(const Vehicle *v, int left, int right, int y)
234{
235 std::string str;
236 if (RailVehInfo(v->engine_type)->railveh_type == RAILVEH_WAGON) {
237 str = GetString(STR_VEHICLE_DETAILS_TRAIN_WAGON_VALUE, PackEngineNameDParam(v->engine_type, EngineNameContext::VehicleDetails), v->value);
238 } else {
239 str = GetString(STR_VEHICLE_DETAILS_TRAIN_ENGINE_BUILT_AND_VALUE, PackEngineNameDParam(v->engine_type, EngineNameContext::VehicleDetails), v->build_year, v->value);
240 }
241 DrawString(left, right, y, str);
242}
243
244/**
245 * Draw the details capacity tab for the given vehicle at the given position

Callers 1

DrawTrainDetailsFunction · 0.85

Calls 4

RailVehInfoFunction · 0.85
PackEngineNameDParamFunction · 0.85
GetStringFunction · 0.70
DrawStringFunction · 0.70

Tested by

no test coverage detected