1
0
mirror of synced 2024-09-24 19:48:21 +02:00

Fix crash from model edits while viewport is disabled

This commit is contained in:
KillzXGaming 2019-04-25 16:55:30 -04:00
parent 705837ab0c
commit 91694c2fcb
3 changed files with 9 additions and 8 deletions

Binary file not shown.

View File

@ -56,7 +56,7 @@ namespace FirstPlugin.Forms
return null;
var editor = LibraryGUI.Instance.GetObjectEditor();
return editor.GetViewport();
return editor.GetViewport();
}
set
{
@ -69,13 +69,13 @@ namespace FirstPlugin.Forms
public BfresEditor(bool HasModels)
{
InitializeComponent();
InitializeComponent();
STConsole stConsole = STConsole.Instance;
stConsole.BorderStyle = BorderStyle.None;
stConsole.Dock = DockStyle.Fill;
tabPage4.Controls.Add(stConsole);
animationPanel = new AnimationPanel();
animationPanel.CurrentAnimation = null;
animationPanel.Dock = DockStyle.Fill;
@ -157,11 +157,11 @@ namespace FirstPlugin.Forms
public void AddDrawable(AbstractGlDrawable draw)
{
if (!Runtime.UseViewport)
return;
Drawables.Add(draw);
if (!Runtime.UseViewport || !Runtime.DisplayViewport)
return;
if (!viewport.scene.staticObjects.Contains(draw) &&
!viewport.scene.objects.Contains(draw))
{
@ -171,10 +171,11 @@ namespace FirstPlugin.Forms
public void RemoveDrawable(AbstractGlDrawable draw)
{
if (!Runtime.UseViewport)
Drawables.Remove(draw);
if (!Runtime.UseViewport || !Runtime.DisplayViewport)
return;
Drawables.Remove(draw);
viewport.RemoveDrawable(draw);
}