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
@@ -32,7 +32,7 @@ namespace anm2ed::imgui
|
||||
auto& document = *manager.get();
|
||||
auto& model = document.model;
|
||||
auto reference = document.reference_get();
|
||||
auto& referenceSpritesheet = document.spritesheet.reference;
|
||||
auto referenceSpritesheet = document.focused_id_get(SelectionKind::SPRITESHEETS);
|
||||
auto& pan = document.editorPan;
|
||||
auto& zoom = document.editorZoom;
|
||||
auto& backgroundColor = settings.editorBackgroundColor;
|
||||
@@ -58,7 +58,10 @@ namespace anm2ed::imgui
|
||||
if (auto selectedLayerSpritesheet = selected_layer_spritesheet_get();
|
||||
selectedLayerSpritesheet != -1 && document.editTarget != Document::EditTarget::REGION &&
|
||||
document.editTarget != Document::EditTarget::SPRITESHEET)
|
||||
{
|
||||
referenceSpritesheet = selectedLayerSpritesheet;
|
||||
document.focused_id_set(SelectionKind::SPRITESHEETS, referenceSpritesheet);
|
||||
}
|
||||
auto spritesheet = model::item_get(model.content.spritesheets, referenceSpritesheet);
|
||||
auto baseTexture = document.texture_get(referenceSpritesheet);
|
||||
auto texture = baseTexture;
|
||||
@@ -67,8 +70,8 @@ namespace anm2ed::imgui
|
||||
auto& shaderTexture = resources.shaders[shader::TEXTURE];
|
||||
auto& shaderLine = resources.shaders[shader::LINE];
|
||||
auto& dashedShader = resources.shaders[shader::DASHED];
|
||||
auto& regionReference = document.region.reference;
|
||||
auto& regionSelection = document.region.selection;
|
||||
auto regionReference = document.focused_id_get(SelectionKind::REGIONS);
|
||||
auto regionSelection = document.selected_ids_get(SelectionKind::REGIONS);
|
||||
|
||||
auto center_view = [&]() { pan = -size * 0.5f; };
|
||||
|
||||
@@ -546,12 +549,8 @@ namespace anm2ed::imgui
|
||||
document.editTarget = Document::EditTarget::REGION;
|
||||
regionReference = id;
|
||||
regionSelection = {id};
|
||||
manager.command_push({manager.selected, [=](Manager&, Document& document)
|
||||
{
|
||||
document.editTarget = Document::EditTarget::REGION;
|
||||
document.region.reference = id;
|
||||
document.region.selection = {id};
|
||||
}});
|
||||
document.selected_ids_set(SelectionKind::REGIONS, {id});
|
||||
document.focused_id_set(SelectionKind::REGIONS, id);
|
||||
};
|
||||
auto region_pivot_set = [&](int id, vec2 pivot)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user