Add action for removing FOF planes from Visual Mode selection

This commit is contained in:
spherallic 2023-04-21 22:11:57 +02:00
parent c76ff0aab9
commit f8c313abaa
3 changed files with 51 additions and 1 deletions

View File

@ -1376,6 +1376,16 @@ alphabasedtexturehighlighting
allowscroll = true;
}
deselectfofplanes
{
title = "Deselect FOF planes";
category = "visual";
description = "Deselects all FOF planes from your selection in Visual Mode.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
placevisualstart
{
title = "Place Visual Mode Camera";

View File

@ -1058,6 +1058,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
public void OnRemoveFOFSelection()
{
if (level != null)
{
// This plane is part of a 3D-floor/FOF
if (level.sector != Sector.Sector)
{
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
selected = false;
mode.RemoveSelectedObject(this);
}
}
}
#endregion
}
}

View File

@ -4460,6 +4460,32 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.DisplayStatus(StatusType.Info, "Alpha-based textures highlighting is " + (BuilderPlug.Me.AlphaBasedTextureHighlighting ? "ENABLED" : "DISABLED"));
}
[BeginAction("deselectfofplanes")]
public void DeselectFOFPlanes()
{
PreAction(UndoGroup.None);
List<IVisualEventReceiver> objs = GetSelectedObjects(true, false, false, false);
foreach (IVisualEventReceiver i in objs)
{
if (i is VisualFloor)
{
VisualFloor vf = i as VisualFloor;
vf.OnRemoveFOFSelection();
}
if (i is VisualCeiling)
{
VisualCeiling vc = i as VisualCeiling;
vc.OnRemoveFOFSelection();
}
}
General.Interface.DisplayStatus(StatusType.Action, "Deselected FOF planes.");
General.Interface.RedrawDisplay();
UpdateSelectionInfo();
UpdateChangedObjects();
}
#endregion
#region ================== Texture Alignment