mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-20 10:53:19 +00:00
Fixed, Script Editor: named scripts were not shown in the script navigator drop-down when current map was not in UDMF.
This commit is contained in:
parent
3343f6d2c7
commit
38d2b14570
2 changed files with 5 additions and 23 deletions
|
@ -402,9 +402,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
DecorateParserSE parser = new DecorateParserSE();
|
||||
parser.Parse(stream, "DECORATE");
|
||||
|
||||
if (parser.Actors.Count == 0) return;
|
||||
|
||||
navigator.Items.AddRange(parser.Actors.ToArray());
|
||||
}
|
||||
|
||||
|
@ -417,9 +414,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
ModeldefParserSE parser = new ModeldefParserSE();
|
||||
parser.Parse(stream, "MODELDEF");
|
||||
|
||||
if (parser.Models.Count == 0) return;
|
||||
|
||||
navigator.Items.AddRange(parser.Models.ToArray());
|
||||
}
|
||||
|
||||
|
@ -432,10 +426,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
AcsParserSE parser = new AcsParserSE();
|
||||
parser.Parse(stream, "ACS");
|
||||
|
||||
if (parser.NamedScripts.Count == 0 && parser.NumberedScripts.Count == 0 && parser.Functions.Count == 0) return;
|
||||
|
||||
if(General.Map.UDMF) navigator.Items.AddRange(parser.NamedScripts.ToArray());
|
||||
navigator.Items.AddRange(parser.NamedScripts.ToArray());
|
||||
navigator.Items.AddRange(parser.NumberedScripts.ToArray());
|
||||
navigator.Items.AddRange(parser.Functions.ToArray());
|
||||
}
|
||||
|
|
|
@ -1710,29 +1710,20 @@ namespace CodeImp.DoomBuilder
|
|||
MemoryStream stream = GetLumpData(maplumpinfo.Name);
|
||||
if (stream != null)
|
||||
{
|
||||
// Get script names
|
||||
AcsParserSE parser = new AcsParserSE();
|
||||
parser.OnInclude = UpdateScriptsFromLocation;
|
||||
parser.Parse(stream, "SCRIPTS", true, false);
|
||||
|
||||
if(parser.NamedScripts.Count > 0 && (FormatInterface is DoomMapSetIO || FormatInterface is HexenMapSetIO))
|
||||
{
|
||||
List<string> names = new List<string>();
|
||||
foreach(ScriptItem item in parser.NamedScripts)
|
||||
names.Add("'" + item.Name + "'");
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Current map format doesn't support named scripts! Following scripts will not work:" + string.Join(", ", names.ToArray()));
|
||||
}
|
||||
else
|
||||
{
|
||||
namedScripts.AddRange(parser.NamedScripts);
|
||||
}
|
||||
|
||||
// Add them to arrays
|
||||
namedScripts.AddRange(parser.NamedScripts);
|
||||
numberedScripts.AddRange(parser.NumberedScripts);
|
||||
scriptincludes.AddRange(parser.Includes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//sort
|
||||
// Sort script names
|
||||
namedScripts.Sort(ScriptItem.SortByName);
|
||||
numberedScripts.Sort(ScriptItem.SortByIndex);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue