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 | 7a5798695decde2af2ba719aee96f2bcaa7d9e95 (patch) | |
tree | 9a9133dd8ea3555a253b9e604560b979c9ed0481 /src/dock_gui.cpp | |
parent | d29dc478ddfc06715ca0d7b346e70c9a198629d5 (diff) | |
download | openttd-7a5798695decde2af2ba719aee96f2bcaa7d9e95.tar.xz |
(svn r14919) -Feature: distant joining of stations (Frostregen and PhilSophus)
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r-- | src/dock_gui.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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; |