Commit 261a799
committed
Add interactive map viewer journal page (Phase 1)
Register a custom JournalPageSheet for image-type journal pages that
provides an interactive map viewer with pin placement, zoom/pan, and
real-time Foundry socket sync between clients.
Features:
- 6 pin types (location, danger, treasure, quest, note, text) with
colored icons matching Chronicle's marker categories
- Mouse wheel zoom (0.25x-4x) with cursor-anchored scaling
- Click-drag pan navigation with fit-to-view
- Pin placement via toolbar selection + map click
- Drag pins to reposition (coordinates stored as 0-100%)
- Right-click pin to open config dialog (label, type, description,
visibility, journal link)
- Double-click pin to open linked JournalEntry
- GM-only pin visibility toggle
- Toggle pin labels on/off
- Real-time multi-client sync via Foundry socket channel
- PinConfigDialog using ApplicationV2/HandlebarsApplicationMixin pattern
New files:
- scripts/map-viewer.mjs (MapViewerSheet + PinConfigDialog)
- templates/map-viewer.hbs (viewer template)
- templates/pin-config.hbs (pin config dialog template)
- styles/map-viewer.css (all styles scoped to .chronicle-map-viewer)
Modified files:
- scripts/module.mjs (import + register sheet in init hook)
- scripts/map-sync.mjs (export PIN_ICONS for reuse)
- module.json (add map-viewer.css to styles)
- lang/en.json (add MapViewer i18n strings)
https://claude.ai/code/session_01WgrfTebnxho2b8nLgnA8eb1 parent 9d3a9da commit 261a799
8 files changed
Lines changed: 1083 additions & 2 deletions
File tree
- lang
- scripts
- styles
- templates
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
182 | 208 | | |
183 | 209 | | |
184 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
| 614 | + | |
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| |||
0 commit comments