Update bntx images properly in bfres editor when replaced

This commit is contained in:
KillzXGaming 2019-07-12 20:47:04 -04:00
parent 530c86e672
commit 46c7141486
7 changed files with 14 additions and 4 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
*NodeEditorWinforms-master
*GL_EditorFramework-master
*SuperBMD-master
*SuperBMD-link
*Assimp
*.resources
Debug/

Binary file not shown.

View file

@ -17,6 +17,7 @@ using Switch_Toolbox.Library;
using Switch_Toolbox.Library.Forms;
using Switch_Toolbox.Library.IO;
using Switch_Toolbox.Library.Animations;
using FirstPlugin.Forms;
namespace FirstPlugin
{
@ -1261,13 +1262,20 @@ namespace FirstPlugin
private bool IsEditorActive()
{
ImageEditorBase editor = (ImageEditorBase)LibraryGUI.GetActiveContent(typeof(ImageEditorBase));
if (editor == null)
return false;
BfresEditor bfresEditor = (BfresEditor)LibraryGUI.GetActiveContent(typeof(BfresEditor));
if (bfresEditor != null)
{
var imageEditor = bfresEditor.GetActiveEditor(typeof(ImageEditorBase));
return imageEditor != null;
}
else
return true;
{
ImageEditorBase editor = (ImageEditorBase)LibraryGUI.GetActiveContent(typeof(ImageEditorBase));
return editor != null;
}
}
public void UpdateEditor()
{
if (Parent != null && Parent.Parent != null && Parent.Parent is BFRES)
@ -1407,6 +1415,7 @@ namespace FirstPlugin
if (IsEditorActive())
UpdateEditor();
}
private void UpdateTextureMapping()
{
var viewport = LibraryGUI.GetActiveViewport();