Stage 8a: panels as plain functions; content selection on the uid Selection
- New panel kit (imgui/window/panel.*): list/card drawing with multi-select, rename, arrow keys, drag hooks and tooltips; a list panel helper for the context menu, shortcuts and footer; panels build their Actions inline. - Layers, nulls, events, sounds, spritesheets, regions, shaders and animations are plain functions over a small persistent state struct. - Content items are selected by uid in the shared Selection (one kind per content type, plus a focus per kind); regions are those of the focused spritesheet. Selection survives undo, paste and removal like the timeline's. - Combo labels are computed when drawn (Document::choices_get). - Deletes the Window callback framework, WINDOW_FLAGS, Storage and the per-window selection snapshot fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e50d76c784
commit
d08f59d7ba
37 files changed
+2355
-2578
No files matched your search
@@ -90,3 +90,26 @@ TEST_CASE("track and group selection follow regrouping")
|
||||
CHECK(selection_references_get(selection, index, SelectionKind::TRACKS) == std::set<Reference>{{0, LAYER, 0}});
|
||||
CHECK(selection_references_get(selection, index, SelectionKind::GROUPS) == std::set<Reference>{{0, LAYER, groupId}});
|
||||
}
|
||||
|
||||
TEST_CASE("content selection follows items, and regions follow the focused spritesheet")
|
||||
{
|
||||
auto anm2 = fixture_load_with_uids("05_regions.anm2");
|
||||
Selection selection{};
|
||||
auto& regions = model::item_get(anm2.content.spritesheets, 0)->regions;
|
||||
REQUIRE(regions.size() > 1);
|
||||
auto regionId = regions[1].id;
|
||||
|
||||
selection_ids_set(selection, anm2, SelectionKind::REGIONS, {regionId});
|
||||
CHECK(selection_ids_get(selection, anm2, SelectionKind::REGIONS).empty());
|
||||
|
||||
selection_focus_id_set(selection, anm2, SelectionKind::SPRITESHEETS, 0);
|
||||
selection_ids_set(selection, anm2, SelectionKind::REGIONS, {regionId});
|
||||
selection_focus_id_set(selection, anm2, SelectionKind::REGIONS, regionId);
|
||||
regions.erase(regions.begin());
|
||||
CHECK(selection_ids_get(selection, anm2, SelectionKind::REGIONS) == std::set<int>{regionId});
|
||||
CHECK(selection_focus_id_get(selection, anm2, SelectionKind::REGIONS) == regionId);
|
||||
|
||||
std::erase_if(regions, [&](const model::Region& region) { return region.id == regionId; });
|
||||
CHECK(selection_ids_get(selection, anm2, SelectionKind::REGIONS).empty());
|
||||
CHECK(selection_focus_id_get(selection, anm2, SelectionKind::REGIONS) == -1);
|
||||
}
|
||||
Reference in new issue
Block a user