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
+30
-8
@@ -32,19 +32,41 @@ namespace anm2ed::imgui
|
||||
{
|
||||
if (ImGui::DockSpace(ImGui::GetID("##DockSpace"), ImVec2(), ImGuiDockNodeFlags_PassthruCentralNode))
|
||||
{
|
||||
auto panel_make = [&](PanelState& state)
|
||||
{ return Panel{manager, settings, resources, dialog, clipboard, *document, state}; };
|
||||
auto panel_update = [&](PanelState& state, void (*update)(Panel&))
|
||||
{
|
||||
auto panel = panel_make(state);
|
||||
update(panel);
|
||||
};
|
||||
if (settings.windowIsAnimationPreview) animationPreview.update(manager, settings, resources);
|
||||
if (settings.windowIsAnimations) window_update(animations, manager, settings, resources, dialog, clipboard);
|
||||
if (settings.windowIsRegions) window_update(regions, manager, settings, resources, dialog, clipboard);
|
||||
if (settings.windowIsEvents) window_update(events, manager, settings, resources, dialog, clipboard);
|
||||
if (settings.windowIsAnimations)
|
||||
{
|
||||
auto panel = panel_make(animations.state);
|
||||
animations_update(panel, animations);
|
||||
}
|
||||
if (settings.windowIsRegions)
|
||||
{
|
||||
auto panel = panel_make(regions.state);
|
||||
regions_update(panel, regions);
|
||||
}
|
||||
if (settings.windowIsEvents) panel_update(events, events_update);
|
||||
if (settings.windowIsFrameProperties) frameProperties.update(manager, settings);
|
||||
if (settings.windowIsLayers) window_update(layers, manager, settings, resources, dialog, clipboard);
|
||||
if (settings.windowIsNulls) window_update(nulls, manager, settings, resources, dialog, clipboard);
|
||||
if (settings.windowIsLayers) panel_update(layers, layers_update);
|
||||
if (settings.windowIsNulls) panel_update(nulls, nulls_update);
|
||||
if (settings.windowIsOnionskin) onionskin.update(manager, settings);
|
||||
if (settings.windowIsShaders) shaders.update(manager, settings, resources, dialog);
|
||||
if (settings.windowIsSounds) window_update(sounds, manager, settings, resources, dialog, clipboard);
|
||||
if (settings.windowIsShaders)
|
||||
{
|
||||
auto panel = panel_make(shaders.state);
|
||||
shaders_update(panel, shaders);
|
||||
}
|
||||
if (settings.windowIsSounds) panel_update(sounds, sounds_update);
|
||||
if (settings.windowIsSpritesheetEditor) spritesheetEditor.update(manager, settings, resources);
|
||||
if (settings.windowIsSpritesheets)
|
||||
window_update(spritesheets, manager, settings, resources, dialog, clipboard);
|
||||
{
|
||||
auto panel = panel_make(spritesheets.state);
|
||||
spritesheets_update(panel, spritesheets);
|
||||
}
|
||||
if (settings.windowIsTimeline) timeline.update(manager, settings, resources, clipboard);
|
||||
if (settings.windowIsTools) tools.update(manager, settings, resources);
|
||||
isCanvasFocused = (settings.windowIsAnimationPreview && animationPreview.is_focused_get()) ||
|
||||
|
||||
Reference in new issue
Block a user