DECORATE: fixed parsing error when whole "States" block is on one line.

Fixed: Incorrect articles were sometimes used in Draw Geometry/Curve/Rectangle/Ellipse info messages.
This commit is contained in:
MaxED 2013-04-15 10:54:55 +00:00
parent 50c004bb2c
commit 83ee9aed4d
4 changed files with 12 additions and 3 deletions

View file

@ -139,6 +139,15 @@ namespace CodeImp.DoomBuilder.ZDoom
{
parser.SkipWhitespace(false);
t = parser.ReadToken();
//mxd. Because stuff like this is also valid: "Actor Oneliner { States { Spawn: WOOT A 1 A_FadeOut(0.1) Loop }}"
if(t == "}") {
// Rewind so that this scope end can be read again
parser.DataStream.Seek(-1, SeekOrigin.Current);
// Done here
return;
}
}
}

View file

@ -139,7 +139,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes
"outstanding", "mysterious", "amusing", "charming", "fantastic", "jolly" };
string word = adjectives[points.Count % adjectives.Length];
word = (points.Count > adjectives.Length) ? "very " + word : word;
string a = ((word[0] == 'a') || (word[0] == 'e') || (word[0] == 'o')) ? "an " : "a ";
string a = ((word[0] == 'a') || (word[0] == 'e') || (word[0] == 'o') || (word[0] == 'u')) ? "an " : "a ";
General.Interface.DisplayStatus(StatusType.Action, "Created " + a + word + " curve.");
List<DrawnVertex> verts = new List<DrawnVertex>();

View file

@ -472,7 +472,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
"outstanding", "mysterious", "amusing", "charming", "fantastic", "jolly" };
string word = adjectives[points.Count % adjectives.Length];
word = (points.Count > adjectives.Length) ? "very " + word : word;
string a = ((word[0] == 'a') || (word[0] == 'e') || (word[0] == 'o')) ? "an " : "a ";
string a = ((word[0] == 'a') || (word[0] == 'e') || (word[0] == 'o') || (word[0] == 'u')) ? "an " : "a ";
General.Interface.DisplayStatus(StatusType.Action, "Created " + a + word + " drawing.");
// Make the drawing

View file

@ -258,7 +258,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes
// Make an analysis and show info
string[] adjectives = new string[] { "gloomy", "sad", "unhappy", "lonely", "troubled", "depressed", "heartsick", "glum", "pessimistic", "bitter", "downcast" }; // aaand my english vocabulary ends here :)
string word = adjectives[new Random().Next(adjectives.Length - 1)];
string a = ((word[0] == 'a') || (word[0] == 'e') || (word[0] == 'o')) ? "an " : "a ";
string a = (word[0] == 'u' ? "an " : "a ");
General.Interface.DisplayStatus(StatusType.Action, "Created " + a + word + " " + shapeName+".");