Default animation when adding first new animation
This commit is contained in:
@@ -74,7 +74,10 @@ namespace anm2ed::imgui
|
|||||||
if (renameState == RENAME_BEGIN)
|
if (renameState == RENAME_BEGIN)
|
||||||
document.snapshot("Rename Animation");
|
document.snapshot("Rename Animation");
|
||||||
else if (renameState == RENAME_FINISHED)
|
else if (renameState == RENAME_FINISHED)
|
||||||
|
{
|
||||||
|
if (anm2.animations.items.size() == 1) anm2.animations.defaultAnimation = animation.name;
|
||||||
document.change(Document::ANIMATIONS);
|
document.change(Document::ANIMATIONS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered()) hovered = (int)i;
|
if (ImGui::IsItemHovered()) hovered = (int)i;
|
||||||
|
|
||||||
@@ -211,6 +214,8 @@ namespace anm2ed::imgui
|
|||||||
index = std::min(index, (int)anm2.animations.items.size());
|
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);
|
anm2.animations.items.insert(anm2.animations.items.begin() + index, animation);
|
||||||
selection = {index};
|
selection = {index};
|
||||||
reference = {index};
|
reference = {index};
|
||||||
|
|||||||
Reference in New Issue
Block a user