Add proper panel toggle by type.

This commit is contained in:
KillzXGaming 2019-09-11 19:52:57 -04:00
parent 0a5b673d35
commit 149cae5a0c
5 changed files with 73 additions and 10 deletions

View file

@ -45,6 +45,9 @@ namespace LayoutBXLYT
public static void DrawPictureBox(BasePane pane, byte effectiveAlpha, Dictionary<string, STGenericTexture> 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<BasePane> 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<BasePane> 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<BasePane> 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<string, STGenericTexture> Textures)
{
if (!Runtime.LayoutEditor.DisplayWindowPane)
return;
uint sizeX = (uint)pane.Width;
uint sizeY = (uint)pane.Height;

View file

@ -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
//

View file

@ -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();
}
}
}

View file

@ -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)

View file

@ -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;