mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-04-22 17:44:06 +00:00
Update 2D flat alignment on pasting linedef properties.
This commit is contained in:
parent
597592b393
commit
3856a65588
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue