* Draw the details for the given vehicle at the given position * * @param v current vehicle * @param r the Rect to draw within */
| 60 | * @param r the Rect to draw within |
| 61 | */ |
| 62 | void DrawShipDetails(const Vehicle *v, const Rect &r) |
| 63 | { |
| 64 | int y = r.top; |
| 65 | |
| 66 | DrawString(r.left, r.right, y, GetString(STR_VEHICLE_INFO_BUILT_VALUE, PackEngineNameDParam(v->engine_type, EngineNameContext::VehicleDetails), v->build_year, v->value)); |
| 67 | y += GetCharacterHeight(FS_NORMAL); |
| 68 | |
| 69 | DrawString(r.left, r.right, y, GetString(STR_VEHICLE_INFO_CAPACITY, v->cargo_type, v->cargo_cap, GetCargoSubtypeText(v))); |
| 70 | y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal; |
| 71 | |
| 72 | if (v->cargo.StoredCount() > 0) { |
| 73 | DrawString(r.left, r.right, y, GetString(STR_VEHICLE_DETAILS_CARGO_FROM, v->cargo_type, v->cargo.StoredCount(), v->cargo.GetFirstStation())); |
| 74 | } else { |
| 75 | DrawString(r.left, r.right, y, STR_VEHICLE_DETAILS_CARGO_EMPTY); |
| 76 | } |
| 77 | y += GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal; |
| 78 | |
| 79 | /* Draw Transfer credits text */ |
| 80 | DrawString(r.left, r.right, y, GetString(STR_VEHICLE_INFO_FEEDER_CARGO_VALUE, v->cargo.GetFeederShare())); |
| 81 | } |
no test coverage detected