diff --git a/.vs/Toolbox/v15/.suo b/.vs/Toolbox/v15/.suo index 06319ab2..2c291040 100644 Binary files a/.vs/Toolbox/v15/.suo and b/.vs/Toolbox/v15/.suo differ diff --git a/File_Format_Library/FileFormats/DKCTF/PAK.cs b/File_Format_Library/FileFormats/DKCTF/PAK.cs index d11a1cd4..ba5e6914 100644 --- a/File_Format_Library/FileFormats/DKCTF/PAK.cs +++ b/File_Format_Library/FileFormats/DKCTF/PAK.cs @@ -14,8 +14,8 @@ namespace DKCTF public FileType FileType { get; set; } = FileType.Layout; public bool CanSave { get; set; } - public string[] Description { get; set; } = new string[] { "Cafe Layout Animation (GUI)" }; - public string[] Extension { get; set; } = new string[] { "*.bflan" }; + public string[] Description { get; set; } = new string[] { "DKCTF Archive" }; + public string[] Extension { get; set; } = new string[] { "*.pak" }; public string FileName { get; set; } public string FilePath { get; set; } public IFileInfo IFileInfo { get; set; } diff --git a/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs b/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs index da9425c6..acd30e16 100644 --- a/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs +++ b/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs @@ -298,6 +298,11 @@ namespace Toolbox.Library.Forms ClearNodes(); } + private void GetArchiveMenus(TreeNode node, ArchiveFileInfo info) + { + + } + private void treeViewCustom1_MouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right) @@ -307,6 +312,14 @@ namespace Toolbox.Library.Forms bool IsRoot = e.Node.Parent == null; treeNodeContextMenu.Items.Clear(); + if (e.Node.Tag != null && e.Node.Tag is ArchiveFileInfo) + { + //The tag gets set when an archive is replaced by a treenode + //Todo store this in a better place as devs could possiblly replace this + //Create menus when an archive node is replaced + GetArchiveMenus(e.Node, (ArchiveFileInfo)e.Node.Tag); + } + if (IsRoot) { foreach (var item in ((IContextMenuNode)e.Node).GetContextMenuItems()) diff --git a/Switch_Toolbox_Library/Forms/Editors/UV/UVEditor.cs b/Switch_Toolbox_Library/Forms/Editors/UV/UVEditor.cs index e3b0edb1..6a60a7cd 100644 --- a/Switch_Toolbox_Library/Forms/Editors/UV/UVEditor.cs +++ b/Switch_Toolbox_Library/Forms/Editors/UV/UVEditor.cs @@ -519,7 +519,8 @@ namespace Toolbox.Library.Forms } } - textureCB.SelectedIndex = 0; + if (textureCB.Items.Count > 0) + textureCB.SelectedIndex = 0; } } diff --git a/Switch_Toolbox_Library/Helpers/ArchiveNodeMenuHelper.cs b/Switch_Toolbox_Library/Helpers/ArchiveNodeMenuHelper.cs new file mode 100644 index 00000000..7e3a4eb4 --- /dev/null +++ b/Switch_Toolbox_Library/Helpers/ArchiveNodeMenuHelper.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Toolbox.Library.Forms; +using System.Windows.Forms; + +namespace Toolbox.Library +{ + public class ArchiveNodeMenuHelper + { + private ArchiveFileInfo FileInfo; + private TreeNode Node; + + private void RenameAction(object sender, EventArgs args) + { + RenameDialog dialog = new RenameDialog(); + dialog.SetString(Node.Text); + + if (dialog.ShowDialog() == DialogResult.OK) { Node.Text = dialog.textBox1.Text; } + } + } +} diff --git a/Switch_Toolbox_Library/Interfaces/FileFormatting/IArchiveFile.cs b/Switch_Toolbox_Library/Interfaces/FileFormatting/IArchiveFile.cs index 34282d25..42370a30 100644 --- a/Switch_Toolbox_Library/Interfaces/FileFormatting/IArchiveFile.cs +++ b/Switch_Toolbox_Library/Interfaces/FileFormatting/IArchiveFile.cs @@ -36,6 +36,7 @@ namespace Toolbox.Library bool AddFile(ArchiveFileInfo archiveFileInfo); bool DeleteFile(ArchiveFileInfo archiveFileInfo); } + public class ArchiveFileInfo : INode { // Opens the file format automatically (may take longer to open the archive file) @@ -909,8 +910,6 @@ namespace Toolbox.Library } ArchiveFileInfo.FileFormat = file; - - Console.WriteLine("replacedFileFormat "); } private void OpenFormDialog(IFileFormat fileFormat) @@ -994,6 +993,7 @@ namespace Toolbox.Library NewNode.ImageKey = replaceNode.ImageKey; NewNode.SelectedImageKey = replaceNode.SelectedImageKey; NewNode.Text = replaceNode.Text; + NewNode.Tag = fileInfo; rootNode.FileNodes.RemoveAt(index); rootNode.FileNodes.Insert(index, Tuple.Create(fileInfo, NewNode)); diff --git a/Switch_Toolbox_Library/Toolbox.Library.dll b/Switch_Toolbox_Library/Toolbox.Library.dll index fcb34af4..0c677523 100644 Binary files a/Switch_Toolbox_Library/Toolbox.Library.dll and b/Switch_Toolbox_Library/Toolbox.Library.dll differ diff --git a/Switch_Toolbox_Library/Toolbox.Library.pdb b/Switch_Toolbox_Library/Toolbox.Library.pdb index b476f7b0..f826ea42 100644 Binary files a/Switch_Toolbox_Library/Toolbox.Library.pdb and b/Switch_Toolbox_Library/Toolbox.Library.pdb differ diff --git a/Switch_Toolbox_Library/Toolbox_Library.csproj b/Switch_Toolbox_Library/Toolbox_Library.csproj index 68edb9ec..addd44fe 100644 --- a/Switch_Toolbox_Library/Toolbox_Library.csproj +++ b/Switch_Toolbox_Library/Toolbox_Library.csproj @@ -284,6 +284,7 @@ +