Don't close console when exiting form and fix opening RPF's after refresh in ExtraRootFolders

Console close is already handled in application exit and since the NamedPipe opens other instances within the same instance this would close the console while codewalker is still open
This commit is contained in:
Niek Schoemaker 2023-11-16 16:55:15 +01:00
parent 8c2e444049
commit f21d83cf40
No known key found for this signature in database
GPG Key ID: BDF9404CFECB0006

View File

@ -535,13 +535,23 @@ namespace CodeWalker
if ((CurrentFolder != null) && (CurrentFolder.Path.Equals(path, StringComparison.InvariantCultureIgnoreCase)))
return; //already there
var hierarchy = pathl.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries);
TreeNode? n = MainTreeView.Nodes[0];// FindTreeNode("gta v", null);
TreeNode? n = null;// FindTreeNode("gta v", null);
if (!string.IsNullOrEmpty(path))
{
for (int i = 0; i < hierarchy.Length; i++)
// Loop over all nodes, otherwise RPF's in other folders can't be found
foreach(var startNode in MainTreeView.Nodes)
{
n = FindTreeNode(hierarchy[i], n);
n = (TreeNode?)startNode;
for (int i = 0; i < hierarchy.Length; i++)
{
n = FindTreeNode(hierarchy[i], n);
}
if (n is not null)
{
break;
}
}
}
if (n != null)
{
@ -3888,7 +3898,6 @@ namespace CodeWalker
if (m.Msg == 0x10) // WM_CLOSE
{
ConsoleWindow.Close();
CancellationTokenSource.Cancel();
}
}