dm2-gui: egui app shell + save editor (MVP) #303
Labels
No labels
area/ci-release
area/cli
area/docs
area/dungeon
area/ftl
area/graphics
area/gui
area/music
area/saves
area/tooling
port/amiga
port/dos
port/fm-towns
port/mac
port/pc98
port/sega-cd
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jqueuniet/dm2-tools#303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stand up a
dm2-guicrate (egui) and build the first surface: a savegame editor on thedm2-savesedit API (champions, party, inventory, object/creature/door edits) - not a read-only viewer. Also lands the shared app shell (asset loading, file open) that the graphics and dungeon surfaces reuse. See docs/cli-save-editing.md.Architecture note: impose the edit discipline egui leaves optional
egui is the right framework for this crate — two of the three planned
surfaces (#304 graphics browser, #305 dungeon editor) are canvas-dominated,
and since they reuse this shell, the shell should sit in the framework that
makes custom rendering cheap. The one cost we take is that egui won't hand us
the message/update/undo structure a retained framework (iced) gives for free.
This surface is the form-heavy one, so it's worth deciding that structure up
front rather than growing frame-local state ad hoc.
Concretely, before building the save-editor forms:
Explicit
AppState. Loaded asset handles, per-document dirty flags,and current selection live in one owned struct — not scattered across
frame-local
uiclosures. The graphics/dungeon surfaces will hang theirown document state off the same shell state.
A
Commandtrait + undo/redo stack between the UI and the edit APIs.Every mutation (champion/party/inventory/object/creature/door edit) is a
reified, reversible command applied through the stack, never a direct
poke at the
dm2-savesfields from a widget callback. This is the same"typed records + write-back" shape #305 already calls for, so a shared
command/undo layer in the shell serves all three editors — the save editor
is just the first consumer.
Write-back stays in the edit API, not the UI. The command's
apply/revertcall the existingdm2-savesedit surface (seedocs/cli-save-editing.md); the GUI only builds and dispatches commands.Keeps the bit-exact re-encode path and its tests authoritative and shared
with the CLI.
Suggested crates for the shell:
egui_dockfor the multi-panel layout,egui_extrasfor the record/inventory tables.Net: the shell (this issue) should land the
AppState+Command/undoscaffolding as first-class pieces, with the save editor as the first thing
built on top — not bolt undo on afterwards once #304/#305 also need it.