Go to the documentation of this file.
20 #include "table/strings.h"
35 Money feeder_share = 0;
37 for (
const Aircraft *u = v; u !=
nullptr; u = u->
Next()) {
38 if (u->IsNormalAircraft()) {
42 DrawString(left, right, y, STR_VEHICLE_INFO_BUILT_VALUE);
49 DrawString(left, right, y +
FONT_HEIGHT_NORMAL, (u->Next()->cargo_cap != 0) ? STR_VEHICLE_INFO_CAPACITY_CAPACITY : STR_VEHICLE_INFO_CAPACITY);
52 if (u->cargo_cap != 0) {
53 uint cargo_count = u->cargo.StoredCount();
56 if (cargo_count != 0) {
62 feeder_share += u->cargo.FeederShare();
90 int width =
UnScaleGUI(rect.right - rect.left + 1);
92 int x = rtl ? right - width - x_offs : left - x_offs;
103 GetCustomRotorSprite(a,
true, image_type, &rotor_seq);
104 if (!rotor_seq.
IsValid()) rotor_seq.
Set(SPR_ROTOR_STOPPED);
106 rotor_seq.
Draw(x, y + y_offs - heli_offs, PAL_NONE,
false);
108 if (v->
index == selection) {
110 y +=
UnScaleGUI(rect.top) + y_offs - heli_offs;
T * Next() const
Get next vehicle in the chain.
void Set(SpriteID sprite)
Assign a single sprite to the sequence.
Tindex index
Index of this pool item.
static int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
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.
EngineImageType
Visualisation contexts of vehicles and engines.
void Draw(int x, int y, PaletteID default_pal, bool force_pal) const
Draw the sprite sequence.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
Aircraft, helicopters, rotors and their shadows belong to this class.
bool IsValid() const
Check whether the sequence contains any sprites.
@ VS_CRASHED
Vehicle is crashed.
Sprite sequence for a vehicle part.
void DrawAircraftDetails(const Aircraft *v, int left, int right, int y)
Draw the details for the given vehicle at the given position.
StringID GetCargoSubtypeText(const Vehicle *v)
Get the cargo subtype text from NewGRF for the vehicle details window.
static const PaletteID PALETTE_CRASH
Recolour sprite greying of crashed vehicles.
uint16 cargo_cap
total capacity
static Aircraft * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
PaletteID GetVehiclePalette(const Vehicle *v)
Get the colour map for a vehicle.
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
static int ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
uint32 PaletteID
The number of the palette.
@ AIR_HELICOPTER
an helicopter
uint32 VehicleID
The type all our vehicle IDs have.
byte subtype
subtype (Filled with values from AircraftSubType/DisasterSubType/EffectVehicleType/GroundVehicleSubty...
Specification of a rectangle with absolute coordinates of all edges.
void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type)
Draws an image of an aircraft.
void GetBounds(Rect *bounds) const
Determine shared bounds of all sprites.
@ TD_RTL
Text is written right-to-left by default.
TextDirection _current_text_dir
Text direction of the currently selected language.
@ FR_BORDERONLY
Draw border only, no background.
virtual void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.