2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file airport_gui.cpp The GUI for airports. */
|
2007-02-23 01:48:53 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#include "stdafx.h"
|
2007-12-19 20:45:46 +00:00
|
|
|
#include "window_gui.h"
|
|
|
|
#include "station_gui.h"
|
2008-01-06 18:56:43 +00:00
|
|
|
#include "terraform_gui.h"
|
2007-12-29 09:24:26 +00:00
|
|
|
#include "sound_func.h"
|
2007-12-25 11:26:07 +00:00
|
|
|
#include "window_func.h"
|
2008-05-24 02:54:47 +00:00
|
|
|
#include "strings_func.h"
|
2008-01-09 09:45:45 +00:00
|
|
|
#include "viewport_func.h"
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_func.h"
|
2008-05-07 13:10:15 +00:00
|
|
|
#include "tilehighlight_func.h"
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_base.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "station_type.h"
|
2010-02-22 16:09:26 +00:00
|
|
|
#include "newgrf_airport.h"
|
2010-08-05 12:05:15 +00:00
|
|
|
#include "newgrf_callbacks.h"
|
2010-03-05 23:21:56 +00:00
|
|
|
#include "widgets/dropdown_type.h"
|
|
|
|
#include "core/geometry_func.hpp"
|
2010-07-03 18:10:18 +00:00
|
|
|
#include "hotkeys.h"
|
2011-08-04 17:13:24 +00:00
|
|
|
#include "vehicle_func.h"
|
2010-08-05 17:16:31 +00:00
|
|
|
#include "sprite.h"
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-01-13 01:21:35 +00:00
|
|
|
#include "table/strings.h"
|
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
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
|
2010-08-05 11:59:07 +00:00
|
|
|
static byte _selected_airport_layout; ///< selected airport layout number.
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-05-24 11:19:30 +00:00
|
|
|
static void ShowBuildAirportPicker(Window *parent);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2010-08-05 12:03:34 +00:00
|
|
|
SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2010-01-11 18:46:09 +00:00
|
|
|
void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-01-11 18:46:09 +00:00
|
|
|
if (result.Failed()) return;
|
|
|
|
|
|
|
|
SndPlayTileFx(SND_1F_SPLAT, tile);
|
|
|
|
if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2010-12-21 16:27:50 +00:00
|
|
|
/**
|
|
|
|
* Place an airport.
|
|
|
|
* @param tile Position to put the new airport.
|
|
|
|
*/
|
2005-06-24 12:38:35 +00:00
|
|
|
static void PlaceAirport(TileIndex tile)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-03-05 23:21:56 +00:00
|
|
|
if (_selected_airport_index == -1) return;
|
2009-01-08 16:35:45 +00:00
|
|
|
uint32 p2 = _ctrl_pressed;
|
|
|
|
SB(p2, 16, 16, INVALID_STATION); // no station to join
|
|
|
|
|
2010-08-07 22:08:20 +00:00
|
|
|
uint32 p1 = AirportClass::Get(_selected_airport_class, _selected_airport_index)->GetIndex();
|
2010-08-05 11:59:07 +00:00
|
|
|
p1 |= _selected_airport_layout << 8;
|
2010-03-05 23:21:56 +00:00
|
|
|
CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_AIRPORT | CMD_MSG(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport, "" };
|
2009-07-26 21:07:03 +00:00
|
|
|
ShowSelectStationIfNeeded(cmdcont, TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE));
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2009-05-31 19:51:49 +00:00
|
|
|
/** Widget number of the airport build window. */
|
2010-05-13 10:14:29 +00:00
|
|
|
enum AirportToolbarWidgets {
|
2009-05-31 19:51:49 +00:00
|
|
|
ATW_AIRPORT,
|
2009-08-02 21:04:15 +00:00
|
|
|
ATW_DEMOLISH,
|
2006-11-22 16:08:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-12-21 16:26:34 +00:00
|
|
|
/** Airport build toolbar window handler. */
|
2008-05-18 21:34:35 +00:00
|
|
|
struct BuildAirToolbarWindow : Window {
|
2010-12-21 16:26:34 +00:00
|
|
|
int last_user_action; // Last started user action.
|
|
|
|
|
2009-08-02 21:04:15 +00:00
|
|
|
BuildAirToolbarWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
|
2008-05-18 21:34:35 +00:00
|
|
|
{
|
2009-08-02 21:04:15 +00:00
|
|
|
this->InitNested(desc, window_number);
|
2008-05-29 15:13:28 +00:00
|
|
|
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
|
2010-12-21 16:26:34 +00:00
|
|
|
this->last_user_action = WIDGET_LIST_END;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2008-05-18 21:34:35 +00:00
|
|
|
|
|
|
|
~BuildAirToolbarWindow()
|
|
|
|
{
|
2009-01-02 21:01:27 +00:00
|
|
|
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
|
2008-05-18 21:34:35 +00:00
|
|
|
}
|
|
|
|
|
2010-01-30 18:34:48 +00:00
|
|
|
virtual void OnClick(Point pt, int widget, int click_count)
|
2008-05-18 21:34:35 +00:00
|
|
|
{
|
2010-12-21 16:26:34 +00:00
|
|
|
switch (widget) {
|
|
|
|
case ATW_AIRPORT:
|
2010-12-24 15:08:19 +00:00
|
|
|
if (HandlePlacePushButton(this, ATW_AIRPORT, SPR_CURSOR_AIRPORT, HT_RECT)) {
|
2010-12-21 16:26:34 +00:00
|
|
|
ShowBuildAirportPicker(this);
|
|
|
|
this->last_user_action = widget;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATW_DEMOLISH:
|
2010-12-24 15:08:19 +00:00
|
|
|
HandlePlacePushButton(this, ATW_DEMOLISH, ANIMCURSOR_DEMOLISH, HT_RECT | HT_DIAGONAL);
|
2010-12-21 16:26:34 +00:00
|
|
|
this->last_user_action = widget;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: break;
|
|
|
|
}
|
2008-05-18 21:34:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
|
|
|
{
|
2010-07-03 18:10:18 +00:00
|
|
|
int num = CheckHotkeyMatch(airtoolbar_hotkeys, keycode, this);
|
|
|
|
if (num == -1) return ES_NOT_HANDLED;
|
|
|
|
this->OnClick(Point(), num, 1);
|
2008-05-18 21:34:35 +00:00
|
|
|
return ES_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
|
|
|
{
|
2010-12-21 16:27:50 +00:00
|
|
|
switch (this->last_user_action) {
|
|
|
|
case ATW_AIRPORT:
|
|
|
|
PlaceAirport(tile);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATW_DEMOLISH:
|
|
|
|
PlaceProc_DemolishArea(tile);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: NOT_REACHED();
|
|
|
|
}
|
2008-05-18 21:34:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
|
|
|
|
{
|
|
|
|
VpSelectTilesWithMethod(pt.x, pt.y, select_method);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile)
|
|
|
|
{
|
|
|
|
if (pt.x != -1 && select_proc == DDSP_DEMOLISH_AREA) {
|
|
|
|
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnPlaceObjectAbort()
|
|
|
|
{
|
|
|
|
this->RaiseButtons();
|
|
|
|
|
2009-07-21 22:25:21 +00:00
|
|
|
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_AIR);
|
2009-02-08 16:00:57 +00:00
|
|
|
DeleteWindowById(WC_SELECT_STATION, 0);
|
2008-05-18 21:34:35 +00:00
|
|
|
}
|
2010-07-03 18:10:18 +00:00
|
|
|
|
|
|
|
static Hotkey<BuildAirToolbarWindow> airtoolbar_hotkeys[];
|
|
|
|
};
|
|
|
|
|
|
|
|
Hotkey<BuildAirToolbarWindow> BuildAirToolbarWindow::airtoolbar_hotkeys[] = {
|
|
|
|
Hotkey<BuildAirToolbarWindow>('1', "airport", ATW_AIRPORT),
|
|
|
|
Hotkey<BuildAirToolbarWindow>('2', "demolish", ATW_DEMOLISH),
|
|
|
|
HOTKEY_LIST_END(BuildAirToolbarWindow)
|
2008-05-18 21:34:35 +00:00
|
|
|
};
|
2010-07-03 18:10:18 +00:00
|
|
|
Hotkey<BuildAirToolbarWindow> *_airtoolbar_hotkeys = BuildAirToolbarWindow::airtoolbar_hotkeys;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-03-22 21:16:57 +00:00
|
|
|
static const NWidgetPart _nested_air_toolbar_widgets[] = {
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
2009-11-24 18:05:55 +00:00
|
|
|
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),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
2009-11-22 18:26:01 +00:00
|
|
|
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, ATW_AIRPORT), SetFill(0, 1), SetMinimalSize(42, 22), SetDataTip(SPR_IMG_AIRPORT, STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP),
|
2009-11-24 21:13:36 +00:00
|
|
|
NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetMinimalSize(4, 22), SetFill(1, 1), EndContainer(),
|
2009-11-22 18:26:01 +00:00
|
|
|
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, ATW_DEMOLISH), SetFill(0, 1), SetMinimalSize(22, 22), SetDataTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
|
|
|
};
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-03-15 15:12:06 +00:00
|
|
|
static const WindowDesc _air_toolbar_desc(
|
2009-11-28 15:01:49 +00:00
|
|
|
WDP_ALIGN_TOOLBAR, 0, 0,
|
2007-02-01 15:49:12 +00:00
|
|
|
WC_BUILD_TOOLBAR, WC_NONE,
|
2009-11-24 17:28:29 +00:00
|
|
|
WDF_CONSTRUCTION,
|
2009-11-15 10:26:01 +00:00
|
|
|
_nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets)
|
2009-03-15 15:12:06 +00:00
|
|
|
);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2010-07-04 09:27:15 +00:00
|
|
|
/**
|
|
|
|
* Open the build airport toolbar window
|
|
|
|
*
|
|
|
|
* If the terraform toolbar is linked to the toolbar, that window is also opened.
|
|
|
|
*
|
|
|
|
* @return newly opened airport toolbar, or NULL if the toolbar could not be opened.
|
|
|
|
*/
|
|
|
|
Window *ShowBuildAirToolbar()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-07-04 09:27:15 +00:00
|
|
|
if (!Company::IsValidID(_local_company)) return NULL;
|
2006-10-31 21:15:56 +00:00
|
|
|
|
2008-05-04 09:39:16 +00:00
|
|
|
DeleteWindowByClass(WC_BUILD_TOOLBAR);
|
2010-07-04 09:27:15 +00:00
|
|
|
return AllocateWindowDescFront<BuildAirToolbarWindow>(&_air_toolbar_desc, TRANSPORT_AIR);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2010-07-03 21:43:44 +00:00
|
|
|
EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
|
|
|
{
|
2011-08-04 17:22:18 +00:00
|
|
|
if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED;
|
2010-07-03 21:43:44 +00:00
|
|
|
int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true);
|
|
|
|
if (num == -1) return ES_NOT_HANDLED;
|
2010-07-04 09:27:15 +00:00
|
|
|
Window *w = ShowBuildAirToolbar();
|
|
|
|
if (w == NULL) return ES_NOT_HANDLED;
|
2010-07-03 21:43:44 +00:00
|
|
|
return w->OnKeyPress(key, keycode);
|
|
|
|
}
|
|
|
|
|
2009-03-22 21:16:57 +00:00
|
|
|
/** Airport widgets in the airport picker window. */
|
|
|
|
enum AirportPickerWidgets {
|
2010-03-05 23:21:56 +00:00
|
|
|
BAIRW_CLASS_DROPDOWN,
|
|
|
|
BAIRW_AIRPORT_LIST,
|
|
|
|
BAIRW_SCROLLBAR,
|
2010-08-05 11:59:07 +00:00
|
|
|
BAIRW_LAYOUT_NUM,
|
|
|
|
BAIRW_LAYOUT_DECREASE,
|
|
|
|
BAIRW_LAYOUT_INCREASE,
|
2010-08-05 12:03:34 +00:00
|
|
|
BAIRW_AIRPORT_SPRITE,
|
2010-08-05 12:05:15 +00:00
|
|
|
BAIRW_EXTRA_TEXT,
|
2010-03-05 23:21:56 +00:00
|
|
|
BAIRW_BOTTOMPANEL,
|
|
|
|
BAIRW_COVERAGE_LABEL,
|
|
|
|
BAIRW_BTN_DONTHILIGHT,
|
|
|
|
BAIRW_BTN_DOHILIGHT,
|
2009-03-22 21:16:57 +00:00
|
|
|
};
|
2008-05-17 03:31:22 +00:00
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
class BuildAirportWindow : public PickerWindowBase {
|
2010-08-05 12:03:34 +00:00
|
|
|
SpriteID preview_sprite; ///< Cached airport preview sprite.
|
2010-03-05 23:21:56 +00:00
|
|
|
int line_height;
|
2010-08-12 08:37:01 +00:00
|
|
|
Scrollbar *vscroll;
|
2010-03-05 23:21:56 +00:00
|
|
|
|
|
|
|
/** Build a dropdown list of available airport classes */
|
|
|
|
static DropDownList *BuildAirportClassDropDown()
|
|
|
|
{
|
|
|
|
DropDownList *list = new DropDownList();
|
|
|
|
|
2010-08-07 22:08:20 +00:00
|
|
|
for (uint i = 0; i < AirportClass::GetCount(); i++) {
|
|
|
|
list->push_back(new DropDownListStringItem(AirportClass::GetName((AirportClassID)i), i, false));
|
2010-03-05 23:21:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2008-05-17 03:31:22 +00:00
|
|
|
public:
|
2010-03-05 23:21:56 +00:00
|
|
|
BuildAirportWindow(const WindowDesc *desc, Window *parent) : PickerWindowBase(parent)
|
2008-05-17 03:31:22 +00:00
|
|
|
{
|
2010-08-12 08:37:01 +00:00
|
|
|
this->CreateNestedTree(desc);
|
|
|
|
|
|
|
|
this->vscroll = this->GetScrollbar(BAIRW_SCROLLBAR);
|
|
|
|
this->vscroll->SetCapacity(5);
|
|
|
|
this->vscroll->SetPosition(0);
|
|
|
|
|
|
|
|
this->FinishInitNested(desc, TRANSPORT_AIR);
|
2010-03-05 23:21:56 +00:00
|
|
|
|
|
|
|
this->SetWidgetLoweredState(BAIRW_BTN_DONTHILIGHT, !_settings_client.gui.station_show_coverage);
|
|
|
|
this->SetWidgetLoweredState(BAIRW_BTN_DOHILIGHT, _settings_client.gui.station_show_coverage);
|
2009-07-05 16:50:56 +00:00
|
|
|
this->OnInvalidateData();
|
2010-03-05 23:21:56 +00:00
|
|
|
|
2010-08-12 08:37:01 +00:00
|
|
|
this->vscroll->SetCount(AirportClass::GetCount(_selected_airport_class));
|
2010-03-05 23:21:56 +00:00
|
|
|
this->SelectFirstAvailableAirport(true);
|
2008-05-17 03:31:22 +00:00
|
|
|
}
|
2008-04-10 02:14:14 +00:00
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
virtual ~BuildAirportWindow()
|
2009-01-08 16:35:45 +00:00
|
|
|
{
|
|
|
|
DeleteWindowById(WC_SELECT_STATION, 0);
|
|
|
|
}
|
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
virtual void SetStringParameters(int widget) const
|
|
|
|
{
|
2010-08-05 11:59:07 +00:00
|
|
|
switch (widget) {
|
|
|
|
case BAIRW_CLASS_DROPDOWN:
|
2010-08-07 22:08:20 +00:00
|
|
|
SetDParam(0, AirportClass::GetName(_selected_airport_class));
|
2010-08-05 11:59:07 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BAIRW_LAYOUT_NUM:
|
2010-08-05 17:24:45 +00:00
|
|
|
SetDParam(0, STR_EMPTY);
|
2010-08-05 12:05:56 +00:00
|
|
|
if (_selected_airport_index != -1) {
|
2010-08-07 22:08:20 +00:00
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, _selected_airport_index);
|
2010-08-05 12:05:56 +00:00
|
|
|
StringID string = GetAirportTextCallback(as, _selected_airport_layout, CBID_AIRPORT_LAYOUT_NAME);
|
2010-08-05 17:24:45 +00:00
|
|
|
if (string != STR_UNDEFINED) {
|
|
|
|
SetDParam(0, string);
|
|
|
|
} else if (as->num_table > 1) {
|
|
|
|
SetDParam(0, STR_STATION_BUILD_AIRPORT_LAYOUT_NAME);
|
|
|
|
SetDParam(1, _selected_airport_layout + 1);
|
|
|
|
}
|
2010-08-05 12:05:56 +00:00
|
|
|
}
|
2010-08-05 11:59:07 +00:00
|
|
|
break;
|
2010-03-05 23:21:56 +00:00
|
|
|
|
2010-08-05 11:59:07 +00:00
|
|
|
default: break;
|
|
|
|
}
|
2010-03-05 23:21:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
|
|
|
{
|
|
|
|
switch (widget) {
|
|
|
|
case BAIRW_CLASS_DROPDOWN: {
|
|
|
|
Dimension d = {0, 0};
|
2010-08-07 22:08:20 +00:00
|
|
|
for (uint i = 0; i < AirportClass::GetCount(); i++) {
|
|
|
|
SetDParam(0, AirportClass::GetName((AirportClassID)i));
|
2010-03-05 23:21:56 +00:00
|
|
|
d = maxdim(d, GetStringBoundingBox(STR_BLACK_STRING));
|
|
|
|
}
|
|
|
|
d.width += padding.width;
|
|
|
|
d.height += padding.height;
|
|
|
|
*size = maxdim(*size, d);
|
2010-08-01 18:53:30 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-03-05 23:21:56 +00:00
|
|
|
|
|
|
|
case BAIRW_AIRPORT_LIST: {
|
|
|
|
for (int i = 0; i < NUM_AIRPORTS; i++) {
|
|
|
|
const AirportSpec *as = AirportSpec::Get(i);
|
|
|
|
if (!as->enabled) continue;
|
|
|
|
|
|
|
|
size->width = max(size->width, GetStringBoundingBox(as->name).width);
|
|
|
|
}
|
|
|
|
|
|
|
|
this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
|
2010-08-12 08:37:01 +00:00
|
|
|
size->height = this->vscroll->GetCapacity() * this->line_height;
|
2010-08-01 18:53:30 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-03-05 23:21:56 +00:00
|
|
|
|
2010-08-05 12:03:34 +00:00
|
|
|
case BAIRW_AIRPORT_SPRITE:
|
|
|
|
for (int i = 0; i < NUM_AIRPORTS; i++) {
|
|
|
|
const AirportSpec *as = AirportSpec::Get(i);
|
|
|
|
if (!as->enabled) continue;
|
|
|
|
for (byte layout = 0; layout < as->num_table; layout++) {
|
|
|
|
SpriteID sprite = GetCustomAirportSprite(as, layout);
|
|
|
|
if (sprite != 0) {
|
|
|
|
Dimension d = GetSpriteSize(sprite);
|
|
|
|
d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
|
|
|
|
d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
|
|
|
*size = maxdim(d, *size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2010-08-05 12:05:15 +00:00
|
|
|
case BAIRW_EXTRA_TEXT:
|
|
|
|
for (int i = NEW_AIRPORT_OFFSET; i < NUM_AIRPORTS; i++) {
|
|
|
|
const AirportSpec *as = AirportSpec::Get(i);
|
|
|
|
if (!as->enabled) continue;
|
|
|
|
for (byte layout = 0; layout < as->num_table; layout++) {
|
|
|
|
StringID string = GetAirportTextCallback(as, layout, CBID_AIRPORT_ADDITIONAL_TEXT);
|
|
|
|
if (string == STR_UNDEFINED) continue;
|
|
|
|
|
|
|
|
/* STR_BLACK_STRING is used to start the string with {BLACK} */
|
|
|
|
SetDParam(0, string);
|
|
|
|
Dimension d = GetStringMultiLineBoundingBox(STR_BLACK_STRING, *size);
|
|
|
|
*size = maxdim(d, *size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void DrawWidget(const Rect &r, int widget) const
|
|
|
|
{
|
2010-08-05 12:03:34 +00:00
|
|
|
switch (widget) {
|
|
|
|
case BAIRW_AIRPORT_LIST: {
|
|
|
|
int y = r.top;
|
2010-08-12 08:37:01 +00:00
|
|
|
for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < AirportClass::GetCount(_selected_airport_class); i++) {
|
2010-08-07 22:08:20 +00:00
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, i);
|
2010-08-05 12:03:34 +00:00
|
|
|
if (!as->IsAvailable()) {
|
2011-05-06 21:13:29 +00:00
|
|
|
GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->line_height - 2, PC_BLACK, FILLRECT_CHECKER);
|
2010-08-05 12:03:34 +00:00
|
|
|
}
|
|
|
|
DrawString(r.left + WD_MATRIX_LEFT, r.right + WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, as->name, ((int)i == _selected_airport_index) ? TC_WHITE : TC_BLACK);
|
|
|
|
y += this->line_height;
|
|
|
|
}
|
|
|
|
break;
|
2010-03-05 23:21:56 +00:00
|
|
|
}
|
2010-08-05 12:03:34 +00:00
|
|
|
|
|
|
|
case BAIRW_AIRPORT_SPRITE:
|
|
|
|
if (this->preview_sprite != 0) {
|
|
|
|
Dimension d = GetSpriteSize(this->preview_sprite);
|
2010-08-05 17:16:31 +00:00
|
|
|
DrawSprite(this->preview_sprite, COMPANY_SPRITE_COLOUR(_local_company), (r.left + r.right - d.width) / 2, (r.top + r.bottom - d.height) / 2);
|
2010-08-05 12:03:34 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-08-05 12:05:15 +00:00
|
|
|
|
|
|
|
case BAIRW_EXTRA_TEXT:
|
|
|
|
if (_selected_airport_index != -1) {
|
2010-08-07 22:08:20 +00:00
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, _selected_airport_index);
|
2010-08-05 12:05:15 +00:00
|
|
|
StringID string = GetAirportTextCallback(as, _selected_airport_layout, CBID_AIRPORT_ADDITIONAL_TEXT);
|
|
|
|
if (string != STR_UNDEFINED) {
|
|
|
|
SetDParam(0, string);
|
|
|
|
DrawStringMultiLine(r.left, r.right, r.top, r.bottom, STR_BLACK_STRING);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2010-03-05 23:21:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-05-17 03:31:22 +00:00
|
|
|
virtual void OnPaint()
|
|
|
|
{
|
2009-07-05 16:50:56 +00:00
|
|
|
this->DrawWidgets();
|
2008-05-17 03:31:22 +00:00
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
uint16 top = this->GetWidget<NWidgetBase>(BAIRW_BTN_DOHILIGHT)->pos_y + this->GetWidget<NWidgetBase>(BAIRW_BTN_DOHILIGHT)->current_y + WD_PAR_VSEP_NORMAL;
|
|
|
|
NWidgetBase *panel_nwi = this->GetWidget<NWidgetBase>(BAIRW_BOTTOMPANEL);
|
2008-05-17 03:31:22 +00:00
|
|
|
|
2009-08-02 21:04:15 +00:00
|
|
|
int right = panel_nwi->pos_x + panel_nwi->current_x;
|
|
|
|
int bottom = panel_nwi->pos_y + panel_nwi->current_y;
|
2010-03-05 23:21:56 +00:00
|
|
|
|
|
|
|
if (_selected_airport_index != -1) {
|
2010-08-07 22:08:20 +00:00
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, _selected_airport_index);
|
2010-03-05 23:21:56 +00:00
|
|
|
int rad = _settings_game.station.modified_catchment ? as->catchment : (uint)CA_UNMODIFIED;
|
|
|
|
|
|
|
|
/* only show the station (airport) noise, if the noise option is activated */
|
|
|
|
if (_settings_game.economy.station_noise_level) {
|
|
|
|
/* show the noise of the selected airport */
|
|
|
|
SetDParam(0, as->noise_level);
|
|
|
|
DrawString(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, STR_STATION_BUILD_NOISE);
|
|
|
|
top += FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* strings such as 'Size' and 'Coverage Area' */
|
|
|
|
top = DrawStationCoverageAreaText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
|
|
|
|
top = DrawStationCoverageAreaText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
|
2008-05-24 02:54:47 +00:00
|
|
|
}
|
|
|
|
|
2009-08-02 21:04:15 +00:00
|
|
|
/* Resize background if the text is not equally long as the window. */
|
|
|
|
if (top > bottom || (top < bottom && panel_nwi->current_y > panel_nwi->smallest_y)) {
|
|
|
|
ResizeWindow(this, 0, top - bottom);
|
2008-04-10 02:14:14 +00:00
|
|
|
}
|
2008-05-17 03:31:22 +00:00
|
|
|
}
|
2008-04-10 02:14:14 +00:00
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
void SelectOtherAirport(int airport_index)
|
2009-07-05 16:50:56 +00:00
|
|
|
{
|
2010-03-05 23:21:56 +00:00
|
|
|
_selected_airport_index = airport_index;
|
2010-08-05 11:59:07 +00:00
|
|
|
_selected_airport_layout = 0;
|
2009-07-05 16:50:56 +00:00
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
this->UpdateSelectSize();
|
2009-07-05 16:50:56 +00:00
|
|
|
this->SetDirty();
|
|
|
|
}
|
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
void UpdateSelectSize()
|
2009-07-05 16:50:56 +00:00
|
|
|
{
|
2010-03-05 23:21:56 +00:00
|
|
|
if (_selected_airport_index == -1) {
|
|
|
|
SetTileSelectSize(1, 1);
|
2010-08-05 11:59:07 +00:00
|
|
|
this->DisableWidget(BAIRW_LAYOUT_DECREASE);
|
|
|
|
this->DisableWidget(BAIRW_LAYOUT_INCREASE);
|
2010-03-05 23:21:56 +00:00
|
|
|
} else {
|
2010-08-07 22:08:20 +00:00
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, _selected_airport_index);
|
2010-08-05 12:00:09 +00:00
|
|
|
int w = as->size_x;
|
|
|
|
int h = as->size_y;
|
|
|
|
Direction rotation = as->rotation[_selected_airport_layout];
|
|
|
|
if (rotation == DIR_E || rotation == DIR_W) Swap(w, h);
|
|
|
|
SetTileSelectSize(w, h);
|
2010-03-05 23:21:56 +00:00
|
|
|
|
2011-05-27 15:31:54 +00:00
|
|
|
this->preview_sprite = GetCustomAirportSprite(as, _selected_airport_layout);
|
|
|
|
|
2010-08-05 11:59:07 +00:00
|
|
|
this->SetWidgetDisabledState(BAIRW_LAYOUT_DECREASE, _selected_airport_layout == 0);
|
|
|
|
this->SetWidgetDisabledState(BAIRW_LAYOUT_INCREASE, _selected_airport_layout + 1 >= as->num_table);
|
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
int rad = _settings_game.station.modified_catchment ? as->catchment : (uint)CA_UNMODIFIED;
|
|
|
|
if (_settings_client.gui.station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
|
2009-07-05 16:50:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-30 18:34:48 +00:00
|
|
|
virtual void OnClick(Point pt, int widget, int click_count)
|
2008-05-17 03:31:22 +00:00
|
|
|
{
|
|
|
|
switch (widget) {
|
2010-03-05 23:21:56 +00:00
|
|
|
case BAIRW_CLASS_DROPDOWN:
|
|
|
|
ShowDropDownList(this, BuildAirportClassDropDown(), _selected_airport_class, BAIRW_CLASS_DROPDOWN);
|
2008-05-17 03:31:22 +00:00
|
|
|
break;
|
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
case BAIRW_AIRPORT_LIST: {
|
2010-08-12 08:37:01 +00:00
|
|
|
int num_clicked = this->vscroll->GetPosition() + (pt.y - this->nested_array[widget]->pos_y) / this->line_height;
|
|
|
|
if (num_clicked >= this->vscroll->GetCount()) break;
|
2010-08-07 22:08:20 +00:00
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, num_clicked);
|
2010-03-05 23:21:56 +00:00
|
|
|
if (as->IsAvailable()) this->SelectOtherAirport(num_clicked);
|
2010-08-01 18:53:30 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-03-05 23:21:56 +00:00
|
|
|
|
|
|
|
case BAIRW_BTN_DONTHILIGHT: case BAIRW_BTN_DOHILIGHT:
|
|
|
|
_settings_client.gui.station_show_coverage = (widget != BAIRW_BTN_DONTHILIGHT);
|
|
|
|
this->SetWidgetLoweredState(BAIRW_BTN_DONTHILIGHT, !_settings_client.gui.station_show_coverage);
|
|
|
|
this->SetWidgetLoweredState(BAIRW_BTN_DOHILIGHT, _settings_client.gui.station_show_coverage);
|
|
|
|
this->SetDirty();
|
2008-05-17 03:31:22 +00:00
|
|
|
SndPlayFx(SND_15_BEEP);
|
2010-03-05 23:21:56 +00:00
|
|
|
this->UpdateSelectSize();
|
2008-05-17 03:31:22 +00:00
|
|
|
break;
|
2010-08-05 11:59:07 +00:00
|
|
|
|
|
|
|
case BAIRW_LAYOUT_DECREASE:
|
|
|
|
_selected_airport_layout--;
|
|
|
|
this->UpdateSelectSize();
|
|
|
|
this->SetDirty();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BAIRW_LAYOUT_INCREASE:
|
|
|
|
_selected_airport_layout++;
|
|
|
|
this->UpdateSelectSize();
|
|
|
|
this->SetDirty();
|
|
|
|
break;
|
2008-05-17 03:31:22 +00:00
|
|
|
}
|
|
|
|
}
|
2008-04-10 02:14:14 +00:00
|
|
|
|
2010-03-05 23:21:56 +00:00
|
|
|
/**
|
|
|
|
* Select the first available airport.
|
|
|
|
* @param change_class If true, change the class if no airport in the current
|
|
|
|
* class is available.
|
|
|
|
*/
|
|
|
|
void SelectFirstAvailableAirport(bool change_class)
|
|
|
|
{
|
|
|
|
/* First try to select an airport in the selected class. */
|
2010-08-07 22:08:20 +00:00
|
|
|
for (uint i = 0; i < AirportClass::GetCount(_selected_airport_class); i++) {
|
|
|
|
const AirportSpec *as = AirportClass::Get(_selected_airport_class, i);
|
2010-03-05 23:21:56 +00:00
|
|
|
if (as->IsAvailable()) {
|
|
|
|
this->SelectOtherAirport(i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (change_class) {
|
|
|
|
/* If that fails, select the first available airport
|
|
|
|
* from a random class. */
|
|
|
|
for (AirportClassID j = APC_BEGIN; j < APC_MAX; j++) {
|
2010-08-07 22:08:20 +00:00
|
|
|
for (uint i = 0; i < AirportClass::GetCount(j); i++) {
|
|
|
|
const AirportSpec *as = AirportClass::Get(j, i);
|
2010-03-05 23:21:56 +00:00
|
|
|
if (as->IsAvailable()) {
|
|
|
|
_selected_airport_class = j;
|
|
|
|
this->SelectOtherAirport(i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* If all airports are unavailable, select nothing. */
|
|
|
|
this->SelectOtherAirport(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void OnDropdownSelect(int widget, int index)
|
|
|
|
{
|
|
|
|
assert(widget == BAIRW_CLASS_DROPDOWN);
|
|
|
|
_selected_airport_class = (AirportClassID)index;
|
2010-08-12 08:37:01 +00:00
|
|
|
this->vscroll->SetCount(AirportClass::GetCount(_selected_airport_class));
|
2010-03-05 23:21:56 +00:00
|
|
|
this->SelectFirstAvailableAirport(false);
|
|
|
|
}
|
|
|
|
|
2008-05-17 03:31:22 +00:00
|
|
|
virtual void OnTick()
|
|
|
|
{
|
|
|
|
CheckRedrawStationCoverage(this);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2008-05-17 03:31:22 +00:00
|
|
|
};
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-03-22 21:16:57 +00:00
|
|
|
static const NWidgetPart _nested_build_airport_widgets[] = {
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
2009-11-24 18:05:55 +00:00
|
|
|
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
|
|
|
|
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_AIRPORT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
2010-08-04 10:33:18 +00:00
|
|
|
NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetFill(1, 0), SetPIP(2, 0, 2),
|
|
|
|
NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_AIRPORT_CLASS_LABEL, STR_NULL), SetFill(1, 0),
|
|
|
|
NWidget(WWT_DROPDOWN, COLOUR_GREY, BAIRW_CLASS_DROPDOWN), SetFill(1, 0), SetDataTip(STR_BLACK_STRING, STR_NULL),
|
2009-03-22 21:16:57 +00:00
|
|
|
NWidget(NWID_HORIZONTAL),
|
2010-08-12 06:44:45 +00:00
|
|
|
NWidget(WWT_MATRIX, COLOUR_GREY, BAIRW_AIRPORT_LIST), SetFill(1, 0), SetDataTip(0x501, STR_NULL), SetScrollbar(BAIRW_SCROLLBAR),
|
2010-08-12 09:16:43 +00:00
|
|
|
NWidget(NWID_VSCROLLBAR, COLOUR_GREY, BAIRW_SCROLLBAR),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
2010-08-05 11:59:07 +00:00
|
|
|
NWidget(NWID_HORIZONTAL),
|
2011-01-26 08:14:36 +00:00
|
|
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, BAIRW_LAYOUT_DECREASE), SetMinimalSize(12, 0), SetDataTip(AWV_DECREASE, STR_NULL),
|
2010-08-05 11:59:07 +00:00
|
|
|
NWidget(WWT_LABEL, COLOUR_GREY, BAIRW_LAYOUT_NUM), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BLACK_STRING, STR_NULL),
|
2010-08-12 16:44:51 +00:00
|
|
|
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, BAIRW_LAYOUT_INCREASE), SetMinimalSize(12, 0), SetDataTip(AWV_INCREASE, STR_NULL),
|
2010-08-05 11:59:07 +00:00
|
|
|
EndContainer(),
|
2010-08-05 12:03:34 +00:00
|
|
|
NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, BAIRW_AIRPORT_SPRITE), SetFill(1, 0),
|
2010-08-05 12:05:15 +00:00
|
|
|
NWidget(WWT_EMPTY, COLOUR_DARK_GREEN, BAIRW_EXTRA_TEXT), SetFill(1, 0), SetMinimalSize(150, 0),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
|
|
|
/* Bottom panel. */
|
2010-03-05 23:21:56 +00:00
|
|
|
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, BAIRW_BOTTOMPANEL), SetPIP(2, 2, 2),
|
2010-08-04 10:33:18 +00:00
|
|
|
NWidget(WWT_LABEL, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL), SetFill(1, 0),
|
2009-03-22 21:16:57 +00:00
|
|
|
NWidget(NWID_HORIZONTAL),
|
2010-08-04 10:33:18 +00:00
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(14, 0), SetFill(1, 0),
|
2009-08-02 21:04:15 +00:00
|
|
|
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
|
2010-03-05 23:21:56 +00:00
|
|
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, BAIRW_BTN_DONTHILIGHT), SetMinimalSize(60, 12), SetFill(1, 0),
|
2009-08-02 21:04:15 +00:00
|
|
|
SetDataTip(STR_STATION_BUILD_COVERAGE_OFF, STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP),
|
2010-03-05 23:21:56 +00:00
|
|
|
NWidget(WWT_TEXTBTN, COLOUR_GREY, BAIRW_BTN_DOHILIGHT), SetMinimalSize(60, 12), SetFill(1, 0),
|
2009-08-02 21:04:15 +00:00
|
|
|
SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
|
|
|
|
EndContainer(),
|
2010-08-04 10:33:18 +00:00
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(14, 0), SetFill(1, 0),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
2009-11-22 18:26:01 +00:00
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 10), SetResize(0, 1), SetFill(1, 0),
|
2009-03-22 21:16:57 +00:00
|
|
|
EndContainer(),
|
|
|
|
};
|
|
|
|
|
2009-03-15 15:12:06 +00:00
|
|
|
static const WindowDesc _build_airport_desc(
|
2009-11-28 15:01:49 +00:00
|
|
|
WDP_AUTO, 0, 0,
|
2006-11-10 19:24:14 +00:00
|
|
|
WC_BUILD_STATION, WC_BUILD_TOOLBAR,
|
2011-05-27 16:26:10 +00:00
|
|
|
WDF_CONSTRUCTION | WDF_UNCLICK_BUTTONS,
|
2009-11-15 10:26:01 +00:00
|
|
|
_nested_build_airport_widgets, lengthof(_nested_build_airport_widgets)
|
2009-03-15 15:12:06 +00:00
|
|
|
);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-05-24 11:19:30 +00:00
|
|
|
static void ShowBuildAirportPicker(Window *parent)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-03-05 23:21:56 +00:00
|
|
|
new BuildAirportWindow(&_build_airport_desc, parent);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void InitializeAirportGui()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-03-05 23:21:56 +00:00
|
|
|
_selected_airport_class = APC_BEGIN;
|
2011-06-04 14:48:21 +00:00
|
|
|
_selected_airport_index = -1;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|