Automatically apply changes when resized in image editor
This commit is contained in:
parent
6c38b46ad4
commit
387e8685fd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -743,6 +743,9 @@ namespace Switch_Toolbox.Library.Forms
|
||||
if (resizeEditor.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
UpdateEditCached(resizeEditor.newImage);
|
||||
ApplyEdit(resizeEditor.newImage);
|
||||
|
||||
UpdateImage(ActiveTexture);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ namespace Switch_Toolbox.Library.Forms
|
||||
ObjectTree.Dock = DockStyle.Fill;
|
||||
stPanel1.Controls.Add(ObjectTree);
|
||||
|
||||
TreeNode FileRoot = new TreeNode(FileFormat.FileName);
|
||||
TreeNode FileRoot = new ArchiveRootNodeWrapper(FileFormat.FileName, (IArchiveFile)FileFormat);
|
||||
FillTreeNodes(FileRoot, (IArchiveFile)FileFormat);
|
||||
AddNode(FileRoot);
|
||||
}
|
||||
|
@ -64,6 +64,44 @@ namespace Switch_Toolbox.Library
|
||||
public ArchiveFileState State { get; set; } = ArchiveFileState.Empty;
|
||||
}
|
||||
|
||||
//Wrapper for the archive file itself
|
||||
public class ArchiveRootNodeWrapper : TreeNodeCustom
|
||||
{
|
||||
IArchiveFile ArchiveFile;
|
||||
|
||||
public ArchiveRootNodeWrapper(string text, IArchiveFile archiveFile)
|
||||
{
|
||||
Text = text;
|
||||
ArchiveFile = archiveFile;
|
||||
|
||||
ContextMenuStrip = new STContextMenuStrip();
|
||||
ContextMenuStrip.Items.Add(new STToolStripItem("Save", SaveAction));
|
||||
if (!((IFileFormat)archiveFile).CanSave)
|
||||
ContextMenuStrip.Items[0].Enabled = false;
|
||||
}
|
||||
|
||||
private void SaveAction(object sender, EventArgs args)
|
||||
{
|
||||
//Archive files are IFIleFormats
|
||||
var FileFormat = ((IFileFormat)ArchiveFile);
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
List<IFileFormat> formats = new List<IFileFormat>();
|
||||
formats.Add(FileFormat);
|
||||
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = Utils.GetAllFilters(formats);
|
||||
sfd.FileName = FileFormat.FileName;
|
||||
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
STFileSaver.SaveFileFormat(FileFormat, sfd.FileName);
|
||||
}
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
|
||||
//Wrapper for folders
|
||||
public class ArchiveFolderNodeWrapper : TreeNodeCustom
|
||||
{
|
||||
public bool CanReplace
|
||||
@ -173,6 +211,7 @@ namespace Switch_Toolbox.Library
|
||||
}
|
||||
}
|
||||
|
||||
//Wrapper for files
|
||||
public class ArchiveNodeWrapper : TreeNodeCustom
|
||||
{
|
||||
public bool CanReplace
|
||||
|
Loading…
x
Reference in New Issue
Block a user