diff options
author | rubidium <rubidium@openttd.org> | 2009-01-08 16:35:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-01-08 16:35:45 +0000 |
commit | c8c61e36bdfe2de8e3785b6c3912a733f099df3e (patch) | |
tree | 9a9133dd8ea3555a253b9e604560b979c9ed0481 /src/airport_gui.cpp | |
parent | b34b3865882d87d3ad89403e1691c2a18b1cfb7e (diff) | |
download | openttd-c8c61e36bdfe2de8e3785b6c3912a733f099df3e.tar.xz |
(svn r14919) -Feature: distant joining of stations (Frostregen and PhilSophus)
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r-- | src/airport_gui.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 945d196d6..eefc1f1f5 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -40,7 +40,11 @@ void CcBuildAirport(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceAirport(TileIndex tile) { - DoCommandP(tile, _selected_airport_type, _ctrl_pressed, CMD_BUILD_AIRPORT | CMD_MSG(STR_A001_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport); + uint32 p2 = _ctrl_pressed; + SB(p2, 16, 16, INVALID_STATION); // no station to join + + CommandContainer cmdcont = { tile, _selected_airport_type, p2, CMD_BUILD_AIRPORT | CMD_MSG(STR_A001_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport, "" }; + ShowSelectStationIfNeeded(cmdcont, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE); } @@ -124,6 +128,7 @@ struct BuildAirToolbarWindow : Window { this->RaiseButtons(); delete FindWindowById(WC_BUILD_STATION, 0); + delete FindWindowById(WC_SELECT_STATION, 0); } }; @@ -186,6 +191,11 @@ public: this->FindWindowPlacementAndResize(desc); } + virtual ~AirportPickerWindow() + { + DeleteWindowById(WC_SELECT_STATION, 0); + } + virtual void OnPaint() { int i; // airport enabling loop @@ -247,6 +257,7 @@ public: this->LowerWidget(_selected_airport_type + BAW_SMALL_AIRPORT); SndPlayFx(SND_15_BEEP); this->SetDirty(); + DeleteWindowById(WC_SELECT_STATION, 0); break; case BAW_BTN_DONTHILIGHT: case BAW_BTN_DOHILIGHT: |