handling saving issues in certain contexts/new shortcuts

This commit is contained in:
2026-01-05 04:16:51 -05:00
parent a8143b6d0c
commit b41b6df19e
7 changed files with 87 additions and 22 deletions
+23 -2
View File
@@ -209,6 +209,7 @@ namespace anm2ed::imgui
if (ImGui::BeginChild("##Animations Child", childSize, ImGuiChildFlags_Borders))
{
selection.start(anm2.animations.items.size());
for (auto [i, animation] : std::views::enumerate(anm2.animations.items))
@@ -249,11 +250,17 @@ namespace anm2ed::imgui
if (isNewAnimation)
{
ImGui::SetScrollHereY(0.5f);
isUpdateScroll = true;
newAnimationSelectedIndex = -1;
}
ImGui::PopFont();
if (isUpdateScroll && isReferenced)
{
ImGui::SetScrollHereY(0.5f);
isUpdateScroll = false;
}
if (ImGui::BeginItemTooltip())
{
ImGui::PushFont(resources.fonts[font::BOLD].get(), font::SIZE);
@@ -468,5 +475,19 @@ namespace anm2ed::imgui
}
}
ImGui::End();
auto isNextAnimation = shortcut(manager.chords[SHORTCUT_NEXT_ANIMATION], shortcut::GLOBAL);
auto isPreviousAnimation = shortcut(manager.chords[SHORTCUT_PREVIOUS_ANIMATION], shortcut::GLOBAL);
if ((isPreviousAnimation || isNextAnimation) && !anm2.animations.items.empty())
{
if (isPreviousAnimation)
reference.animationIndex = glm::clamp(--reference.animationIndex, 0, (int)anm2.animations.items.size() - 1);
if (isNextAnimation)
reference.animationIndex = glm::clamp(++reference.animationIndex, 0, (int)anm2.animations.items.size() - 1);
selection = {reference.animationIndex};
isUpdateScroll = true;
}
}
}
}