Layer Properties source layout, Add as Library on drop, library animations in tooltips

Layer Properties puts Source under its own separator with the radio buttons
on one line (scoped so they no longer clash with the combos' ids), and the
library combo calls this file "Self". Dropping an .anm2 offers Add as
Library. A library's animations are listed in its tooltip instead of a
dropdown under its card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-08 16:56:26 -04:00
1 parent d1a6d89d14
commit e8372ca149
6 files changed
+57 -55

No files matched your search

+7 -5
View File
@@ -10,7 +10,7 @@ using namespace anm2ed::types;
namespace anm2ed::imgui
{
constexpr int NULL_PROPERTIES_ROWS = 2;
constexpr int LAYER_PROPERTIES_ROWS = 4;
constexpr int LAYER_PROPERTIES_ROWS = 6;
auto& layers_get(model::Model& model) { return model.content.layers; }
auto& nulls_get(model::Model& model) { return model.content.nulls; }
@@ -147,15 +147,17 @@ namespace anm2ed::imgui
EDIT_SET_LAYER_PROPERTIES, layers_get,
[&](Manager::ItemEdit& layer)
{
ImGui::TextUnformatted(localize.get(LABEL_LAYER_SOURCE));
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_LAYER_SOURCE));
ImGui::SeparatorText(localize.get(LABEL_LAYER_SOURCE));
ImGui::PushID("##Source");
for (auto [label, isAnimation] : {std::pair{LABEL_SPRITESHEET, false}, std::pair{LABEL_ANIMATION, true}})
{
ImGui::SameLine();
if (isAnimation) ImGui::SameLine();
if (ImGui::RadioButton(localize.get(label), layer.isAnimation == isAnimation))
layer.isAnimation = isAnimation;
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_LAYER_SOURCE));
}
ImGui::PopID();
ImGui::Separator();
if (!layer.isAnimation)
{
@@ -167,7 +169,7 @@ namespace anm2ed::imgui
}
auto libraries = document.choices_get(SelectionKind::LIBRARIES);
libraries.labels.front() = localize.get(TEXT_THIS_FILE);
libraries.labels.front() = localize.get(TEXT_SELF);
combo_id_mapped(localize.get(LABEL_LIBRARY), &layer.libraryId, libraries.ids, libraries.labels);
ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_LAYER_LIBRARY));
auto names = document.animation_names_get(layer.libraryId);