22 #include "table/strings.h" 37 Money feeder_share = 0;
40 if (u->IsNormalAircraft()) {
44 DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE);
51 DrawString(left, right, y +
FONT_HEIGHT_NORMAL, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY);
54 if (u->cargo_cap != 0) {
55 uint cargo_count = u->cargo.StoredCount();
58 if (cargo_count != 0) {
64 feeder_share += u->cargo.FeederShare();
92 int width =
UnScaleGUI(rect.right - rect.left + 1);
94 int x = rtl ? right - width - x_offs : left - x_offs;
105 GetCustomRotorSprite(a,
true, image_type, &rotor_seq);
106 if (!rotor_seq.
IsValid()) rotor_seq.
Set(SPR_ROTOR_STOPPED);
108 rotor_seq.
Draw(x, y + y_offs - heli_offs, PAL_NONE,
false);
110 if (v->
index == selection) {
112 y +=
UnScaleGUI(rect.top) + y_offs - heli_offs;
Functions related to OTTD's strings.
uint32 PaletteID
The number of the palette.
Functions for NewGRF engines.
static int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
static int ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
Functions related to vehicles.
Aircraft, helicopters, rotors and their shadows belong to this class.
void Draw(int x, int y, PaletteID default_pal, bool force_pal) const
Draw the sprite sequence.
void Set(SpriteID sprite)
Assign a single sprite to the sequence.
Tindex index
Index of this pool item.
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.
static Aircraft * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
Functions related to the vehicle's GUIs.
Functions, definitions and such used only by the GUI.
void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type)
Draws an image of an aircraft.
byte subtype
subtype (Filled with values from #EffectVehicles/#TrainSubTypes/#AircraftSubTypes) ...
uint16 cargo_cap
total capacity
bool IsValid() const
Check whether the sequence contains any sprites.
uint32 VehicleID
The type all our vehicle IDs have.
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
T * Next() const
Get next vehicle in the chain.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
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.
Draw border only, no background.
static const PaletteID PALETTE_CRASH
Recolour sprite greying of crashed vehicles.
void DrawAircraftDetails(const Aircraft *v, int left, int right, int y)
Draw the details for the given vehicle at the given position.
TextDirection _current_text_dir
Text direction of the currently selected language.
Functions related to zooming.
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.