diff --git a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs index bfbc3f1a..17e8dca4 100644 --- a/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs +++ b/File_Format_Library/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs @@ -674,12 +674,13 @@ namespace Bfres.Structs public ToolStripItem[] GetContextMenuItems() { List Items = new List(); - Items.Add(new ToolStripMenuItem("Rename", null, RenameAction, Keys.Control | Keys.I)); - Items.Add(new ToolStripMenuItem("New Child Bone", null, NewAction, Keys.Control | Keys.I)); + Items.Add(new ToolStripMenuItem("Rename", null, RenameAction, Keys.Control | Keys.R)); + Items.Add(new ToolStripSeparator()); + Items.Add(new ToolStripMenuItem("New Child Bone", null, NewAction, Keys.Control | Keys.N)); Items.Add(new ToolStripMenuItem("Import Child Bone", null, ImportAction, Keys.Control | Keys.I)); Items.Add(new ToolStripSeparator()); - Items.Add(new ToolStripMenuItem("Export Bone", null, ExportAction, Keys.Control | Keys.I)); - Items.Add(new ToolStripMenuItem("Replace Bone", null, ReplaceAction, Keys.Control | Keys.I)); + Items.Add(new ToolStripMenuItem("Export Bone", null, ExportAction, Keys.Control | Keys.E)); + Items.Add(new ToolStripMenuItem("Replace Bone", null, ReplaceAction, Keys.Control | Keys.R)); return Items.ToArray(); } diff --git a/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs b/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs index 20af8470..a5911594 100644 --- a/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs +++ b/Switch_Toolbox_Library/Forms/Editors/Object Editor/ObjectEditorTree.cs @@ -343,6 +343,23 @@ namespace Toolbox.Library.Forms { treeNodeContextMenu.Items.AddRange(((IContextMenuNode)e.Node).GetContextMenuItems()); } + + bool HasCollpase = false; + bool HasExpand = false; + foreach (var item in ((IContextMenuNode)e.Node).GetContextMenuItems()) + { + if (item.Text == "Collapse All") + HasCollpase = true; + if (item.Text == "Expand All") + HasExpand = true; + } + + if (!HasCollpase) + treeNodeContextMenu.Items.Add(new ToolStripMenuItem("Collapse All", null, CollapseAllAction, Keys.Control | Keys.Q)); + + if (!HasExpand) + treeNodeContextMenu.Items.Add(new ToolStripMenuItem("Expand All", null, ExpandAllAction, Keys.Control | Keys.P)); + treeNodeContextMenu.Show(Cursor.Position); //Select the node without the evemt @@ -358,6 +375,20 @@ namespace Toolbox.Library.Forms } } + private void ExpandAllAction(object sender, EventArgs args) + { + var node = treeViewCustom1.SelectedNode; + if (node != null) + node.ExpandAll(); + } + + private void CollapseAllAction(object sender, EventArgs args) + { + var node = treeViewCustom1.SelectedNode; + if (node != null) + node.Collapse(); + } + private void DeleteAction(object sender, EventArgs args) { var node = treeViewCustom1.SelectedNode;