docs(ui): align architecture with retained runtime

This commit is contained in:
Erik 2026-07-10 16:57:44 +02:00
parent 00ab4a2a64
commit f98050854d
6 changed files with 109 additions and 70 deletions

View file

@ -71,32 +71,38 @@ well-defined interfaces that the retail client never had.
└──────────────────────────────────────────────────────────────┘
```
### UI Architecture (companion stack, spans Layers 1 & 5)
### UI Architecture (two coexisting presentation stacks)
The UI is split into its own three-layer stack with a swappable backend,
designed 2026-04-24. Full design: `docs/plans/2026-04-24-ui-framework.md`.
The 2026-04-24 design began with a swappable renderer abstraction. D.2b proved
that retail fidelity needs a retained LayoutDesc/DAT tree, while ImGui remains
valuable as permanent devtools. The current architecture therefore has two
presentation stacks over shared state, ViewModels, events, and commands. Full
history and the corrected contract live in
`docs/plans/2026-04-24-ui-framework.md`.
```
┌─────────────────────────────────────────────────────────────┐
│ UI BACKEND (swappable) │
│ ImGui.NET + Silk.NET.OpenGL.Extensions.ImGui
(Phase D.2a, short-term)
or custom retail-look toolkit (Phase D.2b, later)
DEVELOPER UI
│ IPanel/IPanelRenderer → permanent ImGui devtools
GAMEPLAY UI
LayoutDesc/DAT → UiRoot retained widgets + controllers
├─────────────────────────────────────────────────────────────┤
AcDream.UI.Abstractions (stable contract)
│ ViewModels, Commands, IPanel, IPanelHost, IPanelRenderer
│ ► plugin-facing UI API lives HERE, not in the backend
SHARED CONTRACTS
│ ViewModels, commands, input actions, state/event services
│ ► one model and mutation path, two presentation projections
├─────────────────────────────────────────────────────────────┤
│ Game state + events (unchanged) │
│ IGameState / IEvents / WorldSession — UI only reads │
└─────────────────────────────────────────────────────────────┘
```
The backend is pluggable; ViewModels / Commands / `IPanelRenderer` are
stable across the swap. ImGui persists forever as the
`ACDREAM_DEVTOOLS=1` devtools overlay regardless of which backend owns
the game UI. The full UI design lives in
`docs/plans/2026-04-24-ui-framework.md`.
`AcDream.UI.Abstractions` owns backend-neutral ViewModels, commands, input,
and the `IPanel`/`IPanelRenderer` devtools contract. `AcDream.App/UI` owns the
retained gameplay tree, LayoutDesc importer, window runtime, and panel
controllers. Neither presentation stack owns independent game-state truth.
Plugins register retained gameplay markup through the BCL-only
`AcDream.Plugin.Abstractions.IUiRegistry`; they do not import App or ImGui
assemblies.
---