From ebc35e8277dbede06be17cfce7a2e3544872ab0a Mon Sep 17 00:00:00 2001 From: goose Date: Thu, 8 Oct 2026 19:08:42 -0400 Subject: [PATCH] docs: plan dark fantasy interface refactor --- ...6-10-08-dark-fantasy-interface-refactor.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 docs/superpowers/plans/2026-10-08-dark-fantasy-interface-refactor.md diff --git a/docs/superpowers/plans/2026-10-08-dark-fantasy-interface-refactor.md b/docs/superpowers/plans/2026-10-08-dark-fantasy-interface-refactor.md new file mode 100644 index 0000000..708b0fe --- /dev/null +++ b/docs/superpowers/plans/2026-10-08-dark-fantasy-interface-refactor.md @@ -0,0 +1,96 @@ +# Dark Fantasy Interface Refactor Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Rebuild the in-game HUD around the supplied dark-fantasy mock-up while preserving all gameplay, input, journal, minimap, overlay, and node-path contracts. + +**Architecture:** Keep `Game.tscn` and `GameHud` as the integration boundary. Add reusable imported UI textures and a shared Godot theme, then reorganize the HUD into fixed left, center, and right regions inside the existing 1920×1080 reference viewport. Existing functional nodes remain at their current `HUD/*` paths; new decoration and layout containers are additive. + +**Tech Stack:** Godot 4.7, GDScript, `.tscn`/`.tres` resources, GUT tests, PNG UI assets. + +**Spec:** `/home/hectelyon/Downloads/DungeonCrawlerWorld_UI_Assets/README.md` and `captures/00_maquette_complete.png` + +## Global Constraints + +- Treat the supplied complete mock-up as visual direction, not as frozen game content. +- Recreate all live text and interactive states in Godot. +- Preserve existing gameplay and public `HUD/*` node paths used by `game.gd` and tests. +- Keep the 1920×1080 reference viewport and `canvas_items` stretching. +- Use the transparent components for reusable controls; use capture crops only for genuinely illustrative content. +- Do not change domain/gameplay logic except where presentation data must be exposed. +- Run targeted tests, the full verification suite, and visual capture inspection before completion. + +--- + +## File Map + +- `assets/ui/dark_fantasy/*`: copied production-ready transparent UI textures and illustrative portrait/equipment art. +- `assets/ui/dark_fantasy/dark_fantasy_theme.tres`: reusable typography, colors, panel, button, and scrollbar styling. +- `scenes/Game.tscn`: new desktop HUD composition and visual hierarchy while preserving functional root paths. +- `scenes/ui/Minimap.tscn`: dark-fantasy map panel and caption styling. +- `scripts/presentation/hud.gd`: live character/header/status copy and responsive layout behavior. +- `scripts/presentation/minimap.gd`: minimap sizing based on its actual drawing region. +- `tests/unit/test_hud_layout.gd`: structural, non-overlap, content, and central-play-area contracts for the new shell. +- `tests/e2e/test_visual_readability_e2e.gd`: integration contract for the redesigned layout. +- `assets/ASSET_REGISTRY.md`: provenance and use of the supplied UI kit. + +### Task 1: Import the reusable art kit and define the visual system + +**Interfaces:** +- Produces: `res://assets/ui/dark_fantasy/dark_fantasy_theme.tres` and stable texture paths consumed by scenes. + +- [ ] Copy only transparent reusable components plus `portrait_roger.png` and `illustration_equipement.png` into `assets/ui/dark_fantasy/`. +- [ ] Add import presets suitable for pixel-stable UI rendering where needed. +- [ ] Create `dark_fantasy_theme.tres` with parchment text, gold accents, charcoal panels, ornamental borders, focused/hover button states, and readable 16–22 px defaults. +- [ ] Register source and intended use in `assets/ASSET_REGISTRY.md`. +- [ ] Run a headless Godot import and require exit code 0. + +### Task 2: Lock the desired HUD shell with failing layout tests + +**Interfaces:** +- Consumes: existing `GameScene`, `GameHud`, and `Game.REFERENCE_VIEWPORT`. +- Produces: test contracts for `TopBar`, `LeftRail`, `PlayAreaFrame`, `RightRail`, and `CommandBar` under `HUD/ResponsiveLayout`. + +- [ ] Replace the old compact-overlay assertions with assertions for a full-frame HUD shell, distinct non-overlapping rails, and a center gameplay viewport. +- [ ] Assert that every existing live label remains enclosed by its intended panel. +- [ ] Assert dynamic header/character fields and command hints use live game values. +- [ ] Update the visual E2E region contract to target the framed center viewport. +- [ ] Run the HUD and visual-readability tests and confirm they fail for missing new regions. + +### Task 3: Build the desktop dark-fantasy HUD + +**Interfaces:** +- Consumes: shared theme/textures from Task 1 and test node names from Task 2. +- Preserves: all existing direct paths such as `HUD/PlayerHealthLabel`, `HUD/EventLog`, `HUD/ContextPromptLabel`, and overlay scene paths. +- Produces: `GameHud.apply_viewport_layout(viewport_size: Vector2) -> void` and the five named layout regions. + +- [ ] Add the full-screen dark backdrop, top statistics bar, left character/objective/status rail, center play frame, right journal/map rail, quick-slot strip, prompt, and bottom command bar. +- [ ] Convert HP, focus, and XP presentation to styled live gauges without changing refresh semantics. +- [ ] Add character portrait/equipment illustration as non-interactive image content. +- [ ] Add live floor, player name, room/exploration, and status labels populated by `GameHud.refresh`. +- [ ] Add viewport-layout behavior that preserves the designed proportions at 1920×1080 and keeps controls readable at 1280×720. +- [ ] Run HUD unit tests until they pass. + +### Task 4: Integrate the minimap and gameplay camera with the framed center + +**Interfaces:** +- Consumes: `HUD/ResponsiveLayout/PlayAreaFrame` and existing `Minimap.set_state(...)`. +- Produces: minimap drawing constrained to its inner map region; camera still tracks the actor and obeys map limits. + +- [ ] Restyle `Minimap.tscn` for the right rail without changing the `HUD/Minimap` root path. +- [ ] Make minimap cell sizing use the drawable map rectangle rather than the full framed control. +- [ ] Keep hidden enemies hidden and preserve expand/collapse behavior. +- [ ] Run minimap, camera-grid, and display-layout tests until they pass. + +### Task 5: Validate overlays, inputs, visual output, and responsive behavior + +**Interfaces:** +- Consumes: complete redesigned HUD. +- Produces: regression evidence and captured screenshots. + +- [ ] Run all HUD, prompt, minimap, navigation, combat-HUD, and level-up tests. +- [ ] Run `./scripts/run-visual-check.sh` and inspect generated captures for overlap, clipping, readability, and center-map framing. +- [ ] Run the game/capture at 1280×720 and verify the layout remains usable. +- [ ] Run `./scripts/verify.sh` and require all executable and parity gates to pass. +- [ ] Run `git diff --check` and inspect final status/diff for unrelated changes. +- [ ] Commit and push the refactor to Gitea.