# aircraft_gui.cpp File Reference

The GUI of aircraft. More...

`#include "stdafx.h"`
`#include "aircraft.h"`
`#include "vehicle_gui.h"`
`#include "newgrf_engine.h"`
`#include "strings_func.h"`
`#include "vehicle_func.h"`
`#include "gfx_func.h"`
`#include "window_gui.h"`
`#include "spritecache.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Functions

void | DrawAircraftDetails (const Aircraft *v, int left, int right, int y)
| Draw the details for the given vehicle at the given position.
void | DrawAircraftImage (const Vehicle *v, int left, int right, int y, VehicleID selection)
| Draws an image of an aircraft.
void | CcBuildAircraft (bool success, TileIndex tile, uint32 p1, uint32 p2)
| This is the Callback method after the construction attempt of an aircraft.

## Detailed Description

The GUI of aircraft.

Definition in file aircraft_gui.cpp.

## Function Documentation

void CcBuildAircraft | ( | bool | success,
|  | TileIndex | tile,
|  | uint32 | p1,
|  | uint32 | p2 |
| ) |  |  |

This is the Callback method after the construction attempt of an aircraft.

Parameters:

  | success | indicates completion (or not) of the operation
  | tile | of depot where aircraft is built
  | p1 | unused
  | p2 | unused

Definition at line 113 of file aircraft_gui.cpp.

References RestoreVehicleOrders(), and ShowVehicleViewWindow().

void DrawAircraftDetails | ( | const Aircraft * | v,
|  | int | left,
|  | int | right,
|  | int | y |
| ) |  |  |

Draw the details for the given vehicle at the given position.

Parameters:

  | v | current vehicle
  | left | The left most coordinate to draw
  | right | The right most coordinate to draw
  | y | The y coordinate

Definition at line 33 of file aircraft_gui.cpp.

References DrawString(), FONT_HEIGHT_NORMAL, GetCargoSubtypeText(), SpecializedVehicle< T, Type >::Next(), SA_LEFT, SA_STRIP, and SetDParam().

Referenced by VehicleDetailsWindow::DrawVehicleDetails().

void DrawAircraftImage | ( | const Vehicle * | v,
|  | int | left,
|  | int | right,
|  | int | y,
|  | VehicleID | selection |
| ) |  |  |

Draws an image of an aircraft.

Parameters:

  | v | Front vehicle
  | left | The minimum horizontal position
  | right | The maximum horizontal position
  | y | Vertical position to draw at
  | selection | Selected vehicle to draw a frame around

Definition at line 81 of file aircraft_gui.cpp.

References _dynlang, AIR_HELICOPTER, DIR_E, DIR_W, DrawFrameRect(), DrawSprite(), FR_BORDERONLY, SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), GetVehiclePalette(), Sprite::height, ST_NORMAL, TD_RTL, DynamicLanguages::text_dir, Sprite::width, Sprite::x_offs, and Sprite::y_offs.

Referenced by DrawVehicleImage().