From 6892cc8a60df5ea34dc882eaa19d00fbdfa0a87d Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 13 Dec 2010 15:15:02 +0000 Subject: (svn r21500) -Feature [FS#730]: diagonal tile clearing and terraforming. Based on patch by fonsinchen --- src/terraform_gui.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/terraform_gui.cpp') diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index b45a0e9a1..48be17d99 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -107,16 +107,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - DoCommandP(end_tile, start_tile, 0, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound10); + DoCommandP(end_tile, start_tile, _ctrl_pressed, CMD_CLEAR_AREA | CMD_MSG(STR_ERROR_CAN_T_CLEAR_THIS_AREA), CcPlaySound10); break; case DDSP_RAISE_AND_LEVEL_AREA: - DoCommandP(end_tile, start_tile, LM_RAISE << 1, CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform); + DoCommandP(end_tile, start_tile, LM_RAISE << 1 | _ctrl_pressed, CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_RAISE_LAND_HERE), CcTerraform); break; case DDSP_LOWER_AND_LEVEL_AREA: - DoCommandP(end_tile, start_tile, LM_LOWER << 1, CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LOWER_LAND_HERE), CcTerraform); + DoCommandP(end_tile, start_tile, LM_LOWER << 1 | _ctrl_pressed, CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LOWER_LAND_HERE), CcTerraform); break; case DDSP_LEVEL_AREA: - DoCommandP(end_tile, start_tile, LM_LEVEL << 1, CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LEVEL_LAND_HERE), CcTerraform); + DoCommandP(end_tile, start_tile, LM_LEVEL << 1 | _ctrl_pressed, CMD_LEVEL_LAND | CMD_MSG(STR_ERROR_CAN_T_LEVEL_LAND_HERE), CcTerraform); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -622,7 +622,9 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed) */ bool IsDraggingDiagonal() { - return false; + return _ctrl_pressed && _left_button_down && ( + _place_proc == PlaceProc_DemolishArea || _place_proc == PlaceProc_LevelLand || + _place_proc == PlaceProc_RaiseLand || _place_proc == PlaceProc_LowerLand); } struct ScenarioEditorLandscapeGenerationWindow : Window { -- cgit v1.2.3-54-g00ecf