summaryrefslogtreecommitdiff
path: root/src/road_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-08 16:35:45 +0000
committerrubidium <rubidium@openttd.org>2009-01-08 16:35:45 +0000
commit7a5798695decde2af2ba719aee96f2bcaa7d9e95 (patch)
tree9a9133dd8ea3555a253b9e604560b979c9ed0481 /src/road_gui.cpp
parentd29dc478ddfc06715ca0d7b346e70c9a198629d5 (diff)
downloadopenttd-7a5798695decde2af2ba719aee96f2bcaa7d9e95.tar.xz
(svn r14919) -Feature: distant joining of stations (Frostregen and PhilSophus)
Diffstat (limited to 'src/road_gui.cpp')
-rw-r--r--src/road_gui.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 902649df7..fea1411a8 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -206,12 +206,14 @@ static void PlaceRoad_Depot(TileIndex tile)
static void PlaceRoadStop(TileIndex tile, uint32 p2, uint32 cmd)
{
uint32 p1 = _road_station_picker_orientation;
+ SB(p2, 16, 16, INVALID_STATION); // no station to join
if (p1 >= DIAGDIR_END) {
SetBit(p2, 1); // It's a drive-through stop
p1 -= DIAGDIR_END; // Adjust picker result to actual direction
}
- DoCommandP(tile, p1, p2, cmd, CcRoadDepot);
+ CommandContainer cmdcont = { tile, p1, p2, cmd, CcRoadDepot, "" };
+ ShowSelectStationIfNeeded(cmdcont, 1, 1);
}
static void PlaceRoad_BusStation(TileIndex tile)
@@ -528,6 +530,7 @@ struct BuildRoadToolbarWindow : Window {
delete FindWindowById(WC_BUS_STATION, 0);
delete FindWindowById(WC_TRUCK_STATION, 0);
delete FindWindowById(WC_BUILD_DEPOT, 0);
+ delete FindWindowById(WC_SELECT_STATION, 0);
}
virtual void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt)
@@ -835,6 +838,11 @@ public:
this->FindWindowPlacementAndResize(desc);
}
+ virtual ~BuildRoadStationWindow()
+ {
+ DeleteWindowById(WC_SELECT_STATION, 0);
+ }
+
virtual void OnPaint()
{
this->DrawWidgets();
@@ -883,6 +891,7 @@ public:
this->LowerWidget(_road_station_picker_orientation + BRSW_STATION_NE);
SndPlayFx(SND_15_BEEP);
this->SetDirty();
+ DeleteWindowById(WC_SELECT_STATION, 0);
break;
case BRSW_LT_OFF: