DECORATE parser: added special handling for ZDoom's special sprite names (namely TNT1, "####" and "----").

Internal: changed the way apppath is acquired. It should no longer fail when launching the editor from a shared network folder.
Main Form: changed some labels of dynamic light and model rendering selectors to be less confusing.
Updated ZDoom_DECORATE.cfg.
This commit is contained in:
MaxED 2015-01-03 18:43:37 +00:00
parent be14f852ec
commit 9c11d7e682
7 changed files with 45 additions and 18 deletions

View file

@ -235,8 +235,8 @@ keywords
A_SetCrosshair = "A_SetCrosshair(int number)"; A_SetCrosshair = "A_SetCrosshair(int number)";
//Weapon attack functions //Weapon attack functions
A_Punch = "A_Punch"; A_Punch = "A_Punch";
A_Saw = "A_Saw[(string fullsound = \"weapons/sawfull\"[, string hitsound = \"weapons/sawhit\"[, int damage = 0[, string pufftype = \"BulletPuff\"[, int flags = 0[, float range = 65.0[, float spread_xy = 2.8125[, float spread_z = 0[, float lifesteal = 0]]]]]]]])]"; A_Saw = "A_Saw[(string fullsound = \"weapons/sawfull\"[, string hitsound = \"weapons/sawhit\"[, int damage = 0[, string pufftype = \"BulletPuff\"[, int flags = 0[, float range = 65.0[, float spread_xy = 2.8125[, float spread_z = 0[, float lifesteal = 0[, int lifestealmax = 0[, string armorbonustype = \"ArmorBonus\"]]]]]]]]]])]";
A_CustomPunch = "A_CustomPunch(int damage[, bool norandom = false[, int flags = 0[, string pufftype = \"BulletPuff\"[, float range = 64.0[, float lifesteal = 0]]]]])"; A_CustomPunch = "A_CustomPunch(int damage[, bool norandom = false[, int flags = 0[, string pufftype = \"BulletPuff\"[, float range = 64.0[, float lifesteal = 0[, int lifestealmax = 0[, string armorbonustype = \"ArmorBonus\"]]]]]]])";
A_FireBullets = "A_FireBullets(int spread_horz, int spread_vert, int numbullets, int damage[, string pufftype = \"\"[, int flags = FBF_USEAMMO[, float range = 0]]])"; A_FireBullets = "A_FireBullets(int spread_horz, int spread_vert, int numbullets, int damage[, string pufftype = \"\"[, int flags = FBF_USEAMMO[, float range = 0]]])";
A_FireCustomMissile = "A_FireCustomMissile(string missiletype[, int angle = 0[, bool useammo = false[, int spawnofs_horz = 0[, int spawnheight = 0[, bool aim = false OR int flags = 0[, angle pitch = 0]]]]]])"; A_FireCustomMissile = "A_FireCustomMissile(string missiletype[, int angle = 0[, bool useammo = false[, int spawnofs_horz = 0[, int spawnheight = 0[, bool aim = false OR int flags = 0[, angle pitch = 0]]]]]])";
A_RailAttack = "A_RailAttack(int damage[, int spawnofs_horz[, bool useammo[, color ringcolor[, color corecolor[, int flags[, int maxdiff[, string pufftype[, float spread_xy = 0[, float spread_z = 0[, fixed range = 8192[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, string spawnclass[, float spawnofs_z = 0]]]]]]]]]]]]]]])"; A_RailAttack = "A_RailAttack(int damage[, int spawnofs_horz[, bool useammo[, color ringcolor[, color corecolor[, int flags[, int maxdiff[, string pufftype[, float spread_xy = 0[, float spread_z = 0[, fixed range = 8192[, int duration = 35[, float sparsity = 1.0[, float driftspeed = 1.0[, string spawnclass[, float spawnofs_z = 0]]]]]]]]]]]]]]])";
@ -304,6 +304,7 @@ keywords
A_Blast = "A_Blast[(int flags = 0[, int strength = 255[, int radius = 255[, float speed = 20[, string blasteffect = \"BlastEffect\"[, sound blastsound = \"BlastRadius\"]]]]])]"; A_Blast = "A_Blast[(int flags = 0[, int strength = 255[, int radius = 255[, float speed = 20[, string blasteffect = \"BlastEffect\"[, sound blastsound = \"BlastRadius\"]]]]])]";
A_DropWeaponPieces = "A_DropWeaponPieces(string actorclass1, string actorclass2, string actorclass3)"; A_DropWeaponPieces = "A_DropWeaponPieces(string actorclass1, string actorclass2, string actorclass3)";
A_Feathers = "A_Feathers"; A_Feathers = "A_Feathers";
A_GauntletAttack = "A_GauntletAttack(int power)";
A_GiveQuestItem = "A_GiveQuestItem(int itemnum)"; A_GiveQuestItem = "A_GiveQuestItem(int itemnum)";
A_PigPain = "A_PigPain"; A_PigPain = "A_PigPain";
A_RemoveForcefield = "A_RemoveForcefield"; A_RemoveForcefield = "A_RemoveForcefield";
@ -320,7 +321,7 @@ keywords
random = "random[identifier](min, max)\nReturns a random integer value between min and max."; random = "random[identifier](min, max)\nReturns a random integer value between min and max.";
random2 = "random2[identifier](mask)\nReturns a random integer value between -mask and +mask."; random2 = "random2[identifier](mask)\nReturns a random integer value between -mask and +mask.";
frandom = "frandom[identifier](min, max)\nReturns a random floating point value between min and max."; frandom = "frandom[identifier](min, max)\nReturns a random floating point value between min and max.";
pick = "pick[identifier](int, ...)\nPicks a number from the numbers placed in it.\nThis can take an unlimited amount of parameters."; randompick = "randompick[identifier](int, ...)\nPicks a number from the numbers placed in it.\nThis can take an unlimited amount of parameters.";
//State keywords //State keywords
Bright = "Bright"; Bright = "Bright";
CanRaise = "CanRaise"; CanRaise = "CanRaise";
@ -459,6 +460,8 @@ constants
CPF_DAGGER; CPF_DAGGER;
CPF_PULLIN; CPF_PULLIN;
CPF_NORANDOMPUFFZ; CPF_NORANDOMPUFFZ;
CPF_NOTURN;
CPF_STEALARMOR;
FBF_USEAMMO; FBF_USEAMMO;
FBF_NOFLASH; FBF_NOFLASH;
FBF_NORANDOM; FBF_NORANDOM;
@ -861,6 +864,7 @@ constants
SF_RANDOMLIGHTBOTH; SF_RANDOMLIGHTBOTH;
SF_RANDOMLIGHTHIT; SF_RANDOMLIGHTHIT;
SF_RANDOMLIGHTMISS; SF_RANDOMLIGHTMISS;
SF_STEALARMOR;
SMF_CURSPEED; SMF_CURSPEED;
SMF_LOOK; SMF_LOOK;
SMF_PRECISE; SMF_PRECISE;

View file

@ -75,7 +75,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
"I'm sorry... :(", "I'm sorry... :(",
"This is a horrbble day for you, and of course, the world", "This is a horrbble day for you, and of course, the world",
"Abort, Retry, Fail?", "Abort, Retry, Fail?",
"You are making progress. I'm afraid that's something I cannot allow to happen", "You are making progress. I'm afraid that's something I can't allow to happen",
"You are making progress. That's not OK", "You are making progress. That's not OK",
"No errors found, restarting computer", "No errors found, restarting computer",
"Does Not Compute!", "Does Not Compute!",
@ -112,6 +112,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Windows
"Good. It's boring here anyway.", "Good. It's boring here anyway.",
"Shameful display!", "Shameful display!",
"It's CRASHENING!", "It's CRASHENING!",
"W-W-W-WIPEOUT!",
"EVERYTHING IS LOST!",
}; };
this.Text = titles[new Random().Next(0, titles.Length - 1)]; this.Text = titles[new Random().Next(0, titles.Length - 1)];
} }

View file

@ -569,8 +569,9 @@ namespace CodeImp.DoomBuilder
thisasm = Assembly.GetExecutingAssembly(); thisasm = Assembly.GetExecutingAssembly();
// Find application path // Find application path
Uri localpath = new Uri(Path.GetDirectoryName(thisasm.GetName().CodeBase) + Path.DirectorySeparatorChar); //Uri localpath = new Uri(Path.GetDirectoryName(thisasm.GetName().CodeBase));
apppath = Uri.UnescapeDataString(localpath.AbsolutePath); //apppath = Uri.UnescapeDataString(localpath.AbsolutePath);
apppath = Path.GetDirectoryName(Application.ExecutablePath); //mxd. What was the point of using Uri here (other than to prevent lauching from a shared folder)?
// Setup directories // Setup directories
temppath = Path.GetTempPath(); temppath = Path.GetTempPath();

View file

@ -1573,7 +1573,7 @@ namespace CodeImp.DoomBuilder.Windows
this.sightsdontshow.Name = "sightsdontshow"; this.sightsdontshow.Name = "sightsdontshow";
this.sightsdontshow.Size = new System.Drawing.Size(237, 22); this.sightsdontshow.Size = new System.Drawing.Size(237, 22);
this.sightsdontshow.Tag = 0; this.sightsdontshow.Tag = 0;
this.sightsdontshow.Text = "No dynamic lights"; this.sightsdontshow.Text = "Don't show dynamic lights";
this.sightsdontshow.Click += new System.EventHandler(this.ChangeLightRenderingMode); this.sightsdontshow.Click += new System.EventHandler(this.ChangeLightRenderingMode);
// //
// lightsshow // lightsshow
@ -1629,7 +1629,7 @@ namespace CodeImp.DoomBuilder.Windows
this.modelsshowselection.Name = "modelsshowselection"; this.modelsshowselection.Name = "modelsshowselection";
this.modelsshowselection.Size = new System.Drawing.Size(245, 22); this.modelsshowselection.Size = new System.Drawing.Size(245, 22);
this.modelsshowselection.Tag = 1; this.modelsshowselection.Tag = 1;
this.modelsshowselection.Text = "Show models for selected things"; this.modelsshowselection.Text = "Show models for selected things only";
this.modelsshowselection.Click += new System.EventHandler(this.ChangeModelRenderingMode); this.modelsshowselection.Click += new System.EventHandler(this.ChangeModelRenderingMode);
// //
// modelsshowall // modelsshowall
@ -1639,7 +1639,7 @@ namespace CodeImp.DoomBuilder.Windows
this.modelsshowall.Name = "modelsshowall"; this.modelsshowall.Name = "modelsshowall";
this.modelsshowall.Size = new System.Drawing.Size(245, 22); this.modelsshowall.Size = new System.Drawing.Size(245, 22);
this.modelsshowall.Tag = 2; this.modelsshowall.Tag = 2;
this.modelsshowall.Text = "Show all models"; this.modelsshowall.Text = "Always show models";
this.modelsshowall.Click += new System.EventHandler(this.ChangeModelRenderingMode); this.modelsshowall.Click += new System.EventHandler(this.ChangeModelRenderingMode);
// //
// buttontogglefog // buttontogglefog

View file

@ -374,7 +374,11 @@ namespace CodeImp.DoomBuilder.Windows
else else
{ {
// Show normal caption // Show normal caption
#if DEBUG
this.Text = Application.ProductName + " - DEVBUILD";
#else
this.Text = Application.ProductName + " v" + Application.ProductVersion; this.Text = Application.ProductName + " v" + Application.ProductVersion;
#endif
} }
// Update the status bar // Update the status bar

View file

@ -27,9 +27,6 @@ namespace CodeImp.DoomBuilder.ZDoom
{ {
#region ================== Constants #region ================== Constants
// Some odd thing in ZDoom
internal const string IGNORE_SPRITE = "TNT1A0";
#endregion #endregion
#region ================== Variables #region ================== Variables
@ -97,7 +94,15 @@ namespace CodeImp.DoomBuilder.ZDoom
else else
{ {
// First part of the sprite name // First part of the sprite name
if(token == null) if(string.IsNullOrEmpty(token))
{
parser.ReportError("Unexpected end of structure");
return;
}
//mxd. First part of the sprite name can be quoted
token = parser.StripTokenQuotes(token);
if(string.IsNullOrEmpty(token))
{ {
parser.ReportError("Unexpected end of structure"); parser.ReportError("Unexpected end of structure");
return; return;
@ -112,6 +117,14 @@ namespace CodeImp.DoomBuilder.ZDoom
return; return;
} }
//mxd. Frames can be quoted
spriteframes = parser.StripTokenQuotes(spriteframes);
if(spriteframes == null)
{
parser.ReportError("Unexpected end of structure");
return;
}
// Label? // Label?
if(spriteframes == ":") if(spriteframes == ":")
{ {
@ -129,8 +142,8 @@ namespace CodeImp.DoomBuilder.ZDoom
string spritename = token + spriteframes[0]; string spritename = token + spriteframes[0];
spritename = spritename.ToUpperInvariant(); spritename = spritename.ToUpperInvariant();
// Ignore some odd ZDoom thing // Ignore some odd ZDoom things
if(!IGNORE_SPRITE.StartsWith(spritename)) if (!spritename.StartsWith("TNT1") && !spritename.StartsWith("----") && !spritename.Contains("#"))
sprites.Add(spritename); sprites.Add(spritename);
} }
@ -158,10 +171,10 @@ namespace CodeImp.DoomBuilder.ZDoom
} }
//mxd //mxd
internal StateStructure(string spriteName) internal StateStructure(string spritename)
{ {
this.gotostate = null; this.gotostate = null;
this.sprites = new List<string>() { spriteName }; this.sprites = new List<string> { spritename };
} }
#endregion #endregion

View file

@ -28,6 +28,9 @@ namespace CodeImp.DoomBuilder.ZDoom
{ {
#region ================== Constants #region ================== Constants
// Some odd thing in ZDoom
private const string IGNORE_SPRITE = "TNT1A0";
#endregion #endregion
#region ================== Variables #region ================== Variables
@ -177,7 +180,7 @@ namespace CodeImp.DoomBuilder.ZDoom
if (parser.HasError) break; if (parser.HasError) break;
//mxd. Let's ignore TNT1A0 //mxd. Let's ignore TNT1A0
if(pt.Name == StateStructure.IGNORE_SPRITE) break; if(pt.Name == IGNORE_SPRITE) break;
// Add the patch // Add the patch
patches.Add(pt); patches.Add(pt);