3D Floor Mode: duplicating geometry now copies all properties of the source control sector to the new control sector

This commit is contained in:
biwa 2020-09-26 14:02:33 +02:00
parent 077aa065cb
commit d1455df383
2 changed files with 12 additions and 3 deletions

View file

@ -57,6 +57,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
private int udmftag;
private List<int> tags;
private LinedefProperties linedefproperties;
private SectorProperties sectorproperties;
public static Rectangle controlsectorarea = new Rectangle(-512, 512, 512, -512);
@ -81,6 +82,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
public Vector3D CeilingSlope { get { return ceilingslope; } set { ceilingslope = value; } }
public double CeilingSlopeOffset { get { return ceilingslopeoffset; } set { ceilingslopeoffset = value; } }
public LinedefProperties LinedefProperties { get { return linedefproperties; } }
public SectorProperties SectorProperties { get { return sectorproperties; } }
public ThreeDFloor()
{
@ -99,6 +101,9 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
ceilingslope = new Vector3D(0.0f, 0.0f, 0.0f);
ceilingslopeoffset = 0.0f;
linedefproperties = null;
sectorproperties = null;
alpha = 255;
}
@ -135,6 +140,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
flags = sd.Line.Args[2];
alpha = sd.Line.Args[3];
linedefproperties = new LinedefProperties(sd.Line);
sectorproperties = new SectorProperties(sector);
foreach (Sector s in BuilderPlug.GetSectorsByTag(potentialsectors, sd.Line.Args[0]))
{
@ -231,10 +237,10 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
int newtag;
return CreateGeometry(tagblacklist, alldrawnvertices, null, false, out newtag);
return CreateGeometry(tagblacklist, alldrawnvertices, null, null, false, out newtag);
}
public bool CreateGeometry(List<int> tagblacklist, List<DrawnVertex> alldrawnvertices, LinedefProperties ldprops, bool forcenewtag, out int newtag)
public bool CreateGeometry(List<int> tagblacklist, List<DrawnVertex> alldrawnvertices, LinedefProperties ldprops, SectorProperties sectorprops, bool forcenewtag, out int newtag)
{
List<Vertex> vertices = new List<Vertex>();
Vector3D slopetopthingpos = new Vector3D(0, 0, 0);
@ -265,6 +271,9 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
sector = General.Map.Map.GetMarkedSectors(true)[0];
if (sectorprops != null)
sectorprops.Apply(new List<Sector>() { sector }, false);
sector.FloorHeight = bottomheight;
sector.CeilHeight = topheight;
sector.SetFloorTexture(bottomflat);

View file

@ -1574,7 +1574,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
int newtag;
int oldtag = tdf.UDMFTag;
if(!tdf.CreateGeometry(new List<int>(), drawnvertices, tdf.LinedefProperties, true, out newtag))
if(!tdf.CreateGeometry(new List<int>(), drawnvertices, tdf.LinedefProperties, tdf.SectorProperties, true, out newtag))
{
// No need to show a warning here, that was already done by CreateGeometry
General.Map.UndoRedo.WithdrawUndo();