mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-21 19:31:05 +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();
|
DecorateParserSE parser = new DecorateParserSE();
|
||||||
parser.Parse(stream, "DECORATE");
|
parser.Parse(stream, "DECORATE");
|
||||||
|
|
||||||
if (parser.Actors.Count == 0) return;
|
|
||||||
|
|
||||||
navigator.Items.AddRange(parser.Actors.ToArray());
|
navigator.Items.AddRange(parser.Actors.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,9 +414,6 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
|
|
||||||
ModeldefParserSE parser = new ModeldefParserSE();
|
ModeldefParserSE parser = new ModeldefParserSE();
|
||||||
parser.Parse(stream, "MODELDEF");
|
parser.Parse(stream, "MODELDEF");
|
||||||
|
|
||||||
if (parser.Models.Count == 0) return;
|
|
||||||
|
|
||||||
navigator.Items.AddRange(parser.Models.ToArray());
|
navigator.Items.AddRange(parser.Models.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,10 +426,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
|
|
||||||
AcsParserSE parser = new AcsParserSE();
|
AcsParserSE parser = new AcsParserSE();
|
||||||
parser.Parse(stream, "ACS");
|
parser.Parse(stream, "ACS");
|
||||||
|
navigator.Items.AddRange(parser.NamedScripts.ToArray());
|
||||||
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.NumberedScripts.ToArray());
|
navigator.Items.AddRange(parser.NumberedScripts.ToArray());
|
||||||
navigator.Items.AddRange(parser.Functions.ToArray());
|
navigator.Items.AddRange(parser.Functions.ToArray());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1710,29 +1710,20 @@ namespace CodeImp.DoomBuilder
|
||||||
MemoryStream stream = GetLumpData(maplumpinfo.Name);
|
MemoryStream stream = GetLumpData(maplumpinfo.Name);
|
||||||
if (stream != null)
|
if (stream != null)
|
||||||
{
|
{
|
||||||
|
// Get script names
|
||||||
AcsParserSE parser = new AcsParserSE();
|
AcsParserSE parser = new AcsParserSE();
|
||||||
parser.OnInclude = UpdateScriptsFromLocation;
|
parser.OnInclude = UpdateScriptsFromLocation;
|
||||||
parser.Parse(stream, "SCRIPTS", true, false);
|
parser.Parse(stream, "SCRIPTS", true, false);
|
||||||
|
|
||||||
if(parser.NamedScripts.Count > 0 && (FormatInterface is DoomMapSetIO || FormatInterface is HexenMapSetIO))
|
// Add them to arrays
|
||||||
{
|
namedScripts.AddRange(parser.NamedScripts);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
numberedScripts.AddRange(parser.NumberedScripts);
|
numberedScripts.AddRange(parser.NumberedScripts);
|
||||||
scriptincludes.AddRange(parser.Includes);
|
scriptincludes.AddRange(parser.Includes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//sort
|
// Sort script names
|
||||||
namedScripts.Sort(ScriptItem.SortByName);
|
namedScripts.Sort(ScriptItem.SortByName);
|
||||||
numberedScripts.Sort(ScriptItem.SortByIndex);
|
numberedScripts.Sort(ScriptItem.SortByIndex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue