Skip to content

Commit

Permalink
Add camera anim menu
Browse files Browse the repository at this point in the history
  • Loading branch information
KillzXGaming committed Oct 16, 2024
1 parent 77bf226 commit f15112a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Plugins/CafeLibrary/Bfres/Editing/Nodes/SceneAnimFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public MenuItemModel[] GetContextMenuItems()
new MenuItemModel(""),
new MenuItemModel("Rename", () => this.ActivateRename = true),
new MenuItemModel(""),
new MenuItemModel("Add Camera Anim", AddCameraAnim),
new MenuItemModel(""),
new MenuItemModel("Delete", DeleteAction)
};
}
Expand Down Expand Up @@ -143,6 +145,16 @@ private void ReplaceAction()
}
}

private void AddCameraAnim()
{
var anim = new CameraAnim() { Name = "CameraAnim" };
anim.Name = Utils.RenameDuplicateString(anim.Name, SceneAnim.CameraAnims.Keys.Select(x => x).ToList());
SceneAnim.CameraAnims.Add(anim.Name, anim);

var an = new BfresCameraAnim(ResFile, SceneAnim, anim);
this.AddChild(an.UINode);
}

private void DeleteAction()
{
int result = TinyFileDialog.MessageBoxInfoYesNo("Are you sure you want to remove these animations? Operation cannot be undone.");
Expand Down

0 comments on commit f15112a

Please sign in to comment.