1
0
mirror of synced 2024-11-28 17:30:57 +01:00

Image editor fixes for bffnt

This commit is contained in:
KillzXGaming 2019-08-07 21:14:18 -04:00
parent fb2648205b
commit feecbeef55
4 changed files with 12 additions and 5 deletions

View File

@ -143,11 +143,18 @@ namespace FirstPlugin.Forms
form.editorBase.Text = Text;
form.editorBase.Dock = DockStyle.Fill;
image.Parameters.FlipY = true;
if (IsBntx)
{
form.editorBase.LoadProperties(((TextureData)image).Texture);
form.editorBase.LoadImage(image, ImageIndex);
}
else
{
form.editorBase.LoadProperties(image.GenericProperties);
form.editorBase.LoadImage(image);
form.editorBase.LoadImage(image);
}
if (form.ShowDialog() == DialogResult.OK)
{

View File

@ -267,7 +267,7 @@ namespace Toolbox.Library.Forms
public void LoadProperties(object prop, Action OnPropertyChanged = null) => propertiesEditor.LoadProperties(prop, OnPropertyChanged);
public void LoadImage(STGenericTexture texture)
public void LoadImage(STGenericTexture texture, int arrayLevel = 0)
{
editBtn.Enabled = false;
@ -275,10 +275,10 @@ namespace Toolbox.Library.Forms
FileWatcher.EnableRaisingEvents = false;
FileWatcher.Filter = "";
UpdateImage(texture);
UpdateImage(texture, arrayLevel);
}
private void UpdateImage(STGenericTexture texture)
private void UpdateImage(STGenericTexture texture, int arrayLevel = 0)
{
ResetChannelEditor();
@ -303,7 +303,7 @@ namespace Toolbox.Library.Forms
}
CurMipDisplayLevel = 0;
CurArrayDisplayLevel = 0;
CurArrayDisplayLevel = arrayLevel;
hasBeenEdited = false;
UpdateMipDisplay();