Add action/argument properties to base ThreeDFloor class

This commit is contained in:
spherallic 2024-05-10 14:27:35 +02:00
parent 787afd0553
commit 079356d991

View file

@ -47,9 +47,11 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
private double floorslopeoffset;
private Vector3D ceilingslope;
private double ceilingslopeoffset;
private int type;
private int flags;
private int alpha;
private int type; // GZDoom
private int flags; // GZDoom
private int alpha; // GZDoom
private int action; // SRB2
private int[] arguments; // SRB2
private int brightness;
private int topheight;
private int bottomheight;
@ -71,6 +73,8 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
public int Type { get { return type; } set { type = value; } }
public int Flags { get { return flags; } set { flags = value; } }
public int Alpha { get { return alpha; } set { alpha = value; } }
public int Action { get { return action; } set { action = value; } }
public int[] Arguments { get { return arguments; } set { arguments = value; } }
public int Brightness { get { return brightness; }set { brightness = value; } }
public int TopHeight { get { return topheight; } set { topheight = value; } }
public int BottomHeight { get { return bottomheight; } set { bottomheight = value; } }
@ -93,9 +97,11 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
topheight = General.Settings.DefaultCeilingHeight;
bottomheight = General.Settings.DefaultFloorHeight;
bordertexture = General.Settings.DefaultTexture;
type = 1;
type = 0;
flags = 0;
tags = new List<int>();
action = 100;
arguments = new int[Linedef.NUM_ARGS];
floorslope = new Vector3D(0.0f, 0.0f, 0.0f);
floorslopeoffset = 0.0f;
ceilingslope = new Vector3D(0.0f, 0.0f, 0.0f);
@ -125,6 +131,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
bottomheight = sector.FloorHeight;
brightness = sector.Brightness;
tags = new List<int>();
arguments = new int[Linedef.NUM_ARGS];
floorslope = sector.FloorSlope;
floorslopeoffset = sector.FloorSlopeOffset;
ceilingslope = sector.CeilSlope;
@ -139,6 +146,9 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
type = sd.Line.Args[4];
flags = sd.Line.Args[3];
alpha = sd.Line.Args[1];
action = sd.Line.Action;
for (int i = 1; i < Linedef.NUM_ARGS; i++)
arguments[i] = sd.Line.Args[i];
linedefproperties = new LinedefProperties(sd.Line);
sectorproperties = new SectorProperties(sector);
@ -197,11 +207,14 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
if(ldprops != null)
ldprops.Apply(new List<Linedef>() { line }, false);
line.Action = 100;
line.Args[0] = tag;
line.Args[4] = type;
line.Args[3] = flags;
line.Args[1] = alpha;
line.Action = action;
for (int i = 1; i < Linedef.NUM_ARGS; i++)
line.Args[i] = arguments[i];
}
public void UpdateGeometry()
@ -228,7 +241,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
// We need to update the linedef's args, but we can't do it directly because otherwise their state will not be saved for the undo snapshot,
// so we're using the linedef's update method
sd.Line.Update(sd.Line.GetFlags(), sd.Line.Activate, sd.Line.Tags, sd.Line.Action, new int[] { sd.Line.Args[0], type, flags, alpha, sd.Line.Args[4] });
sd.Line.Update(sd.Line.GetFlags(), sd.Line.Activate, sd.Line.Tags, sd.Line.Action, arguments);
}
}
}