Make flat alignment modes support Edit Selection mode actions

This commit is contained in:
spherallic 2024-07-17 11:14:41 +02:00
parent ca46c6b3f5
commit 3c176d2178
2 changed files with 84 additions and 8 deletions

View file

@ -937,6 +937,82 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.RedrawDisplay();
}
// Flip vertically
[BeginAction("flipselectionv")]
public void FlipVertically()
{
scale.y = -scale.y;
//offset.y -= texture.Height * scale.y; // This doesn't account for rotated textures yet
UpdateSectors();
General.Interface.RedrawDisplay();
}
// Flip horizontally
[BeginAction("flipselectionh")]
public void FlipHorizontally()
{
scale.x = -scale.x;
//offset.x += texture.Width * scale.x; // This doesn't account for rotated textures yet
UpdateSectors();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectionup")]
public void MoveSelectionUp()
{
offset.y -= General.Map.Grid.GridSize;
UpdateSectors();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectiondown")]
public void MoveSelectionDown()
{
offset.y += General.Map.Grid.GridSize;
UpdateSectors();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectionleft")]
public void MoveSelectionLeft()
{
offset.x += General.Map.Grid.GridSize;
UpdateSectors();
General.Interface.RedrawDisplay();
}
[BeginAction("moveselectionright")]
public void MoveSelectionRight()
{
offset.x -= General.Map.Grid.GridSize;
UpdateSectors();
General.Interface.RedrawDisplay();
}
[BeginAction("rotateclockwise")]
public void RotateCW()
{
rotation += Angle2D.DegToRad(5);
UpdateSectors();
General.Interface.RedrawDisplay();
}
[BeginAction("rotatecounterclockwise")]
public void RotateCCW()
{
rotation -= Angle2D.DegToRad(5);
UpdateSectors();
General.Interface.RedrawDisplay();
}
#endregion
}
}

View file

@ -1323,7 +1323,7 @@ flipselectionv
{
title = "Flip Selection Vertically";
category = "edit";
description = "Flips the selection in Edit Selection mode vertically.";
description = "Flips the selection in Edit Selection mode vertically. Also works in Floor/Ceiling Align Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -1333,7 +1333,7 @@ flipselectionh
{
title = "Flip Selection Horizontally";
category = "edit";
description = "Flips the selection in Edit Selection mode horizontally.";
description = "Flips the selection in Edit Selection mode horizontally. Also works in Floor/Ceiling Align Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -1343,7 +1343,7 @@ moveselectionup
{
title = "Move Selection Up by Grid Size";
category = "edit";
description = "Moves the selection in Edit Selection mode up by the current grid size.";
description = "Moves the selection in Edit Selection mode up by the current grid size. Also works in Floor/Ceiling Align Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -1354,7 +1354,7 @@ moveselectiondown
{
title = "Move Selection Down by Grid Size";
category = "edit";
description = "Moves the selection in Edit Selection mode down by the current grid size.";
description = "Moves the selection in Edit Selection mode down by the current grid size. Also works in Floor/Ceiling Align Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -1365,7 +1365,7 @@ moveselectionleft
{
title = "Move Selection Left by Grid Size";
category = "edit";
description = "Moves the selection in Edit Selection mode left by the current grid size.";
description = "Moves the selection in Edit Selection mode left by the current grid size. Also works in Floor/Ceiling Align Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -1376,7 +1376,7 @@ moveselectionright
{
title = "Move Selection Right by Grid Size";
category = "edit";
description = "Moves the selection in Edit Selection mode right by the current grid size.";
description = "Moves the selection in Edit Selection mode right by the current grid size. Also works in Floor/Ceiling Align Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
@ -1388,7 +1388,7 @@ rotateclockwise
{
title = "Rotate Clockwise";
category = "edit";
description = "Rotates selected or highlighted things clockwise. Also rotates floor/ceiling textures in UDMF map format, and rotates the selection in Edit Selection mode.";
description = "Rotates selected or highlighted things clockwise. Also rotates floor/ceiling textures in UDMF map format and Floor/Ceiling Align Mode, and rotates the selection in Edit Selection mode.";
allowkeys = true;
allowmouse = false;
allowscroll = true;
@ -1401,7 +1401,7 @@ rotatecounterclockwise
{
title = "Rotate Counterclockwise";
category = "edit";
description = "Rotates selected or highlighted things counterclockwise. Also rotates floor/ceiling textures in UDMF map format, and rotates the selection in Edit Selection mode.";
description = "Rotates selected or highlighted things counterclockwise. Also rotates floor/ceiling textures in UDMF map format and Floor/Ceiling Align Mode, and rotates the selection in Edit Selection mode.";
allowkeys = true;
allowmouse = false;
allowscroll = true;