From 880afd25d44afa6372613baa28b379a599bf6bd0 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sun, 20 Oct 2019 13:30:09 -0400 Subject: [PATCH] Few more fixes. Editor should be fully functional --- File_Format_Library/FileFormats/Layout/Common.cs | 2 +- .../BFLYT/Animations/Basic/AddGroupTypeDialog.cs | 2 +- .../Animations/Basic/LayoutAnimEditorBasic.cs | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/File_Format_Library/FileFormats/Layout/Common.cs b/File_Format_Library/FileFormats/Layout/Common.cs index b9a6ae9d..a35f0d3d 100644 --- a/File_Format_Library/FileFormats/Layout/Common.cs +++ b/File_Format_Library/FileFormats/Layout/Common.cs @@ -1466,7 +1466,7 @@ namespace LayoutBXLYT { byte target = (byte)TargetType; string tagType = Tag.Remove(0, 1); - switch (Tag) + switch (tagType) { case "LPA": return new LPATagEntry(target, interpolationType); diff --git a/File_Format_Library/GUI/BFLYT/Animations/Basic/AddGroupTypeDialog.cs b/File_Format_Library/GUI/BFLYT/Animations/Basic/AddGroupTypeDialog.cs index 414034fb..aa2f7202 100644 --- a/File_Format_Library/GUI/BFLYT/Animations/Basic/AddGroupTypeDialog.cs +++ b/File_Format_Library/GUI/BFLYT/Animations/Basic/AddGroupTypeDialog.cs @@ -21,7 +21,7 @@ namespace LayoutBXLYT CanResize = false; ActiveGroup = animGroup; - if (animGroup.Target == AnimationTarget.Material) + if (animGroup.Target == AnimationTarget.Pane) { stComboBox1.Items.Add("PaneSRT"); stComboBox1.Items.Add("Visibility"); diff --git a/File_Format_Library/GUI/BFLYT/Animations/Basic/LayoutAnimEditorBasic.cs b/File_Format_Library/GUI/BFLYT/Animations/Basic/LayoutAnimEditorBasic.cs index e3508eab..1f7c2d17 100644 --- a/File_Format_Library/GUI/BFLYT/Animations/Basic/LayoutAnimEditorBasic.cs +++ b/File_Format_Library/GUI/BFLYT/Animations/Basic/LayoutAnimEditorBasic.cs @@ -135,6 +135,8 @@ namespace LayoutBXLYT public class GroupAnimWrapper : TreeNode, IContextMenuNode { + public BxlanPAI1 AnimInfo => (BxlanPAI1)Parent.Tag; + public BxlanPaiEntry PaiEntry => (BxlanPaiEntry)Tag; public GroupAnimWrapper(string text) { @@ -145,10 +147,17 @@ namespace LayoutBXLYT { List Items = new List(); Items.Add(new ToolStripMenuItem("Add Animation Group", null, AddGroup, Keys.Control | Keys.A)); + Items.Add(new ToolStripMenuItem("Remove Group", null, RemoveGroup, Keys.Delete)); Items.Add(new ToolStripMenuItem("Clear Groups", null, ClearGroups, Keys.Control | Keys.C)); return Items.ToArray(); } + private void RemoveGroup(object sender, EventArgs e) + { + AnimInfo.Entries.Remove(PaiEntry); + Parent.Nodes.Remove(this); + } + private void AddGroup(object sender, EventArgs e) { AddGroupTypeDialog dlg = new AddGroupTypeDialog(PaiEntry); @@ -181,10 +190,17 @@ namespace LayoutBXLYT { List Items = new List(); Items.Add(new ToolStripMenuItem("Add Target", null, AddTarget, Keys.Control | Keys.A)); + Items.Add(new ToolStripMenuItem("Remove Group", null, RemoveGroup, Keys.Delete)); Items.Add(new ToolStripMenuItem("Clear Targets", null, ClearTargets, Keys.Control | Keys.C)); return Items.ToArray(); } + private void RemoveGroup(object sender, EventArgs e) + { + ParentPaiEntry.Tags.Remove(GroupTag); + Parent.Nodes.Remove(this); + } + private void AddTarget(object sender, EventArgs e) { AddGroupTargetDialog dlg = new AddGroupTargetDialog();