summaryrefslogtreecommitdiff
path: root/src/rail_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-05-07 17:10:30 +0000
committerpeter1138 <peter1138@openttd.org>2007-05-07 17:10:30 +0000
commite643aeaed2f270d0f4cf9d3224a89cafbe9aaa00 (patch)
tree0171e4e6e8bbef30ffad6b733c43128c41e7271b /src/rail_gui.cpp
parentbc7d7621965491f6d6928304265d2c65c917e52f (diff)
downloadopenttd-e643aeaed2f270d0f4cf9d3224a89cafbe9aaa00.tar.xz
(svn r9810) -Feature: Add drag and drop removal of station tiles (Wolf01)
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r--src/rail_gui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index d6571e4f6..18fd4e0f6 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -151,7 +151,7 @@ void CcStation(bool success, TileIndex tile, uint32 p1, uint32 p2)
static void PlaceRail_Station(TileIndex tile)
{
if (_remove_button_clicked) {
- DoCommandP(tile, 0, 0, CcPlaySound1E, CMD_REMOVE_FROM_RAILROAD_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION));
+ VpStartPlaceSizing(tile, VPM_X_AND_Y | GUI_PlaceProc_RemoveFromStation);
} else if (_railstation.dragdrop) {
VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED);
VpSetPlaceSizingLimit(_patches.station_spread);
@@ -514,8 +514,13 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
} else if ((e->we.place.userdata & 0xF) == VPM_X_AND_Y) {
if (GUIPlaceProcDragXY(e)) break;
- if ((e->we.place.userdata >> 4) == GUI_PlaceProc_ConvertRailArea >> 4)
+ if ((e->we.place.userdata >> 4) == GUI_PlaceProc_RemoveFromStation >> 4) {
+ DoCommandP(end_tile, start_tile, 0, CcPlaySound1E, CMD_REMOVE_FROM_RAILROAD_STATION | CMD_MSG(STR_CANT_REMOVE_PART_OF_STATION));
+ }
+
+ if ((e->we.place.userdata >> 4) == GUI_PlaceProc_ConvertRailArea >> 4) {
DoCommandP(end_tile, start_tile, _cur_railtype, CcPlaySound10, CMD_CONVERT_RAIL | CMD_MSG(STR_CANT_CONVERT_RAIL));
+ }
} else if (e->we.place.userdata == VPM_X_AND_Y_LIMITED) {
HandleStationPlacement(start_tile, end_tile);
} else {