Made Skulltag item sprites optional to support default Skulltag+Zandronum config without producing 100 errors

This commit is contained in:
ZZYZX 2017-03-09 19:09:08 +02:00
parent 589b674656
commit ee28f1d094
6 changed files with 66 additions and 7 deletions

View file

@ -100,6 +100,7 @@ doomheretichexen
height = 40;
hangs = 0;
blocking = 0;
optional = true;
5030
{
@ -156,7 +157,9 @@ doomheretichexen
hangs = 0;
blocking = 2;
error = 2;
optional = true;
// Skulltag
5120
{
title = "Impaling Spike";
@ -224,6 +227,7 @@ doomheretichexen
height = 16;
hangs = 0;
blocking = 0;
optional = true;
5058
{
@ -354,6 +358,7 @@ doomheretichexen
hangs = 0;
blocking = 1;
error = 2;
optional = true;
5150
{
@ -420,6 +425,7 @@ doomheretichexen
hangs = 0;
blocking = 2;
error = 2;
optional = true;
5020
{
@ -513,6 +519,7 @@ doomheretichexen
height = 45;
hangs = 0;
blocking = 0;
optional = true;
5248
{
@ -592,6 +599,7 @@ doom
hangs = 0;
blocking = 2;
error = 2;
optional = true;
5004
{
@ -640,6 +648,7 @@ doom
width = "16";
height = "56";
sprite = "SKULA1";
optional = false;
}
}
@ -655,6 +664,7 @@ doom
height = 25;
hangs = 0;
blocking = 0;
optional = true;
5014
{
@ -689,6 +699,7 @@ doom
height = 20;
hangs = 0;
blocking = 0;
optional = true;
5091
{
@ -722,8 +733,9 @@ doom
5039
{
title = "Random powerup";
sprite = "DOOMA0";
sprite = "MEGAA0";
height = 45;
optional = true;
}
2016
@ -753,6 +765,7 @@ doom
{
title = "Hissy";
sprite = "HISYA1";
optional = true;
}
}
@ -775,6 +788,7 @@ doom
title = "Dark Imp Spawner";
sprite = "DIMPA2A8";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5209
{
@ -782,6 +796,7 @@ doom
width = 30;
sprite = "SRG2A2A8";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5219
{
@ -790,6 +805,7 @@ doom
sprite = "HECTC2C8";
height = 64;
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5223
{
@ -797,6 +813,7 @@ doom
width = 24;
sprite = "BOS3A2A8";
height = 64;
optional = true;
}
// Doom
@ -961,24 +978,28 @@ doom
title = "Minigun Spawner";
sprite = "MNGNA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5273
{
title = "Grenade Launcher Spawner";
sprite = "GLAUA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5275
{
title = "Railgun Spawner";
sprite = "RAILA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5277
{
title = "BFG10000 Spawner";
sprite = "BFG2A0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
// Doom
@ -1116,18 +1137,21 @@ doom
title = "Max. Health Bonus Spawner";
sprite = "BON3A0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5234
{
title = "Max. Armor Bonus Spawner";
sprite = "BON4A0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5237
{
title = "Red Armor Spawner";
sprite = "ARM3A0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
// Doom
@ -1187,18 +1211,21 @@ doom
title = "Invisibility Spawner";
sprite = "INVSA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5247
{
title = "Turbosphere Spawner";
sprite = "TURBA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5238
{
title = "Doomsphere Spawner";
sprite = "DOOMA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5239
{
@ -1206,12 +1233,14 @@ doom
sprite = "GARDA0";
height = 30;
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
5246
{
title = "Time Freeze Spawner";
sprite = "TIMEA0";
include("Zandronum_misc.cfg", "invasionspawnerargs");
optional = true;
}
// Doom

View file

@ -65,6 +65,9 @@ namespace CodeImp.DoomBuilder.Config
//mxd. Validity
private bool isinvalid;
// [ZZ]
private bool optional;
#endregion
@ -91,6 +94,7 @@ namespace CodeImp.DoomBuilder.Config
public bool AbsoluteZ { get { return absolutez; } }
public float SpriteScale { get { return spritescale; } }
public List<ThingTypeInfo> Things { get { return things; } }
public bool Optional { get { return optional; } }
#endregion
@ -123,6 +127,7 @@ namespace CodeImp.DoomBuilder.Config
this.fixedrotation = parent.fixedrotation;
this.absolutez = parent.absolutez;
this.spritescale = parent.spritescale;
this.optional = parent.optional;
}
// Set default properties
else
@ -142,6 +147,7 @@ namespace CodeImp.DoomBuilder.Config
this.fixedrotation = false; //mxd
this.absolutez = false;
this.spritescale = 1.0f;
this.optional = false;
}
//mxd. Apply DecorateCategoryInfo overrides...
@ -208,7 +214,8 @@ namespace CodeImp.DoomBuilder.Config
this.fixedrotation = cfg.ReadSetting("thingtypes." + name + ".fixedrotation", parent.fixedrotation);
this.absolutez = cfg.ReadSetting("thingtypes." + name + ".absolutez", parent.absolutez);
this.spritescale = cfg.ReadSetting("thingtypes." + name + ".spritescale", parent.spritescale);
}
this.optional = cfg.ReadSetting("thingtypes." + name + ".optional", parent.optional);
}
else
{
this.sprite = cfg.ReadSetting("thingtypes." + name + ".sprite", "");
@ -226,7 +233,8 @@ namespace CodeImp.DoomBuilder.Config
this.fixedrotation = cfg.ReadSetting("thingtypes." + name + ".fixedrotation", false); //mxd
this.absolutez = cfg.ReadSetting("thingtypes." + name + ".absolutez", false);
this.spritescale = cfg.ReadSetting("thingtypes." + name + ".spritescale", 1.0f);
}
this.optional = cfg.ReadSetting("thingtypes." + name + ".optional", false);
}
// Safety
if(this.radius < 4f) this.radius = 8f;

View file

@ -100,6 +100,9 @@ namespace CodeImp.DoomBuilder.Config
// [ZZ] GZDoom inheritance data (DECORATE and ZScript). used for dynamic lighting.
private int dynamiclighttype = -1;
// [ZZ] optional thing is a thing that can have nonexistent sprite. this is currently only used for Skulltag things.
private bool optional;
#endregion
@ -149,6 +152,9 @@ namespace CodeImp.DoomBuilder.Config
// [ZZ] GZDoom inheritance data
public int DynamicLightType { get { return dynamiclighttype; } set { if (dynamiclighttype < 0) dynamiclighttype = value; } }
// [ZZ]
public bool Optional { get { return optional; } }
#endregion
@ -187,6 +193,7 @@ namespace CodeImp.DoomBuilder.Config
this.locksprite = false; //mxd
this.flagsrename = new Dictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase); //mxd
this.thinglink = 0;
this.optional = false; // [ZZ]
// We have no destructor
GC.SuppressFinalize(this);
@ -261,6 +268,9 @@ namespace CodeImp.DoomBuilder.Config
//mxd. Create sprite frame
this.spriteframe = new[] { new SpriteFrameInfo { Sprite = sprite, SpriteLongName = Lump.MakeLongName(sprite, true) } };
// [ZZ] optional thing sprite.
this.optional = cfg.ReadSetting("thingtypes." + cat.Name + "." + key + ".optional", cat.Optional);
// We have no destructor
GC.SuppressFinalize(this);
}
@ -306,6 +316,8 @@ namespace CodeImp.DoomBuilder.Config
//mxd. Create sprite frame
this.spriteframe = new[] { new SpriteFrameInfo { Sprite = sprite, SpriteLongName = Lump.MakeLongName(sprite, true) } };
this.optional = false; // [ZZ]
// We have no destructor
GC.SuppressFinalize(this);
}
@ -352,6 +364,9 @@ namespace CodeImp.DoomBuilder.Config
//mxd. Create sprite frame
this.spriteframe = new[] { new SpriteFrameInfo { Sprite = sprite, SpriteLongName = Lump.MakeLongName(sprite, true) } };
//
this.optional = false; // [ZZ]
// We have no destructor
GC.SuppressFinalize(this);
}
@ -399,6 +414,9 @@ namespace CodeImp.DoomBuilder.Config
//mxd. Create sprite frame
this.spriteframe = new[] { new SpriteFrameInfo { Sprite = sprite, SpriteLongName = Lump.MakeLongName(sprite, true) } };
//
this.optional = false; // [ZZ]
// We have no destructor
GC.SuppressFinalize(this);
}
@ -448,6 +466,9 @@ namespace CodeImp.DoomBuilder.Config
//
this.dynamiclighttype = other.dynamiclighttype;
//
this.optional = other.optional;
// We have no destructor
GC.SuppressFinalize(this);
}

View file

@ -1624,7 +1624,8 @@ namespace CodeImp.DoomBuilder.Data
}
else
{
General.ErrorLogger.Add(ErrorType.Error, "Unable to find sprite lump \"" + info.Sprite + "\" used by actor \"" + ti.Title + "\":" + ti.Index + ". Forgot to include required resources?");
if (!ti.Optional)
General.ErrorLogger.Add(ErrorType.Error, "Unable to find sprite lump \"" + info.Sprite + "\" used by actor \"" + ti.Title + "\":" + ti.Index + ". Forgot to include required resources?");
}
}
else

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2939")]
[assembly: AssemblyVersion("2.3.0.2941")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("4f8f390")]
[assembly: AssemblyHash("589b674")]

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2939")]
[assembly: AssemblyVersion("2.3.0.2941")]
[assembly: NeutralResourcesLanguageAttribute("en")]