mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
@ Fixed raising/lowering of floor/ceiling on Vavoom type 3D floors (they were reversed)
This commit is contained in:
parent
7be6466f80
commit
5f1a5df50b
4 changed files with 19 additions and 16 deletions
|
@ -54,6 +54,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
protected bool changed;
|
||||
|
||||
protected SectorLevel level;
|
||||
protected Effect3DFloor extrafloor;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -62,6 +63,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
new public BaseVisualSector Sector { get { return (BaseVisualSector)base.Sector; } }
|
||||
public bool Changed { get { return changed; } set { changed = value; } }
|
||||
public SectorLevel Level { get { return level; } }
|
||||
public Effect3DFloor ExtraFloor { get { return extrafloor; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -102,10 +104,11 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
public virtual void ApplyLowerUnpegged(bool set) { }
|
||||
|
||||
// Setup this plane
|
||||
public bool Setup() { return this.Setup(this.level); }
|
||||
public virtual bool Setup(SectorLevel level)
|
||||
public bool Setup() { return this.Setup(this.level, this.extrafloor); }
|
||||
public virtual bool Setup(SectorLevel level, Effect3DFloor extrafloor)
|
||||
{
|
||||
this.level = level;
|
||||
this.extrafloor = extrafloor;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -182,12 +182,12 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
// Create floor
|
||||
floor = floor ?? new VisualFloor(mode, this);
|
||||
if(floor.Setup(data.Floor))
|
||||
if(floor.Setup(data.Floor, null))
|
||||
base.AddGeometry(floor);
|
||||
|
||||
// Create ceiling
|
||||
ceiling = ceiling ?? new VisualCeiling(mode, this);
|
||||
if(ceiling.Setup(data.Ceiling))
|
||||
if(ceiling.Setup(data.Ceiling, null))
|
||||
base.AddGeometry(ceiling);
|
||||
|
||||
// Create 3D floors
|
||||
|
@ -197,14 +197,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
// Create a floor
|
||||
VisualFloor vf = (i < extrafloors.Count) ? extrafloors[i] : new VisualFloor(mode, this);
|
||||
if(vf.Setup(ef.Floor))
|
||||
if(vf.Setup(ef.Floor, ef))
|
||||
base.AddGeometry(vf);
|
||||
if(i >= extrafloors.Count)
|
||||
extrafloors.Add(vf);
|
||||
|
||||
// Create a ceiling
|
||||
VisualCeiling vc = (i < extraceilings.Count) ? extraceilings[i] : new VisualCeiling(mode, this);
|
||||
if(vc.Setup(ef.Ceiling))
|
||||
if(vc.Setup(ef.Ceiling, ef))
|
||||
base.AddGeometry(vc);
|
||||
if(i >= extraceilings.Count)
|
||||
extraceilings.Add(vc);
|
||||
|
|
|
@ -65,15 +65,15 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
}
|
||||
|
||||
// This builds the geometry. Returns false when no geometry created.
|
||||
public override bool Setup(SectorLevel level)
|
||||
public override bool Setup(SectorLevel level, Effect3DFloor extrafloor)
|
||||
{
|
||||
WorldVertex[] verts;
|
||||
WorldVertex v;
|
||||
Sector s = level.sector;
|
||||
Vector2D texscale;
|
||||
|
||||
base.Setup(level);
|
||||
|
||||
|
||||
base.Setup(level, extrafloor);
|
||||
|
||||
// Fetch ZDoom fields
|
||||
float rotate = Angle2D.DegToRad(s.Fields.GetValue("rotationceiling", 0.0f));
|
||||
Vector2D offset = new Vector2D(s.Fields.GetValue("xpanningceiling", 0.0f),
|
||||
|
@ -165,7 +165,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
// This changes the height
|
||||
protected override void ChangeHeight(int amount)
|
||||
{
|
||||
if(level.sector == Sector.Sector)
|
||||
if((extrafloor == null) || extrafloor.VavoomType)
|
||||
{
|
||||
mode.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, level.sector.FixedIndex);
|
||||
level.sector.CeilHeight += amount;
|
||||
|
|
|
@ -65,14 +65,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
}
|
||||
|
||||
// This builds the geometry. Returns false when no geometry created.
|
||||
public override bool Setup(SectorLevel level)
|
||||
public override bool Setup(SectorLevel level, Effect3DFloor extrafloor)
|
||||
{
|
||||
WorldVertex[] verts;
|
||||
Sector s = level.sector;
|
||||
Vector2D texscale;
|
||||
|
||||
base.Setup(level);
|
||||
|
||||
|
||||
base.Setup(level, extrafloor);
|
||||
|
||||
// Fetch ZDoom fields
|
||||
float rotate = Angle2D.DegToRad(s.Fields.GetValue("rotationfloor", 0.0f));
|
||||
Vector2D offset = new Vector2D(s.Fields.GetValue("xpanningfloor", 0.0f),
|
||||
|
@ -152,7 +152,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
// This changes the height
|
||||
protected override void ChangeHeight(int amount)
|
||||
{
|
||||
if(level.sector == Sector.Sector)
|
||||
if((extrafloor == null) || extrafloor.VavoomType)
|
||||
{
|
||||
mode.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, level.sector.FixedIndex);
|
||||
level.sector.FloorHeight += amount;
|
||||
|
|
Loading…
Reference in a new issue