Edit Selection mode: add actions for moving the selection around the grid.

This commit is contained in:
sphere 2021-11-10 01:21:37 +01:00
parent af673f3270
commit 8c290a9e7c
2 changed files with 88 additions and 0 deletions

View File

@ -1910,6 +1910,54 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectionup")]
public void MoveSelectionUp()
{
offset.y += General.Map.Grid.GridSize;
// Update
UpdateGeometry();
UpdateRectangleComponents();
General.Map.Map.Update();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectiondown")]
public void MoveSelectionDown()
{
offset.y -= General.Map.Grid.GridSize;
// Update
UpdateGeometry();
UpdateRectangleComponents();
General.Map.Map.Update();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectionleft")]
public void MoveSelectionLeft()
{
offset.x -= General.Map.Grid.GridSize;
// Update
UpdateGeometry();
UpdateRectangleComponents();
General.Map.Map.Update();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectionright")]
public void MoveSelectionRight()
{
offset.x += General.Map.Grid.GridSize;
// Update
UpdateGeometry();
UpdateRectangleComponents();
General.Map.Map.Update();
General.Interface.RedrawDisplay();
}
#endregion
}
}

View File

@ -1325,6 +1325,46 @@ flipselectionh
allowscroll = true;
}
moveselectionup
{
title = "Move Selection Up by grid size";
category = "edit";
description = "Moves the selection in Edit Selection mode up by the current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
moveselectiondown
{
title = "Move Selection Down by grid size";
category = "edit";
description = "Moves the selection in Edit Selection mode down by the current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
moveselectionleft
{
title = "Move Selection Left by grid size";
category = "edit";
description = "Moves the selection in Edit Selection mode left by the current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
moveselectionright
{
title = "Move Selection Right by grid size";
category = "edit";
description = "Moves the selection in Edit Selection mode right by the current grid size.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
//mxd
rotateclockwise
{