From 93df418554c58d072c57f6714964ba6ce7f1df47 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 7 Mar 2026 16:22:53 +0000 Subject: [PATCH] docs: add follow mode highlight & command legend design Co-Authored-By: Claude Opus 4.6 --- .../2026-03-07-follow-highlight-design.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/plans/2026-03-07-follow-highlight-design.md diff --git a/docs/plans/2026-03-07-follow-highlight-design.md b/docs/plans/2026-03-07-follow-highlight-design.md new file mode 100644 index 0000000..f2ad0f4 --- /dev/null +++ b/docs/plans/2026-03-07-follow-highlight-design.md @@ -0,0 +1,48 @@ +# Follow Mode Highlight & Command Legend + +## Problem + +With many NPCs on screen, it's hard to identify which NPC you're following. Follow mode also lacks a command legend (camera mode has one). + +## Design + +### Highlight Effect + +- Phaser `postFX.addGlow(0xff0000, outlineSize)` on the followed NPC's sprite +- Toggle on/off with `1` key (only in follow mode) +- Default: OFF +- When cycling NPCs (left/right), move glow from old sprite to new sprite (if enabled) +- Clear glow when switching back to camera mode + +### Mode-Specific Key Bindings + +The `1` key already gates on camera mode (`if (this.mode !== 'camera') return`). Add a parallel follow-mode branch: + +- Camera mode `1`: Spawn NPC (existing) +- Follow mode `1`: Toggle highlight + +### Follow Mode Command Legend + +Reuse existing `CommandPanel` class with a second instance: + +| Key | Label | +|-----|-------| +| ← → | Cycle NPC | +| 1 | Highlight | +| TAB | Camera Mode | + +- Title: "FOLLOW" (matching camera panel's "COMMANDS" style) +- Show when entering follow mode, hide when leaving +- Same position/styling as camera mode command panel + +### State + +- `highlightEnabled: boolean` on GameScene (default `false`) +- `followCommandPanel: CommandPanel` on GameScene (separate instance) + +### Data Flow + +1. Enter follow mode → show follow command panel, hide camera command panel +2. Press `1` in follow mode → toggle `highlightEnabled`, apply/remove glow on current sprite +3. Cycle NPC → if highlight enabled, remove glow from old sprite, add to new sprite +4. Exit follow mode → clear glow, reset `highlightEnabled`, hide follow command panel