mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-03-04 00:21:44 +00:00
Allow selecting only single- or double-sided linedefs in Visual Mode.
This commit is contained in:
parent
76f2816e82
commit
f8bbe45c7b
2 changed files with 44 additions and 2 deletions
|
@ -324,7 +324,7 @@ selectsinglesided
|
||||||
{
|
{
|
||||||
title = "Select Single-sided";
|
title = "Select Single-sided";
|
||||||
category = "linedefs";
|
category = "linedefs";
|
||||||
description = "This keeps only the single-sided lines in your selection selected.";
|
description = "This keeps only the single-sided lines in your selection selected. Also works in Visual Mode.";
|
||||||
allowkeys = true;
|
allowkeys = true;
|
||||||
allowmouse = true;
|
allowmouse = true;
|
||||||
allowscroll = true;
|
allowscroll = true;
|
||||||
|
@ -335,7 +335,7 @@ selectdoublesided
|
||||||
{
|
{
|
||||||
title = "Select Double-sided";
|
title = "Select Double-sided";
|
||||||
category = "linedefs";
|
category = "linedefs";
|
||||||
description = "This keeps only the double-sided lines in your selection selected.";
|
description = "This keeps only the double-sided lines in your selection selected. Also works in Visual Mode.";
|
||||||
allowkeys = true;
|
allowkeys = true;
|
||||||
allowmouse = true;
|
allowmouse = true;
|
||||||
allowscroll = true;
|
allowscroll = true;
|
||||||
|
|
|
@ -4098,6 +4098,48 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
GetTargetEventReceiver(true).OnPaintSelectEnd();
|
GetTargetEventReceiver(true).OnPaintSelectEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This keeps only the single-sided lines selected
|
||||||
|
[BeginAction("selectsinglesided")]
|
||||||
|
public void SelectSingleSided()
|
||||||
|
{
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
|
||||||
|
General.Interface.DisplayStatus(StatusType.Action, "Selected only single-sided linedefs (" + counter + ")");
|
||||||
|
General.Interface.RedrawDisplay();
|
||||||
|
UpdateSelectionInfo();
|
||||||
|
UpdateChangedObjects();
|
||||||
|
}
|
||||||
|
|
||||||
|
// This keeps only the double-sided lines selected
|
||||||
|
[BeginAction("selectdoublesided")]
|
||||||
|
public void SelectDoubleSided()
|
||||||
|
{
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
|
||||||
|
General.Interface.DisplayStatus(StatusType.Action, "Selected only double-sided linedefs (" + counter + ")");
|
||||||
|
General.Interface.RedrawDisplay();
|
||||||
|
UpdateSelectionInfo();
|
||||||
|
UpdateChangedObjects();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Texture Alignment
|
#region ================== Texture Alignment
|
||||||
|
|
Loading…
Reference in a new issue