20 #include "table/strings.h"
42 int x = rtl ? r.right - width - x_offs : r.left - x_offs;
49 if (v->
index == selection) {
70 DrawString(r.left, r.right, y, STR_VEHICLE_INFO_BUILT_VALUE);
76 DrawString(r.left, r.right, y, STR_VEHICLE_INFO_CAPACITY);
79 StringID str = STR_VEHICLE_DETAILS_CARGO_EMPTY;
84 str = STR_VEHICLE_DETAILS_CARGO_FROM;
91 DrawString(r.left, r.right, y, STR_VEHICLE_INFO_FEEDER_CARGO_VALUE);
Money GetFeederShare() const
Returns total sum of the feeder share for all packets.
StationID GetFirstStation() const
Returns the first station of the first cargo packet in this list.
uint StoredCount() const
Returns sum of cargo on board the vehicle (ie not only reserved).
uint64_t PackEngineNameDParam(EngineID engine_id, EngineNameContext context, uint32_t extra_data=0)
Combine an engine ID and a name context to an engine name dparam.
@ VehicleDetails
Name is shown in the vehicle details GUI.
int GetCharacterHeight(FontSize size)
Get height of a character for a given font size.
int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
Functions related to the gfx engine.
int CenterBounds(int min, int max, int size)
Determine where to draw a centred object inside a widget.
@ FS_NORMAL
Index of the normal font in the font tables.
A number of safeguards to prevent using unsafe methods.
void DrawShipDetails(const Vehicle *v, const Rect &r)
Draw the details for the given vehicle at the given position.
void DrawShipImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type)
Draws an image of a ship.
Functions to cache sprites in memory.
Definition of base types and functions in a cross-platform compatible way.
void SetDParam(size_t n, uint64_t v)
Set a string parameter v at index n in the global string parameter array.
TextDirection _current_text_dir
Text direction of the currently selected language.
Functions related to OTTD's strings.
@ TD_RTL
Text is written right-to-left by default.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Tindex index
Index of this pool item.
Specification of a rectangle with absolute coordinates of all edges.
int Width() const
Get width of Rect.
int Height() const
Get height of Rect.
Rect Expand(int s) const
Copy and expand Rect by s pixels.
Sprite sequence for a vehicle part.
void GetBounds(Rect *bounds) const
Determine shared bounds of all sprites.
void Draw(int x, int y, PaletteID default_pal, bool force_pal) const
Draw the sprite sequence.
EngineID engine_type
The type of engine used for this vehicle.
VehicleCargoList cargo
The cargo this vehicle is carrying.
uint16_t cargo_cap
total capacity
virtual void GetImage([[maybe_unused]] Direction direction, [[maybe_unused]] EngineImageType image_type, [[maybe_unused]] VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.
CargoID cargo_type
type of cargo this vehicle is carrying
Money value
Value of the vehicle.
TimerGameCalendar::Year build_year
Year the vehicle has been built.
PaletteID GetVehiclePalette(const Vehicle *v)
Get the colour map for a vehicle.
Base class for all vehicles.
Functions related to vehicles.
StringID GetCargoSubtypeText(const Vehicle *v)
Get the cargo subtype text from NewGRF for the vehicle details window.
void DrawCargoIconOverlay(int x, int y, CargoID cid)
Draw a cargo icon overlaying an existing sprite, with a black contrast outline.
Functions related to the vehicle's GUIs.
EngineImageType
Visualisation contexts of vehicles and engines.
uint32_t VehicleID
The type all our vehicle IDs have.
Functions, definitions and such used only by the GUI.
@ FR_BORDERONLY
Draw border only, no background.
Functions related to zooming.
int ScaleSpriteTrad(int value)
Scale traditional pixel dimensions to GUI zoom level, for drawing sprites.
int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.