Improve and add some selection actions for Visual Mode.

This commit is contained in:
sphere 2021-05-14 20:58:08 +02:00
parent b9c5f33ec2
commit 29d900da32
2 changed files with 62 additions and 14 deletions

View file

@ -373,6 +373,26 @@ selectdoublesided
default = 65586;
}
selectfloors
{
title = "Select floors";
category = "visual";
description = "This keeps only the sector floors in your selection selected.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
selectceilings
{
title = "Select ceilings";
category = "visual";
description = "This keeps only the sector ceilings in your selection selected.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
fliplinedefs
{
title = "Flip Linedefs";

View file

@ -4105,13 +4105,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
int counter = 0;
List<VisualGeometry> selected = GetSelectedSurfaces();
foreach (VisualGeometry vg in selected)
if (vg is BaseVisualGeometrySidedef)
{
if (vg.Sidedef.Other != null)
vg.Selected = false;
else
counter++;
}
if (vg is BaseVisualGeometrySidedef && vg.Sidedef.Other == null)
counter++;
else
vg.Selected = false;
General.Interface.DisplayStatus(StatusType.Action, "Selected only single-sided linedefs (" + counter + ")");
General.Interface.RedrawDisplay();
@ -4126,13 +4123,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
int counter = 0;
List<VisualGeometry> selected = GetSelectedSurfaces();
foreach (VisualGeometry vg in selected)
if (vg is BaseVisualGeometrySidedef)
{
if (vg.Sidedef.Other == null)
vg.Selected = false;
else
counter++;
}
if (vg is BaseVisualGeometrySidedef && vg.Sidedef.Other != null)
counter++;
else
vg.Selected = false;
General.Interface.DisplayStatus(StatusType.Action, "Selected only double-sided linedefs (" + counter + ")");
General.Interface.RedrawDisplay();
@ -4140,6 +4134,40 @@ namespace CodeImp.DoomBuilder.BuilderModes
UpdateChangedObjects();
}
[BeginAction("selectfloors")]
public void SelectFloors()
{
int counter = 0;
List<VisualGeometry> selected = GetSelectedSurfaces();
foreach (VisualGeometry vg in selected)
if (vg is VisualFloor)
counter++;
else
vg.Selected = false;
General.Interface.DisplayStatus(StatusType.Action, "Selected only floors (" + counter + ")");
General.Interface.RedrawDisplay();
UpdateSelectionInfo();
UpdateChangedObjects();
}
[BeginAction("selectceilings")]
public void SelectCeilings()
{
int counter = 0;
List<VisualGeometry> selected = GetSelectedSurfaces();
foreach (VisualGeometry vg in selected)
if (vg is VisualCeiling)
counter++;
else
vg.Selected = false;
General.Interface.DisplayStatus(StatusType.Action, "Selected only ceilings (" + counter + ")");
General.Interface.RedrawDisplay();
UpdateSelectionInfo();
UpdateChangedObjects();
}
#endregion
#region ================== Texture Alignment