Split window.cpp per window and drive menus from one flag table

- WINDOW_FLAGS table builds every context menu, footer and shortcut set
- Shared list-row and card-row renderers replace per-window copies
- Layers/nulls/events share one properties popup; Manager keeps one item popup API
- Regions, spritesheets and sounds drop hand-built menus, footers and shortcut blocks
- Animation remove and cut share one erase path that also clears group ids
- Index-mapped multi-select fixes shift-range over non-contiguous ids
- Fix Remove Unused tooltip showing the Add shortcut and the missing break in item properties

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 13:27:34 -04:00
1 parent 3f31cedeed
commit d926fc6677
13 files changed
+2811 -4466

No files matched your search

+8 -52
View File
@@ -224,59 +224,15 @@ namespace anm2ed
if (auto document = get()) document->change(Document::ALL);
}
void Manager::layer_properties_open(int id)
void Manager::item_properties_open(ElementType type, int id)
{
if (auto document = get(); document)
{
if (id == -1)
editLayer = element_make(ElementType::LAYER_ELEMENT);
else if (auto layer = document->anm2.element_get(ElementType::LAYER_ELEMENT, id); layer)
editLayer = *layer;
else
return;
document->layer.reference = id;
layerPropertiesPopup.open();
}
}
void Manager::layer_properties_trigger() { layerPropertiesPopup.trigger(); }
void Manager::layer_properties_end() { layerPropertiesPopup.end(); }
void Manager::layer_properties_close()
{
editLayer = element_make(ElementType::LAYER_ELEMENT);
layerPropertiesPopup.close();
}
void Manager::null_properties_open(int id)
{
if (auto document = get(); document)
{
auto nulls = document->anm2.element_get(ElementType::NULLS);
if (id == -1)
editNull = element_make(ElementType::NULL_ELEMENT);
else if (auto null = nulls ? child_id_get(*nulls, ElementType::NULL_ELEMENT, id) : nullptr; null)
editNull = *null;
else
return;
document->null.reference = id;
nullPropertiesPopup.open();
}
}
void Manager::null_properties_trigger() { nullPropertiesPopup.trigger(); }
void Manager::null_properties_end() { nullPropertiesPopup.end(); }
void Manager::null_properties_close()
{
editNull = element_make(ElementType::NULL_ELEMENT);
nullPropertiesPopup.close();
auto document = get();
auto row = track_container_get(type);
auto element = id == -1 || !document ? nullptr : document->anm2.element_get(type, id);
if (!document || !row || (id != -1 && !element)) return;
itemEdit = element ? *element : element_make(type);
(type == ElementType::LAYER_ELEMENT ? document->layer : document->null).reference = id;
itemPropertiesPopups[row - TRACK_CONTAINERS].open();
}
void Manager::recent_files_trim()