From 7a5798695decde2af2ba719aee96f2bcaa7d9e95 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 8 Jan 2009 16:35:45 +0000 Subject: (svn r14919) -Feature: distant joining of stations (Frostregen and PhilSophus) --- src/dock_gui.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/dock_gui.cpp') diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 6c588bebe..7cc13acdb 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -47,7 +47,11 @@ void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2) static void PlaceDocks_Dock(TileIndex tile) { - DoCommandP(tile, _ctrl_pressed, 0, CMD_BUILD_DOCK | CMD_MSG(STR_9802_CAN_T_BUILD_DOCK_HERE), CcBuildDocks); + uint32 p2 = INVALID_STATION << 16; // no station to join + + /* tile is always the land tile, so need to evaluate _thd.pos */ + CommandContainer cmdcont = { tile, _ctrl_pressed, p2, CMD_BUILD_DOCK | CMD_MSG(STR_9802_CAN_T_BUILD_DOCK_HERE), CcBuildDocks, "" }; + ShowSelectStationIfNeeded(cmdcont, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE); } static void PlaceDocks_Depot(TileIndex tile) @@ -240,6 +244,7 @@ struct BuildDocksToolbarWindow : Window { delete FindWindowById(WC_BUILD_STATION, 0); delete FindWindowById(WC_BUILD_DEPOT, 0); + delete FindWindowById(WC_SELECT_STATION, 0); } virtual void OnPlacePresize(Point pt, TileIndex tile_from) @@ -334,6 +339,11 @@ public: this->FindWindowPlacementAndResize(desc); } + virtual ~BuildDocksStationWindow() + { + DeleteWindowById(WC_SELECT_STATION, 0); + } + virtual void OnPaint() { int rad = (_settings_game.station.modified_catchment) ? CA_DOCK : CA_UNMODIFIED; -- cgit v1.2.3-54-g00ecf