airport_gui.cpp File Reference

The GUI for airports. More...

#include "stdafx.h"
#include "window_gui.h"
#include "station_gui.h"
#include "terraform_gui.h"
#include "sound_func.h"
#include "window_func.h"
#include "strings_func.h"
#include "viewport_func.h"
#include "company_func.h"
#include "tilehighlight_func.h"
#include "company_base.h"
#include "station_type.h"
#include "newgrf_airport.h"
#include "newgrf_callbacks.h"
#include "widgets/dropdown_type.h"
#include "core/geometry_func.hpp"
#include "hotkeys.h"
#include "sprite.h"
#include "table/strings.h"

Go to the source code of this file.

Data Structures

struct  BuildAirToolbarWindow
 Airport build toolbar window handler. More...
class  BuildAirportWindow

Enumerations

enum  AirportToolbarWidgets { ATW_AIRPORT, ATW_DEMOLISH }
 

Widget number of the airport build window.

More...
enum  AirportPickerWidgets {
  BAIRW_CLASS_DROPDOWN, BAIRW_AIRPORT_LIST, BAIRW_SCROLLBAR, BAIRW_LAYOUT_NUM,
  BAIRW_LAYOUT_DECREASE, BAIRW_LAYOUT_INCREASE, BAIRW_AIRPORT_SPRITE, BAIRW_EXTRA_TEXT,
  BAIRW_BOTTOMPANEL, BAIRW_COVERAGE_LABEL, BAIRW_BTN_DONTHILIGHT, BAIRW_BTN_DOHILIGHT
}
 

Airport widgets in the airport picker window.

More...

Functions

static void ShowBuildAirportPicker (Window *parent)
SpriteID GetCustomAirportSprite (const AirportSpec *as, byte layout)
void CcBuildAirport (const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
static void PlaceAirport (TileIndex tile)
 Place an airport.
Window * ShowBuildAirToolbar ()
 Open the build airport toolbar window.
EventState AirportToolbarGlobalHotkeys (uint16 key, uint16 keycode)
void InitializeAirportGui ()

Variables

static AirportClassID _selected_airport_class
 the currently visible airport class
static int _selected_airport_index
 the index of the selected airport in the current class or -1
static byte _selected_airport_layout
 selected airport layout number.
Hotkey< BuildAirToolbarWindow > * _airtoolbar_hotkeys = BuildAirToolbarWindow::airtoolbar_hotkeys
static const NWidgetPart _nested_air_toolbar_widgets []
static const WindowDesc _air_toolbar_desc (WDP_ALIGN_TOOLBAR, 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets))
static const NWidgetPart _nested_build_airport_widgets []
static const WindowDesc _build_airport_desc (WDP_AUTO, 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_airport_widgets, lengthof(_nested_build_airport_widgets))

Detailed Description

The GUI for airports.

Definition in file airport_gui.cpp.


Enumeration Type Documentation

Airport widgets in the airport picker window.

Definition at line 206 of file airport_gui.cpp.

Widget number of the airport build window.

Definition at line 66 of file airport_gui.cpp.


Function Documentation

static void PlaceAirport ( TileIndex  tile  )  [static]

Place an airport.

Parameters:
tile Position to put the new airport.

Definition at line 53 of file airport_gui.cpp.

References _ctrl_pressed, _selected_airport_class, _selected_airport_index, _selected_airport_layout, CMD_BUILD_AIRPORT, CMD_MSG, SB(), ShowSelectStationIfNeeded(), TileHighlightData::size, and TILE_SIZE.

Referenced by BuildAirToolbarWindow::OnPlaceObject().

Window* ShowBuildAirToolbar (  ) 

Open the build airport toolbar window.

If the terraform toolbar is linked to the toolbar, that window is also opened.

Returns:
newly opened airport toolbar, or NULL if the toolbar could not be opened.

Definition at line 188 of file airport_gui.cpp.

References _local_company, DeleteWindowByClass(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and TRANSPORT_AIR.

Referenced by MainToolbarWindow::OnKeyPress().


Variable Documentation

const NWidgetPart _nested_air_toolbar_widgets[] [static]
Initial value:
 {
  NWidget(NWID_HORIZONTAL),
    NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
    NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_TOOLBAR_AIRCRAFT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
    NWidget(WWT_STICKYBOX, COLOUR_DARK_GREEN),
  EndContainer(),
  NWidget(NWID_HORIZONTAL),
    NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, ATW_AIRPORT), SetFill(0, 1), SetMinimalSize(42, 22), SetDataTip(SPR_IMG_AIRPORT, STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP),
    NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetMinimalSize(4, 22), SetFill(1, 1), EndContainer(),
    NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, ATW_DEMOLISH), SetFill(0, 1), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
  EndContainer(),
}

Definition at line 161 of file airport_gui.cpp.


Generated on Fri Feb 4 20:53:51 2011 for OpenTTD by  doxygen 1.6.1