summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-04 18:18:46 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-04 18:18:46 +0000
commit9299f76af42eb4c8ca8d7077fc60f87c2d962047 (patch)
tree508479974d8c96e3bbe1e304ace061d91d4a6d71 /src/terraform_gui.cpp
parent6a1306793108d0ebd51c8d79b8bb8cecd77a6ef6 (diff)
downloadopenttd-9299f76af42eb4c8ca8d7077fc60f87c2d962047.tar.xz
(svn r11759) -Feature: Add drag-n-drop support to the raise/lower land tools. Land is raised/lowered at the start and the rest of the area levelled to match. Patch by Roujin.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index cf22fd5e9..b078261b4 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -105,6 +105,12 @@ bool GUIPlaceProcDragXY(const WindowEvent *e)
case DDSP_DEMOLISH_AREA:
DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA));
break;
+ case DDSP_RAISE_AND_LEVEL_AREA:
+ DoCommandP(end_tile, start_tile, 1, CcTerraform, CMD_LEVEL_LAND| CMD_MSG(STR_0808_CAN_T_RAISE_LAND_HERE));
+ break;
+ case DDSP_LOWER_AND_LEVEL_AREA:
+ DoCommandP(end_tile, start_tile, -1, CcTerraform, CMD_LEVEL_LAND | CMD_MSG(STR_0809_CAN_T_LOWER_LAND_HERE));
+ break;
case DDSP_LEVEL_AREA:
DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_LEVEL_LAND);
break;
@@ -143,18 +149,12 @@ void PlaceProc_DemolishArea(TileIndex tile)
static void PlaceProc_RaiseLand(TileIndex tile)
{
- DoCommandP(
- tile, SLOPE_N, 1, CcTerraform,
- CMD_TERRAFORM_LAND | CMD_MSG(STR_0808_CAN_T_RAISE_LAND_HERE)
- );
+ VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_RAISE_AND_LEVEL_AREA);
}
static void PlaceProc_LowerLand(TileIndex tile)
{
- DoCommandP(
- tile, SLOPE_N, 0, CcTerraform,
- CMD_TERRAFORM_LAND | CMD_MSG(STR_0809_CAN_T_LOWER_LAND_HERE)
- );
+ VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_LOWER_AND_LEVEL_AREA);
}
void PlaceProc_LevelLand(TileIndex tile)
@@ -244,6 +244,8 @@ static void TerraformToolbWndProc(Window *w, WindowEvent *e)
if (e->we.place.pt.x != -1) {
switch (e->we.place.select_proc) {
case DDSP_DEMOLISH_AREA:
+ case DDSP_RAISE_AND_LEVEL_AREA:
+ case DDSP_LOWER_AND_LEVEL_AREA:
case DDSP_LEVEL_AREA:
GUIPlaceProcDragXY(e);
break;