From f462692bb121843d97d71e333246a0277e168d38 Mon Sep 17 00:00:00 2001 From: shweet Date: Sun, 16 Nov 2025 00:42:23 -0500 Subject: [PATCH] Default animation when adding first new animation --- src/imgui/window/animations.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/imgui/window/animations.cpp b/src/imgui/window/animations.cpp index d0cf0ab..a51c152 100644 --- a/src/imgui/window/animations.cpp +++ b/src/imgui/window/animations.cpp @@ -74,7 +74,10 @@ namespace anm2ed::imgui if (renameState == RENAME_BEGIN) document.snapshot("Rename Animation"); else if (renameState == RENAME_FINISHED) + { + if (anm2.animations.items.size() == 1) anm2.animations.defaultAnimation = animation.name; document.change(Document::ANIMATIONS); + } } if (ImGui::IsItemHovered()) hovered = (int)i; @@ -211,6 +214,8 @@ namespace anm2ed::imgui index = std::min(index, (int)anm2.animations.items.size()); } + if (anm2.animations.items.empty()) anm2.animations.defaultAnimation = animation.name; + anm2.animations.items.insert(anm2.animations.items.begin() + index, animation); selection = {index}; reference = {index};