Update 2D flat alignment on pasting linedef properties.

This commit is contained in:
sphere 2021-03-13 17:42:47 +01:00
parent 597592b393
commit 3856a65588

View file

@ -935,14 +935,25 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(sel != null)
{
List<int> linedeftags = new List<int>();
// Apply properties to selection
string rest = (sel.Count == 1 ? "a single linedef" : sel.Count + " linedefs"); //mxd
General.Map.UndoRedo.CreateUndo("Paste properties to " + rest);
foreach(Linedef l in sel)
{
if (l.Tag != 0) linedeftags.Add(l.Tag);
BuilderPlug.Me.CopiedLinedefProps.Apply(l, false);
l.UpdateCache();
if (l.IsFlatAlignment && l.Tag != 0) linedeftags.Add(l.Tag);
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
foreach (Sector s in General.Map.Map.Sectors)
if (linedeftags.Contains(s.Tag))
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
General.Interface.DisplayStatus(StatusType.Action, "Pasted properties to " + rest + ".");
// Update and redraw
@ -980,14 +991,25 @@ namespace CodeImp.DoomBuilder.BuilderModes
PastePropertiesOptionsForm form = new PastePropertiesOptionsForm();
if(form.Setup(MapElementType.LINEDEF) && form.ShowDialog(General.Interface) == DialogResult.OK)
{
List<int> linedeftags = new List<int>();
// Apply properties to selection
string rest = (sel.Count == 1 ? "a single linedef" : sel.Count + " linedefs");
General.Map.UndoRedo.CreateUndo("Paste properties with options to " + rest);
foreach(Linedef l in sel)
{
if (l.Tag != 0) linedeftags.Add(l.Tag);
BuilderPlug.Me.CopiedLinedefProps.Apply(l, true);
l.UpdateCache();
if (l.IsFlatAlignment && l.Tag != 0) linedeftags.Add(l.Tag);
l.Front.Sector.UpdateFloorSurface();
l.Front.Sector.UpdateCeilingSurface();
}
foreach (Sector s in General.Map.Map.Sectors)
if (linedeftags.Contains(s.Tag))
{
s.UpdateFloorSurface();
s.UpdateCeilingSurface();
}
General.Interface.DisplayStatus(StatusType.Action, "Pasted properties with options to " + rest + ".");
// Update and redraw