summaryrefslogtreecommitdiff
path: root/src/road_gui.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-02-24 21:53:16 +0000
committerterkhen <terkhen@openttd.org>2010-02-24 21:53:16 +0000
commitaba24e44cf76479a33e78cc0a8d6d5279aeef00b (patch)
tree54f07fa2f6fe65cb5ea8737300c10678394c0fba /src/road_gui.cpp
parent70b1bc5048cf67ab93daf6eb8fb053037c2c976f (diff)
downloadopenttd-aba24e44cf76479a33e78cc0a8d6d5279aeef00b.tar.xz
(svn r19230) -Feature: Allow to remove multiple road stops using drag and drop.
Diffstat (limited to 'src/road_gui.cpp')
-rw-r--r--src/road_gui.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 7a0b14579..0fdb7c183 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -260,7 +260,7 @@ static void PlaceRoadStop(TileIndex start_tile, TileIndex end_tile, uint32 p2, u
static void PlaceRoad_BusStation(TileIndex tile)
{
if (_remove_button_clicked) {
- DoCommandP(tile, 0, ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D);
+ VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_REMOVE_BUSSTOP);
} else {
if (_road_station_picker_orientation < DIAGDIR_END) { // Not a drive-through stop.
VpStartPlaceSizing(tile, (DiagDirToAxis(_road_station_picker_orientation) == AXIS_X) ? VPM_X_LIMITED : VPM_Y_LIMITED, DDSP_BUILD_BUSSTOP);
@@ -274,7 +274,7 @@ static void PlaceRoad_BusStation(TileIndex tile)
static void PlaceRoad_TruckStation(TileIndex tile)
{
if (_remove_button_clicked) {
- DoCommandP(tile, 0, ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D);
+ VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_REMOVE_TRUCKSTOP);
} else {
if (_road_station_picker_orientation < DIAGDIR_END) { // Not a drive-through stop.
VpStartPlaceSizing(tile, (DiagDirToAxis(_road_station_picker_orientation) == AXIS_X) ? VPM_X_LIMITED : VPM_Y_LIMITED, DDSP_BUILD_TRUCKSTOP);
@@ -664,6 +664,16 @@ struct BuildRoadToolbarWindow : Window {
case DDSP_BUILD_TRUCKSTOP:
PlaceRoadStop(start_tile, end_tile, (_ctrl_pressed << 5) | RoadTypeToRoadTypes(_cur_roadtype) << 2 | ROADSTOP_TRUCK, CMD_BUILD_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_station[ROADSTOP_TRUCK]));
break;
+
+ case DDSP_REMOVE_BUSSTOP: {
+ TileArea ta(start_tile, end_tile);
+ DoCommandP(ta.tile, ta.w | ta.h << 8, ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D);
+ } break;
+
+ case DDSP_REMOVE_TRUCKSTOP: {
+ TileArea ta(start_tile, end_tile);
+ DoCommandP(ta.tile, ta.w | ta.h << 8, ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D);
+ } break;
}
}
}