mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Added "AbsoluteZ" option to things in game configurations for things that use absolute Z height values
This commit is contained in:
parent
209c73efa4
commit
a80eb538df
10 changed files with 50 additions and 15 deletions
|
@ -6773,12 +6773,14 @@ thingtypes
|
|||
{
|
||||
title = "Vertex slope floor";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
|
||||
1505
|
||||
{
|
||||
title = "Vertex slope ceiling";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7039,12 +7039,14 @@ thingtypes
|
|||
{
|
||||
title = "Vertex slope floor";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
|
||||
1505
|
||||
{
|
||||
title = "Vertex slope ceiling";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7253,12 +7253,14 @@ thingtypes
|
|||
{
|
||||
title = "Vertex slope floor";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
|
||||
1505
|
||||
{
|
||||
title = "Vertex slope ceiling";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6176,12 +6176,14 @@ thingtypes
|
|||
{
|
||||
title = "Vertex slope floor";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
|
||||
1505
|
||||
{
|
||||
title = "Vertex slope ceiling";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7244,12 +7244,14 @@ thingtypes
|
|||
{
|
||||
title = "Vertex slope floor";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
|
||||
1505
|
||||
{
|
||||
title = "Vertex slope ceiling";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6580,12 +6580,14 @@ thingtypes
|
|||
{
|
||||
title = "Vertex slope floor";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
|
||||
1505
|
||||
{
|
||||
title = "Vertex slope ceiling";
|
||||
height = 8;
|
||||
absolutez = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
// Determine position
|
||||
Vector3D pos = Thing.Position;
|
||||
if(info.Hangs)
|
||||
if(info.AbsoluteZ)
|
||||
{
|
||||
// Absolute Z position
|
||||
pos.z = Thing.Position.z;
|
||||
}
|
||||
else if(info.Hangs)
|
||||
{
|
||||
// Hang from ceiling
|
||||
if(Thing.Sector != null) pos.z = Thing.Sector.CeilHeight - info.Height;
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private int blocking;
|
||||
private int errorcheck;
|
||||
private bool fixedsize;
|
||||
private bool absolutez;
|
||||
|
||||
// Disposing
|
||||
private bool isdisposed = false;
|
||||
|
@ -79,6 +80,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
public int ErrorCheck { get { return errorcheck; } }
|
||||
public bool FixedSize { get { return fixedsize; } }
|
||||
public bool IsDisposed { get { return isdisposed; } }
|
||||
public bool AbsoluteZ { get { return absolutez; } }
|
||||
public List<ThingTypeInfo> Things { get { return things; } }
|
||||
|
||||
#endregion
|
||||
|
@ -104,6 +106,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.blocking = 0;
|
||||
this.errorcheck = 1;
|
||||
this.fixedsize = false;
|
||||
this.absolutez = false;
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -131,6 +134,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.blocking = cfg.ReadSetting("thingtypes." + name + ".blocking", 0);
|
||||
this.errorcheck = cfg.ReadSetting("thingtypes." + name + ".error", 1);
|
||||
this.fixedsize = cfg.ReadSetting("thingtypes." + name + ".fixedsize", false);
|
||||
this.absolutez = cfg.ReadSetting("thingtypes." + name + ".absolutez", false);
|
||||
|
||||
// Safety
|
||||
if(this.radius < 4f) this.radius = 8f;
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private ThingCategory category;
|
||||
private ArgumentInfo[] args;
|
||||
private bool isknown;
|
||||
private bool absolutez;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -85,6 +86,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
public ArgumentInfo[] Args { get { return args; } }
|
||||
public bool IsKnown { get { return isknown; } }
|
||||
public bool IsNull { get { return (index == 0); } }
|
||||
public bool AbsoluteZ { get { return absolutez; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -109,6 +111,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.spritelongname = long.MaxValue;
|
||||
this.args = new ArgumentInfo[Linedef.NUM_ARGS];
|
||||
this.isknown = false;
|
||||
this.absolutez = false;
|
||||
|
||||
// We have no destructor
|
||||
GC.SuppressFinalize(this);
|
||||
|
@ -136,6 +139,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.blocking = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".blocking", cat.Blocking);
|
||||
this.errorcheck = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".error", cat.ErrorCheck);
|
||||
this.fixedsize = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".fixedsize", cat.FixedSize);
|
||||
this.absolutez = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".absolutez", cat.AbsoluteZ);
|
||||
|
||||
// Read the args
|
||||
for(int i = 0; i < Linedef.NUM_ARGS; i++)
|
||||
|
@ -177,6 +181,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.blocking = cat.Blocking;
|
||||
this.errorcheck = cat.ErrorCheck;
|
||||
this.fixedsize = cat.FixedSize;
|
||||
this.absolutez = cat.AbsoluteZ;
|
||||
|
||||
// Safety
|
||||
if(this.radius < 4f) this.radius = 8f;
|
||||
|
@ -212,6 +217,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
this.blocking = cat.Blocking;
|
||||
this.errorcheck = cat.ErrorCheck;
|
||||
this.fixedsize = cat.FixedSize;
|
||||
this.absolutez = cat.AbsoluteZ;
|
||||
|
||||
// Safety
|
||||
if(this.radius < 4f) this.radius = 8f;
|
||||
|
|
|
@ -110,24 +110,32 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
// Determine z info to show
|
||||
t.DetermineSector();
|
||||
if(t.Sector != null)
|
||||
if(ti.AbsoluteZ)
|
||||
{
|
||||
// Hangs from ceiling?
|
||||
if(ti.Hangs)
|
||||
{
|
||||
zvalue = (float)t.Sector.CeilHeight + t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
zvalue = (float)t.Sector.FloorHeight + t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
zvalue = t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
zvalue = t.Position.z;
|
||||
if(zvalue >= 0.0f) zinfo = "+" + zvalue.ToString(); else zinfo = zvalue.ToString();
|
||||
if(t.Sector != null)
|
||||
{
|
||||
// Hangs from ceiling?
|
||||
if(ti.Hangs)
|
||||
{
|
||||
zvalue = (float)t.Sector.CeilHeight + t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
zvalue = (float)t.Sector.FloorHeight + t.Position.z;
|
||||
zinfo = zvalue.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
zvalue = t.Position.z;
|
||||
if(zvalue >= 0.0f) zinfo = "+" + zvalue.ToString(); else zinfo = zvalue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// Thing info
|
||||
|
|
Loading…
Reference in a new issue