UDBScript: fixed a problem where hot reloading would not select the previously selected script

This commit is contained in:
biwa 2023-03-06 11:57:10 +01:00
parent 8c30cef65e
commit e1672281e6

View file

@ -235,7 +235,6 @@ namespace CodeImp.DoomBuilder.UDBScript
filetree.Nodes.Clear();
filetree.Nodes.AddRange(AddToTree(filtertext, BuilderPlug.Me.ScriptDirectoryStructure));
//filetree.ExpandAll();
foreach(TreeNode node in filetree.Nodes)
{
@ -259,6 +258,10 @@ namespace CodeImp.DoomBuilder.UDBScript
/// <returns>Found TreeNode or null</returns>
private TreeNode FindScriptTreeNode(string name, TreeNode root)
{
// The "root" node might already be the one we're looking for
if (root.Tag is ScriptInfo && ((ScriptInfo)root.Tag).ScriptFile == name)
return root;
foreach (TreeNode node in root.Nodes)
{
if (node.Tag is ScriptInfo && ((ScriptInfo)node.Tag).ScriptFile == name)