From 4f28c0747f2e9b2f4627d9e40ab3c529dd2b5d0b Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Fri, 18 Sep 2020 18:13:31 -0400 Subject: [PATCH] BXLYT : Fix updating layout instance on new panes (fixes pane name list in bxlan editor) --- File_Format_Library/FileFormats/Layout/Common.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/File_Format_Library/FileFormats/Layout/Common.cs b/File_Format_Library/FileFormats/Layout/Common.cs index 07076c0b..6e5917e8 100644 --- a/File_Format_Library/FileFormats/Layout/Common.cs +++ b/File_Format_Library/FileFormats/Layout/Common.cs @@ -62,10 +62,14 @@ namespace LayoutBXLYT //Adjust necessary parameters if the user changes the name if (name != null && LayoutFile != null) { + Console.WriteLine($"LayoutFile {name} {LayoutFile.PaneLookup.ContainsKey(name)}"); + //Adjust name table entry - if (LayoutFile != null && LayoutFile.PaneLookup.ContainsKey(name)) + if (LayoutFile.PaneLookup.ContainsKey(name)) LayoutFile.PaneLookup.Remove(name); + Console.WriteLine($"LayoutFileR {name} {LayoutFile.PaneLookup.ContainsKey(name)}"); + //Adjust material reference if (this is IPicturePane) ((IPicturePane)this).Material.SetName(name, value); @@ -91,6 +95,11 @@ namespace LayoutBXLYT if (LayoutFile != null && !LayoutFile.PaneLookup.ContainsKey(name)) LayoutFile.PaneLookup.Add(name, this); + + Console.WriteLine($"test {name}"); + + if (LayoutFile != null) + Console.WriteLine($"LayoutFileN {name} {LayoutFile.PaneLookup.ContainsKey(name)}"); } } @@ -2326,6 +2335,7 @@ namespace LayoutBXLYT if (!PaneLookup.ContainsKey(pane.Name)) PaneLookup.Add(pane.Name, pane); + pane.LayoutFile = this; pane.Parent = parent; parent.Childern.Add(pane); parent.NodeWrapper.Nodes.Add(pane.NodeWrapper);