SOC/Lua parser tweaks:

- Make Lua parser ignore unknown properties instead of throwing an error
- Add Title/Angled/NotAngled properties as valid alternatives for Name/Arrow/NoArrow
This commit is contained in:
spherallic 2024-02-10 00:11:01 +01:00
parent 622259d39b
commit 1952932cc1
2 changed files with 13 additions and 6 deletions

View File

@ -160,6 +160,7 @@ namespace CodeImp.DoomBuilder.SRB2
switch (token)
{
case "$Name":
case "$Title":
SkipWhitespace(true);
token = ReadLine();
name = ZDTextParser.StripQuotes(token);
@ -206,9 +207,11 @@ namespace CodeImp.DoomBuilder.SRB2
flagsvaluetext = ZDTextParser.StripQuotes(token);
break;
case "$Arrow":
case "$Angled":
arrow = true;
break;
case "$NoArrow":
case "$NotAngled":
arrow = false;
break;
case "$TagThing":
@ -287,8 +290,7 @@ namespace CodeImp.DoomBuilder.SRB2
blockclosed = true;
break;
default:
ReportError("Unknown object definition parameter " + token);
return false;
break;
}
if (!blockclosed)
{

View File

@ -208,8 +208,13 @@ namespace CodeImp.DoomBuilder.SRB2
{
name = ZDTextParser.StripQuotes(line.Substring(7));
continue;
}
if (line.StartsWith("#$Category "))
}
if (line.StartsWith("#$Title "))
{
name = ZDTextParser.StripQuotes(line.Substring(8));
continue;
}
if (line.StartsWith("#$Category "))
{
category = line.Substring(11);
continue;
@ -236,12 +241,12 @@ namespace CodeImp.DoomBuilder.SRB2
flagsvaluetext = ZDTextParser.StripQuotes(line.Substring(17));
continue;
}
if (line.StartsWith("#$Arrow"))
if (line.StartsWith("#$Arrow") || line.StartsWith("#$Angled"))
{
arrow = true;
continue;
}
if (line.StartsWith("#$NoArrow"))
if (line.StartsWith("#$NoArrow") || line.StartsWith("#$NotAngled"))
{
arrow = false;
continue;