diff --git a/File_Format_Library/FileFormats/Layout/BxlytToGL.cs b/File_Format_Library/FileFormats/Layout/BxlytToGL.cs index 28dc9da5..579f4d62 100644 --- a/File_Format_Library/FileFormats/Layout/BxlytToGL.cs +++ b/File_Format_Library/FileFormats/Layout/BxlytToGL.cs @@ -45,6 +45,9 @@ namespace LayoutBXLYT public static void DrawPictureBox(BasePane pane, byte effectiveAlpha, Dictionary Textures) { + if (!Runtime.LayoutEditor.DisplayPicturePane) + return; + Vector2[] TexCoords = new Vector2[] { new Vector2(1,1), new Vector2(0,1), @@ -170,6 +173,9 @@ namespace LayoutBXLYT public static void DrawBoundryPane(BasePane pane, byte effectiveAlpha, List SelectedPanes) { + if (!Runtime.LayoutEditor.DisplayBoundryPane) + return; + Vector2[] TexCoords = new Vector2[] { new Vector2(1,1), new Vector2(0,1), @@ -196,6 +202,10 @@ namespace LayoutBXLYT public static void DrawAlignmentPane(BasePane pane, byte effectiveAlpha, List SelectedPanes) { + if (!Runtime.LayoutEditor.DisplayAlignmentPane) + return; + + Vector2[] TexCoords = new Vector2[] { new Vector2(1,1), new Vector2(0,1), @@ -221,6 +231,9 @@ namespace LayoutBXLYT public static void DrawScissorPane(BasePane pane, byte effectiveAlpha, List SelectedPanes) { + if (!Runtime.LayoutEditor.DisplayScissorPane) + return; + Vector2[] TexCoords = new Vector2[] { new Vector2(1,1), new Vector2(0,1), @@ -246,6 +259,9 @@ namespace LayoutBXLYT public static void DrawWindowPane(BasePane pane, byte effectiveAlpha, Dictionary Textures) { + if (!Runtime.LayoutEditor.DisplayWindowPane) + return; + uint sizeX = (uint)pane.Width; uint sizeY = (uint)pane.Height; diff --git a/File_Format_Library/GUI/BFLYT/LayoutEditor.Designer.cs b/File_Format_Library/GUI/BFLYT/LayoutEditor.Designer.cs index e81e04ba..96127fea 100644 --- a/File_Format_Library/GUI/BFLYT/LayoutEditor.Designer.cs +++ b/File_Format_Library/GUI/BFLYT/LayoutEditor.Designer.cs @@ -50,8 +50,8 @@ this.textConverterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.orthographicViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.displayNullPanesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.displayWindowPanesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.displayyBoundryPanesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.displayWindowPanesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.displayPicturePanesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.backColorDisplay)).BeginInit(); this.stToolStrip1.SuspendLayout(); @@ -254,15 +254,7 @@ this.displayNullPanesToolStripMenuItem.Name = "displayNullPanesToolStripMenuItem"; this.displayNullPanesToolStripMenuItem.Size = new System.Drawing.Size(200, 22); this.displayNullPanesToolStripMenuItem.Text = "Display Null Panes"; - // - // displayWindowPanesToolStripMenuItem - // - this.displayWindowPanesToolStripMenuItem.Checked = true; - this.displayWindowPanesToolStripMenuItem.CheckOnClick = true; - this.displayWindowPanesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.displayWindowPanesToolStripMenuItem.Name = "displayWindowPanesToolStripMenuItem"; - this.displayWindowPanesToolStripMenuItem.Size = new System.Drawing.Size(200, 22); - this.displayWindowPanesToolStripMenuItem.Text = "Display Window Panes"; + this.displayNullPanesToolStripMenuItem.Click += new System.EventHandler(this.displayPanesToolStripMenuItem_Click); // // displayyBoundryPanesToolStripMenuItem // @@ -272,6 +264,17 @@ this.displayyBoundryPanesToolStripMenuItem.Name = "displayyBoundryPanesToolStripMenuItem"; this.displayyBoundryPanesToolStripMenuItem.Size = new System.Drawing.Size(200, 22); this.displayyBoundryPanesToolStripMenuItem.Text = "Displayy Boundry Panes"; + this.displayyBoundryPanesToolStripMenuItem.Click += new System.EventHandler(this.displayPanesToolStripMenuItem_Click); + // + // displayWindowPanesToolStripMenuItem + // + this.displayWindowPanesToolStripMenuItem.Checked = true; + this.displayWindowPanesToolStripMenuItem.CheckOnClick = true; + this.displayWindowPanesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.displayWindowPanesToolStripMenuItem.Name = "displayWindowPanesToolStripMenuItem"; + this.displayWindowPanesToolStripMenuItem.Size = new System.Drawing.Size(200, 22); + this.displayWindowPanesToolStripMenuItem.Text = "Display Window Panes"; + this.displayWindowPanesToolStripMenuItem.Click += new System.EventHandler(this.displayPanesToolStripMenuItem_Click); // // displayPicturePanesToolStripMenuItem // @@ -281,6 +284,7 @@ this.displayPicturePanesToolStripMenuItem.Name = "displayPicturePanesToolStripMenuItem"; this.displayPicturePanesToolStripMenuItem.Size = new System.Drawing.Size(200, 22); this.displayPicturePanesToolStripMenuItem.Text = "Display Picture Panes"; + this.displayPicturePanesToolStripMenuItem.Click += new System.EventHandler(this.displayPanesToolStripMenuItem_Click); // // LayoutEditor // diff --git a/File_Format_Library/GUI/BFLYT/LayoutEditor.cs b/File_Format_Library/GUI/BFLYT/LayoutEditor.cs index f53d3568..38cbe73b 100644 --- a/File_Format_Library/GUI/BFLYT/LayoutEditor.cs +++ b/File_Format_Library/GUI/BFLYT/LayoutEditor.cs @@ -56,6 +56,10 @@ namespace LayoutBXLYT debugShading.Items.Add(type); debugShading.SelectedItem = Runtime.LayoutEditor.Shading; + displayNullPanesToolStripMenuItem.Checked = Runtime.LayoutEditor.DisplayNullPane; + displayyBoundryPanesToolStripMenuItem.Checked = Runtime.LayoutEditor.DisplayBoundryPane; + displayPicturePanesToolStripMenuItem.Checked = Runtime.LayoutEditor.DisplayPicturePane; + displayWindowPanesToolStripMenuItem.Checked = Runtime.LayoutEditor.DisplayWindowPane; ObjectSelected += OnObjectSelected; ObjectChanged += OnObjectChanged; @@ -607,5 +611,16 @@ namespace LayoutBXLYT if (ActiveAnimation != null) SaveActiveFile(ActiveAnimation.FileInfo, false); } + + private void displayPanesToolStripMenuItem_Click(object sender, EventArgs e) + { + Runtime.LayoutEditor.DisplayNullPane = displayNullPanesToolStripMenuItem.Checked; + Runtime.LayoutEditor.DisplayBoundryPane = displayyBoundryPanesToolStripMenuItem.Checked; + Runtime.LayoutEditor.DisplayPicturePane = displayPicturePanesToolStripMenuItem.Checked; + Runtime.LayoutEditor.DisplayWindowPane = displayWindowPanesToolStripMenuItem.Checked; + + if (ActiveViewport != null) + ActiveViewport.UpdateViewport(); + } } } diff --git a/Switch_Toolbox_Library/Config.cs b/Switch_Toolbox_Library/Config.cs index ce7db577..75572357 100644 --- a/Switch_Toolbox_Library/Config.cs +++ b/Switch_Toolbox_Library/Config.cs @@ -255,6 +255,21 @@ namespace Toolbox.Library Enum.TryParse(node.InnerText, out shadingMode); Runtime.LayoutEditor.Shading = shadingMode; break; + case "IsGamePreview": + bool.TryParse(node.InnerText, out Runtime.LayoutEditor.IsGamePreview); + break; + case "DisplayBoundryPane": + bool.TryParse(node.InnerText, out Runtime.LayoutEditor.DisplayBoundryPane); + break; + case "DisplayNullPane": + bool.TryParse(node.InnerText, out Runtime.LayoutEditor.DisplayNullPane); + break; + case "DisplayPicturePane": + bool.TryParse(node.InnerText, out Runtime.LayoutEditor.DisplayPicturePane); + break; + case "DisplayWindowPane": + bool.TryParse(node.InnerText, out Runtime.LayoutEditor.DisplayWindowPane); + break; } } @@ -374,6 +389,11 @@ namespace Toolbox.Library layoutSettingsNode.AppendChild(createNode(doc, "LayoutShadingMode", Runtime.LayoutEditor.Shading.ToString())); layoutSettingsNode.AppendChild(createNode(doc, "LayoutBackgroundColor", ColorTranslator.ToHtml(Runtime.LayoutEditor.BackgroundColor))); + layoutSettingsNode.AppendChild(createNode(doc, "IsGamePreview", Runtime.LayoutEditor.IsGamePreview.ToString())); + layoutSettingsNode.AppendChild(createNode(doc, "DisplayNullPane", Runtime.LayoutEditor.DisplayNullPane.ToString())); + layoutSettingsNode.AppendChild(createNode(doc, "DisplayBoundryPane", Runtime.LayoutEditor.DisplayBoundryPane.ToString())); + layoutSettingsNode.AppendChild(createNode(doc, "DisplayPicturePane", Runtime.LayoutEditor.DisplayPicturePane.ToString())); + layoutSettingsNode.AppendChild(createNode(doc, "DisplayWindowPane", Runtime.LayoutEditor.DisplayWindowPane.ToString())); } private static void AppendDeveloperSettings(XmlDocument doc, XmlNode parentNode) diff --git a/Switch_Toolbox_Library/Runtime.cs b/Switch_Toolbox_Library/Runtime.cs index 15c58c4c..ef4c0050 100644 --- a/Switch_Toolbox_Library/Runtime.cs +++ b/Switch_Toolbox_Library/Runtime.cs @@ -39,6 +39,14 @@ namespace Toolbox.Library public class LayoutEditor { + public static bool IsGamePreview = false; + public static bool DisplayNullPane = true; + public static bool DisplayBoundryPane = true; + public static bool DisplayPicturePane = true; + public static bool DisplayWindowPane = true; + public static bool DisplayAlignmentPane = true; + public static bool DisplayScissorPane = true; + public static Color BackgroundColor = Color.FromArgb(130, 130, 130); public static DebugShading Shading = DebugShading.Default;