22 #include "table/strings.h" 44 int width =
UnScaleGUI(rect.right - rect.left + 1);
46 int x = rtl ? right - width - x_offs : left - x_offs;
51 if (v->
index == selection) {
71 DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE);
78 StringID str = STR_VEHICLE_DETAILS_CARGO_EMPTY;
83 str = STR_VEHICLE_DETAILS_CARGO_FROM;
StationID Source() const
Returns source of the first cargo packet in this list.
Functions related to OTTD's strings.
VehicleCargoList cargo
The cargo this vehicle is carrying.
Money value
Value of the vehicle.
void DrawShipDetails(const Vehicle *v, int left, int right, int y)
Draw the details for the given vehicle at the given position.
static int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type)
Draws an image of a ship.
static int ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
Functions related to vehicles.
void Draw(int x, int y, PaletteID default_pal, bool force_pal) const
Draw the sprite sequence.
Tindex index
Index of this pool item.
Money FeederShare() const
Returns total sum of the feeder share for all packets.
virtual void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.
PaletteID GetVehiclePalette(const Vehicle *v)
Get the colour map for a vehicle.
EngineImageType
Visualisation contexts of vehicles and engines.
uint StoredCount() const
Returns sum of cargo on board the vehicle (ie not only reserved).
Functions related to the vehicle's GUIs.
Functions, definitions and such used only by the GUI.
uint16 cargo_cap
total capacity
uint32 VehicleID
The type all our vehicle IDs have.
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
Functions related to the gfx engine.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
CargoID cargo_type
type of cargo this vehicle is carrying
int DrawString(int left, int right, int top, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
Sprite sequence for a vehicle part.
Functions to cache sprites in memory.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Draw border only, no background.
Year build_year
Year the vehicle has been built.
Base class for all vehicles.
TextDirection _current_text_dir
Text direction of the currently selected language.
Functions related to zooming.
EngineID engine_type
The type of engine used for this vehicle.
Specification of a rectangle with absolute coordinates of all edges.
Text is written right-to-left by default.
StringID GetCargoSubtypeText(const Vehicle *v)
Get the cargo subtype text from NewGRF for the vehicle details window.
void GetBounds(Rect *bounds) const
Determine shared bounds of all sprites.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.