OpenTTD Source 20241224-master-gf74b0cf984
|
The GUI for airports. More...
#include "stdafx.h"
#include "economy_func.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 "dropdown_type.h"
#include "dropdown_func.h"
#include "core/geometry_func.hpp"
#include "hotkeys.h"
#include "vehicle_func.h"
#include "gui.h"
#include "command_func.h"
#include "airport_cmd.h"
#include "station_cmd.h"
#include "zoom_func.h"
#include "timer/timer.h"
#include "timer/timer_game_calendar.h"
#include "widgets/airport_widget.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | BuildAirToolbarWindow |
Airport build toolbar window handler. More... | |
class | BuildAirportWindow |
Functions | |
static void | ShowBuildAirportPicker (Window *parent) |
SpriteID | GetCustomAirportSprite (const AirportSpec *as, uint8_t layout) |
void | CcBuildAirport (Commands, const CommandCost &result, TileIndex tile) |
static void | PlaceAirport (TileIndex tile) |
Place an airport. | |
Window * | ShowBuildAirToolbar () |
Open the build airport toolbar window. | |
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 uint8_t | _selected_airport_layout |
selected airport layout number. | |
static constexpr NWidgetPart | _nested_air_toolbar_widgets [] |
static WindowDesc | _air_toolbar_desc (WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, _nested_air_toolbar_widgets, &BuildAirToolbarWindow::hotkeys) |
static constexpr NWidgetPart | _nested_build_airport_widgets [] |
static WindowDesc | _build_airport_desc (WDP_AUTO, nullptr, 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_airport_widgets) |
The GUI for airports.
Definition in file airport_gui.cpp.
void CcBuildAirport | ( | Commands | , |
const CommandCost & | result, | ||
TileIndex | tile | ||
) |
Definition at line 51 of file airport_gui.cpp.
SpriteID GetCustomAirportSprite | ( | const AirportSpec * | as, |
uint8_t | layout | ||
) |
Definition at line 252 of file newgrf_airport.cpp.
void InitializeAirportGui | ( | ) |
Definition at line 632 of file airport_gui.cpp.
|
static |
Place an airport.
tile | Position to put the new airport. |
Definition at line 63 of file airport_gui.cpp.
References _ctrl_pressed, _selected_airport_class, _selected_airport_index, _selected_airport_layout, CommandFlagsToDCFlags(), NewGRFClass< Tspec, Tindex, Tmax >::Get(), NewGRFClass< Tspec, Tindex, Tmax >::GetSpec(), ShowSelectStationIfNeeded(), TileHighlightData::size, and TILE_SIZE.
Referenced by BuildAirToolbarWindow::OnPlaceObject().
|
static |
Definition at line 627 of file airport_gui.cpp.
Window * ShowBuildAirToolbar | ( | ) |
Open the build airport toolbar window.
If the terraform toolbar is linked to the toolbar, that window is also opened.
Definition at line 226 of file airport_gui.cpp.
References _local_company, CloseWindowByClass(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), TRANSPORT_AIR, and WC_BUILD_TOOLBAR.
Referenced by BuildAirToolbarWindow::AirportToolbarGlobalHotkeys(), MenuClickBuildAir(), and MainToolbarWindow::OnHotkey().
|
staticconstexpr |
Definition at line 198 of file airport_gui.cpp.
|
staticconstexpr |
Definition at line 583 of file airport_gui.cpp.
|
static |
the currently visible airport class
Definition at line 43 of file airport_gui.cpp.
Referenced by BuildAirportWindow::DrawWidget(), BuildAirportWindow::OnClick(), BuildAirportWindow::OnDropdownSelect(), BuildAirportWindow::OnPaint(), PlaceAirport(), BuildAirportWindow::SelectFirstAvailableAirport(), and BuildAirportWindow::SetStringParameters().
|
static |
the index of the selected airport in the current class or -1
Definition at line 44 of file airport_gui.cpp.
Referenced by BuildAirportWindow::DrawWidget(), BuildAirportWindow::OnPaint(), PlaceAirport(), and BuildAirportWindow::SetStringParameters().
|
static |
selected airport layout number.
Definition at line 45 of file airport_gui.cpp.
Referenced by BuildAirportWindow::DrawWidget(), BuildAirportWindow::OnClick(), PlaceAirport(), and BuildAirportWindow::SetStringParameters().