1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Add option to always dispay all models

This commit is contained in:
KillzXGaming 2019-07-21 14:09:25 -04:00
parent d25d10c22b
commit 976c214799
6 changed files with 63 additions and 0 deletions

Binary file not shown.

View File

@ -18,6 +18,18 @@ namespace FirstPlugin.Forms
{ {
private bool _displayViewport = true; private bool _displayViewport = true;
private bool _displayAll = false;
public bool DisplayAll
{
get { return _displayAll; }
set
{
_displayAll = value;
if (viewport != null)
viewport.DisplayAll = value;
}
}
public bool DisplayViewport public bool DisplayViewport
{ {
get get
@ -91,6 +103,7 @@ namespace FirstPlugin.Forms
{ {
viewport = new Viewport(ObjectEditor.GetDrawableContainers()); viewport = new Viewport(ObjectEditor.GetDrawableContainers());
viewport.Dock = DockStyle.Fill; viewport.Dock = DockStyle.Fill;
viewport.DisplayAll = DisplayAll;
} }
//If the option is enabled by settings, and it has models display the viewport //If the option is enabled by settings, and it has models display the viewport
@ -150,7 +163,10 @@ namespace FirstPlugin.Forms
public void UpdateViewport() public void UpdateViewport()
{ {
if (viewport != null && Runtime.UseOpenGL && Runtime.DisplayViewport) if (viewport != null && Runtime.UseOpenGL && Runtime.DisplayViewport)
{
viewport.DisplayAll = DisplayAll;
viewport.UpdateViewport(); viewport.UpdateViewport();
}
} }

View File

@ -211,6 +211,9 @@ namespace FirstPlugin
} }
} }
} }
BfresEditor bfresEditor = (BfresEditor)LibraryGUI.GetActiveContent(typeof(BfresEditor));
bfresEditor.DisplayAll = true;
} }
private ObjectEditor editor; private ObjectEditor editor;

View File

@ -52,6 +52,9 @@ namespace FirstPlugin
TextureSzs = null; TextureSzs = null;
GC.Collect(); GC.Collect();
} }
BfresEditor bfresEditor = (BfresEditor)LibraryGUI.GetActiveContent(typeof(BfresEditor));
bfresEditor.DisplayAll = true;
} }
private static void DiableLoadCheck() private static void DiableLoadCheck()

View File

@ -53,6 +53,7 @@
this.reloadShadersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.reloadShadersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stPanel1 = new Toolbox.Library.Forms.STPanel(); this.stPanel1 = new Toolbox.Library.Forms.STPanel();
this.stLabel1 = new Toolbox.Library.Forms.STLabel(); this.stLabel1 = new Toolbox.Library.Forms.STLabel();
this.chkDisplayAllModels = new Toolbox.Library.Forms.STCheckBox();
this.stContextMenuStrip1.SuspendLayout(); this.stContextMenuStrip1.SuspendLayout();
this.stPanel1.SuspendLayout(); this.stPanel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -256,6 +257,7 @@
// //
this.stPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.stPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.stPanel1.Controls.Add(this.chkDisplayAllModels);
this.stPanel1.Controls.Add(this.stLabel1); this.stPanel1.Controls.Add(this.stLabel1);
this.stPanel1.Controls.Add(this.drawContainersCB); this.stPanel1.Controls.Add(this.drawContainersCB);
this.stPanel1.Location = new System.Drawing.Point(0, 26); this.stPanel1.Location = new System.Drawing.Point(0, 26);
@ -272,6 +274,17 @@
this.stLabel1.TabIndex = 1; this.stLabel1.TabIndex = 1;
this.stLabel1.Text = "Active Model(s):"; this.stLabel1.Text = "Active Model(s):";
// //
// chkDisplayAllModels
//
this.chkDisplayAllModels.AutoSize = true;
this.chkDisplayAllModels.Location = new System.Drawing.Point(282, 2);
this.chkDisplayAllModels.Name = "chkDisplayAllModels";
this.chkDisplayAllModels.Size = new System.Drawing.Size(74, 17);
this.chkDisplayAllModels.TabIndex = 2;
this.chkDisplayAllModels.Text = "Display All";
this.chkDisplayAllModels.UseVisualStyleBackColor = true;
this.chkDisplayAllModels.CheckedChanged += new System.EventHandler(this.chkDisplayAllModels_CheckedChanged);
//
// Viewport // Viewport
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -317,5 +330,6 @@
private Forms.STComboBox drawContainersCB; private Forms.STComboBox drawContainersCB;
private Forms.STPanel stPanel1; private Forms.STPanel stPanel1;
private Forms.STLabel stLabel1; private Forms.STLabel stLabel1;
private Forms.STCheckBox chkDisplayAllModels;
} }
} }

View File

@ -18,6 +18,18 @@ namespace Toolbox.Library
{ {
public partial class Viewport : UserControl public partial class Viewport : UserControl
{ {
public bool DisplayAll
{
get
{
return chkDisplayAllModels.Checked;
}
set
{
chkDisplayAllModels.Checked = value;
}
}
public List<DrawableContainer> DrawableContainers; public List<DrawableContainer> DrawableContainers;
public EditorScene scene = new EditorScene(); public EditorScene scene = new EditorScene();
@ -483,6 +495,12 @@ namespace Toolbox.Library
private void drawContainersCB_SelectedIndexChanged(object sender, EventArgs e) private void drawContainersCB_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (chkDisplayAllModels.Checked)
{
DrawAllActive();
return;
}
if (drawContainersCB.SelectedIndex == 0) if (drawContainersCB.SelectedIndex == 0)
DrawAllActive(); DrawAllActive();
else if (drawContainersCB.SelectedIndex > 0) else if (drawContainersCB.SelectedIndex > 0)
@ -519,5 +537,14 @@ namespace Toolbox.Library
{ {
ReloadDrawables(); ReloadDrawables();
} }
private void chkDisplayAllModels_CheckedChanged(object sender, EventArgs e)
{
if (chkDisplayAllModels.Checked)
{
drawContainersCB.SelectedIndex = 0;
DrawAllActive();
}
}
} }
} }