diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 5fc73efe..c78438ea 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 666bad8b..9d33509c 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 6fb69450..25cdd9aa 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index fa954a4a..0e22437a 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index 1d5bf1a1..1ba75e0c 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Switch_Toolbox_Library/Forms/ArchiveListPreviewForm.cs b/Switch_Toolbox_Library/Forms/ArchiveListPreviewForm.cs index 84727cd0..c2018361 100644 --- a/Switch_Toolbox_Library/Forms/ArchiveListPreviewForm.cs +++ b/Switch_Toolbox_Library/Forms/ArchiveListPreviewForm.cs @@ -18,6 +18,8 @@ namespace Switch_Toolbox.Library.Forms } ImageList ImageList = new ImageList(); + List Textures = new List(); + public void LoadArchive(IArchiveFile ArchiveFile) { ImageList.ColorDepth = ColorDepth.Depth32Bit; @@ -25,10 +27,7 @@ namespace Switch_Toolbox.Library.Forms var Files = OpenFileFormats(ArchiveFile); - List Textures = new List(); - listViewCustom1.LargeImageList = ImageList; - listViewCustom1.BeginUpdate(); for (int i = 0; i < Files.Count; i++) { if (Files[i].FileFormat.FileType == FileType.Image) @@ -36,8 +35,14 @@ namespace Switch_Toolbox.Library.Forms Textures.AddRange(GetTextures(Files[i].FileFormat)); } } - LoadTexturesThread(Textures); + ReloadTextures(); + } + + private void ReloadTextures() + { + listViewCustom1.BeginUpdate(); + LoadTexturesThread(Textures); listViewCustom1.EndUpdate(); } @@ -131,13 +136,20 @@ namespace Switch_Toolbox.Library.Forms if (item.Tag != null && item.Tag is TreeNode) { Point pt = listViewCustom1.PointToScreen(e.Location); + ((TreeNode)item.Tag).ContextMenuStrip.ItemClicked += new ToolStripItemClickedEventHandler(OnContextMenuClick); ((TreeNode)item.Tag).ContextMenuStrip.Show(pt); } } } - ImageEditorForm imageEditorForm; + private void OnContextMenuClick(object sender, ToolStripItemClickedEventArgs e) + { + ToolStripItem item = e.ClickedItem; + if (item.Text.Contains("Replace")) + ReloadTextures(); + } + ImageEditorForm imageEditorForm; private void LoadImageEditor(STGenericTexture texture, object Properties) { if (imageEditorForm == null || imageEditorForm.IsDisposed) @@ -150,6 +162,12 @@ namespace Switch_Toolbox.Library.Forms imageEditorForm.editorBase.Dock = DockStyle.Fill; imageEditorForm.editorBase.LoadProperties(Properties); imageEditorForm.editorBase.LoadImage(texture); + imageEditorForm.FormClosed += OnEditorClosed; + } + + private void OnEditorClosed(object sender, EventArgs e) + { + ReloadTextures(); } private void listViewCustom1_DoubleClick(object sender, EventArgs e)