Commit graph

69 commits

Author SHA1 Message Date
isaprettycoolguy@protonmail.com
06bb93c91d fix: overlay pattern editor — hex preview, palette refresh, thin outline
Three refinements to the 1.3.0 overlay pattern editor based on user
feedback:

- Preview: was a 120×36 rect at the pattern's own scale. Now a hex
  polygon at the live on-map hex size (read from .duckmage-hex,
  falling back to 96 px), in the configured orientation — so the
  preview shows exactly what the overlay will look like on the map.

- Palette tiles: were never updating on Save because the picker
  re-read style from the metadata cache, which lags Obsidian's
  frontmatter write by a tick. The editor's onSaved callback now
  passes the new OverlayStyle directly, so the picker renders from
  the editor's in-memory state and updates immediately.

- Outline width: was hardcoded to gapPx*2+2 (often 14-22 px), which
  made overlay borders read as solid blobs. Now per-overlay,
  defaulting to 1.5 px, with a slider (0-20, step 0.5) in the editor.
  Persisted as faction-outline-width / region-outline-width
  frontmatter keys. Crank it up to recover the old thick-blob look.
2026-06-17 12:22:28 -04:00
isaprettycoolguy@protonmail.com
f9e292c5f0 feat: faction & region overlay patterns (1.3.0)
Adds per-overlay pattern fills so factions and regions can be visually
distinguished when they overlap (issue #25). Each faction note and each
region note now carries a pattern, scale, and opacity in its
frontmatter, edited via the existing FactionEditor / GeoRegionEditor
modals (dropdown + sliders + live preview swatch).

Pattern set (10 total): solid (the existing flat fill, default),
diagonal stripes ↗ / ↖, crosshatch, polka dots, grid, zigzag,
triangles, scales, checker.

On screen: SVG <pattern> defs are deduped per (key,color,scale) and
referenced from each overlay path's fill. Stroke stays solid color so
blob boundaries remain crisp. Per-overlay opacity replaces the
hardcoded 0.45 group opacity.

PNG export: mirrored via Canvas patterns built from an offscreen tile
per (key,color,scale), cached for the render pass.

Backwards compatible — overlays without the new frontmatter keys fall
back to solid + 0.45 opacity, matching pre-1.3.0 behavior.
2026-06-17 11:53:04 -04:00
isaprettycoolguy@protonmail.com
1fa2153bf1 chore: address obsidianmd lint and popout-window compat (1.2.1)
- Sentence-case: rephrase "GM" → "Game master"; remove disable comments;
  autofixer lowercases "🎲 Open tables view" / "← Back" to comply
- no-static-styles-assignment: dynamic colors now use CSS custom properties
  (--duckmage-bg / --duckmage-border-color / --duckmage-fg) consumed by
  existing classes; static positions moved to small modifier classes
  (duckmage-rt-roll-btn-spaced, duckmage-wf-steps-list, etc.); terrain
  toolbar uses is-terrain-preview / is-eyedropper-active toggles;
  createIconEl uses new duckmage-masked-icon class
- Popout-window compat: setTimeout / clearTimeout / requestAnimationFrame
  → window.X; document.X → activeDocument.X across all view/modal files
- Unnecessary `as ArrayBuffer`: replace `data.buffer.slice(...) as ArrayBuffer`
  with `new ArrayBuffer + Uint8Array.set` — gets a real ArrayBuffer without
  the assertion (also avoids ArrayBufferLike narrowing)
- Deprecated SettingTab.display(): extract body into private renderSettings();
  display() and post-action refresh both call it
- eslint.config: add activeDocument + activeWindow to globals so the renamed
  identifiers don't trip no-undef

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-05 23:04:11 -04:00
isaprettycoolguy@protonmail.com
6aa885b5b2 feat: export module — PDF/Markdown for notes, hexes, maps, tables, workflows (1.2.0)
Adds a unified export pipeline under src/export/ with exporters for single notes,
structured hexes, maps (with reference table), random tables, and workflows
(with rolled samples). PDF rendering reuses Obsidian's MarkdownRenderer + theme
CSS; map PNG/PDF goes through a dedicated canvas renderer.

UI surface:
- "Export" tab in MapModal (PNG/PDF with overlay + size options)
- "Export" link in HexEditorModal + HexExportModal
- "Export PDF/Markdown" links in RandomTableView header
- "Export…" button in WorkflowEditorModal + WorkflowExportModal
- Commands: export current note (PDF/MD), current hex, current workflow
- File-menu items on any .md file: Export to PDF / Markdown

Other:
- New `exportFolder` setting (defaults to {worldFolder}/exports)
- hexGeometry: add hexSize / hexCenter / hexPolygonPoints / gridBoundingBox
- HexTableView + HexEditorModal: first-wins on duplicate palette names
  (matches HexMapView's .find() behaviour)
- Tests: unit + integration suites for all exporters; sim-vault fixture

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-05 20:46:41 -04:00
isaprettycoolguy@protonmail.com
0f910233ee 1.1.15
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 09:16:19 -04:00
isaprettycoolguy@protonmail.com
910d425040 1.1.13
feat: tabbed Maps modal; faction hover tooltip; map starting coordinates; default map/submap sizes in settings

- Maps modal refactored into three tabs: Maps (switch/delete), Properties (rename, terrain theme), New map (labeled fields, size presets)
- Faction overlay hover shows each faction on its own line with color swatch via custom floating tooltip div
- New map and submap creation accept starting X/Y coordinates; hex filenames and labels both reflect the chosen origin (gridOffset initialized accordingly)
- Map switching via modal now goes through switchToMap so viewport save/restore applies correctly
- Added defaultNewMapCols/Rows and defaultSubmapCols/Rows settings; new-map forms pre-fill from these

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:43:50 -04:00
isaprettycoolguy@protonmail.com
41872b28e4 feat: undo/redo for icon, faction, region tools; token stacking offsets
- Undo/redo now covers all paint tool types: terrain (existing), icon
  override, faction link paint/erase, and region paint/erase. Each
  stroke is committed on mouseup using the same Map-per-stroke pattern
  as terrain.
- Fix: undoing an icon override now restores the underlying terrain icon
  (previously left the hex blank).
- Fix: "Remove icon override" context menu item now calls renderGrid so
  the icon disappears immediately without a reload.
- Multiple tokens on the same hex now spread out using preset offset
  patterns (2=left/right, 3=triangle, 4=2×2, 5=pentagon, 6+=ring) so
  all tokens are visible with slight overlap. Spread radius scales with
  hex size.
- Hovered token rises above stacked siblings via z-index on :hover.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 15:55:04 -04:00
isaprettycoolguy@protonmail.com
8214294c5e 1.1.9
- folder tree view in link-table modal (collapsed by default, filter expands all)
- shared renderFolderTree utility; RandomTableView refactored to use it
- submap picker: filterable list replaces combo-dropdown; terrain theme swatch per map
- map terrain theme: per-map terrainType field drives submap center-dot color and swatch in switch-map list
- erase mode for paths/factions/regions: "Remove" tile + enters erase immediately
- submap link tool: blip animation on hex after linking
- hex map view header updates to active map name on switch
- fix: link-table modal scopes folder tree to tablesFolder only (was leaking vault-wide folders)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:49:41 -04:00
isaprettycoolguy@protonmail.com
8078b37215 feat: right-click context menu for all painter tools; remove map mode button
Single right-click while any drawing tool is active now opens a context
menu with "Switch <toolname>" (where applicable) and "Exit tool", replacing
the old double-right-click-to-exit gesture and the "↩ map mode" toolbar
button that caused layout shift (fixes #17).

New PainterContextMenu class is designed for subclass extension via
extraOptions() — individual tools can inject additional items later.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 20:14:32 -04:00
isaprettycoolguy@protonmail.com
2f4e368add pin modal button row to bottom via margin-top:auto
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 14:28:27 -04:00
isaprettycoolguy@protonmail.com
937751319d increase min-height of draggable modals to 420px
Prevents MapLinkModal and SubmapPickerModal from being too short to show
the combo dropdown without triggering a scroll.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 14:26:22 -04:00
isaprettycoolguy@protonmail.com
83cd8e2da0 fix combo dropdown scroll: suppress modal-content overflow while open
position:fixed failed because Obsidian's modal CSS animation sets transform on
.modal, making fixed children position relative to it (not the viewport).
Instead, toggle .duckmage-combo-open on .modal-content (overflow-y:visible)
while the dropdown is open so the absolute-positioned dropdown doesn't trigger
the scroll container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 12:42:04 -04:00
isaprettycoolguy@protonmail.com
ff8479c59c fix combo dropdown: position:fixed escapes modal scroll, blank inputs in map modals
- Combo dropdown now uses position:fixed with JS-calculated viewport coords so it
  never causes the modal's overflow-y:auto container to scroll
- MapLinkModal: map filter and link text both start blank; link text auto-fills
  on map selection only if still empty
- SubmapPickerModal: focus opens all maps (blank query)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 12:35:34 -04:00
isaprettycoolguy@protonmail.com
31d3256192 add submap links: link hex to another map, centre-dot nav, back button, map link insert
- Right-click hex → "Link submap" writes duckmage-submap frontmatter
- Hex flower shows centre dot (hidden when no link) that navigates into the submap
- Centre dot centering is orientation-aware (flat-top top:24px, pointy-top top:20px)
- ← Back button appears next to map dropdown (via flex nav group) after submap drill-in
- "Insert map link" editor context menu inserts obsidian://duckmage-openmap URI
- Map rename updates all duckmage-submap references via updateSubmapReferences()
- HexEditorOptions refactored: onNavigate/onModalClose/onSwitchMap in options object
- 10 new tests for submap frontmatter helpers and rename propagation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 12:29:22 -04:00
isaprettycoolguy@protonmail.com
a23a98b982 add token layer: place, edit, and inspect tokens on the hex map
- Tokens placed per-hex link to vault notes; support circle/square shape,
  sm/md/lg size, fill color, optional border color, icon, and description
- TokenInfoModal shows note content (formatted via MarkdownRenderer, images
  included) with jump-to-hex, open-note, edit, and two-step remove actions
- Edit flow reopens TokenModal pre-filled; proxy notes handle multiple tokens
  referencing the same source note
- Icon picker replaced with scrollable palette grid (2-row cap, drag-to-reorder,
  hide/show) in both HexEditorModal and TokenModal; order persisted in settings
- Token layer toggle added to layers menu (default on)
- Fix metadata-cache race on token delete (wasToken check prevents missed updates)
- Token preview rendered inline in TokenModal title row; real-time color preview
  via native input event on color pickers
- Bump version to 1.1.6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 08:26:20 -04:00
isaprettycoolguy@protonmail.com
b84bc1811c fix !important in shrink button styles; raise selector specificity instead
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 03:51:47 -04:00
isaprettycoolguy@protonmail.com
fb98acbbaf bump version to 1.1.4; fix zoom pixelation, brush size reset, shrink rows/cols, icon folder onboarding
- Fix map pixelation on zoom: bake CSS scale() into viewport font-size after
  scroll wheel settles so the DOM renders natively at the zoomed resolution
  instead of upscaling a compositor bitmap; redraw SVG overlays after bake
- Fix terrain brush size persisting when switching to icon tool: reset
  paintBrushSize to 1 on icon mode entry
- Add shrink (−) buttons paired with each expand (+) button: fade in on hover,
  positioned to the right for top/bottom and below for left/right; clicking a
  clean row/col shrinks immediately and trashes the hex notes; clicking a dirty
  row/col shows a red OK? confirm state (3 s timeout) before deleting
- Fix stale terrain showing after delete+re-expand: pass null terrain/icon
  overrides for newly-added edge hexes so cached frontmatter from deleted files
  cannot bleed through
- Add iconsFolder to onboarding wizard folder generation step

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 03:38:01 -04:00
isaprettycoolguy@protonmail.com
469cc56894 refine map delete UX: always-visible X, block last-map deletion, no red wash
- Replace hover-fade "Delete" button with a fixed 20×20px ✕ button always
  visible in each map row
- Hide the ✕ entirely when only one map remains (deletion blocked)
- Remove red background from confirmation row; use muted text instead

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 17:00:02 -04:00
isaprettycoolguy@protonmail.com
891434b36f add delete map button with confirmation to MapModal
Each map row in the switch-map list now shows a "Delete" button (visible on
hover). Clicking it enters an inline confirmation state showing the map name
and a warning that hex notes will be trashed. Confirming calls
fileManager.trashFile() on the hex folder (if it exists), removes the map
entry from settings, reassigns defaultMap/activeMapName to the next available
map, saves, and re-renders. Cancelling returns to normal without changes.

Fixes #3 — map entries left dangling after manual folder deletion are now
cleanly removable through the UI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 16:51:03 -04:00
isaprettycoolguy@protonmail.com
683ef17ec1 add first-install setup wizard; bump to 1.1.0
- New SetupWizardView (ItemView): 4-step welcome → folders → map → done
- Wizard auto-opens on first install (setupComplete/setupDismissed flags)
- Folder step creates all world subfolders and ensures hex template exists
- Map step creates the first hex grid; done step shows recommended next steps
- "Open hex map" from done step opens map with terrain picker + toolbar open
- Re-run wizard button added to settings tab
- Fix: loadAvailableIcons() now runs inside onLayoutReady (vault readiness)
- Fix: migrateHexFilesToDefaultRegion() no longer creates world/hexes/default
  on fresh installs — scans candidates first, early-returns if none found
- Fix: loadHexTemplate() falls back to built-in default instead of returning null
- Fix: terrain toolbar button re-opens picker when clicked while active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 16:39:01 -04:00
isaprettycoolguy@protonmail.com
2af3b68f8f fix portal warnings: CSS !important, duplicate selectors, hex color, README title
styles.css:
- Remove all !important declarations by increasing selector specificity instead:
  - terrain icon hide: fix competing rule with :not(.duckmage-hide-terrain-icons)
    so the fallback only shows when terrain icons are not already hidden
  - modal size: .modal.duckmage-editor-modal-drag beats Obsidian's .modal rule
  - error border: input.duckmage-input-error beats attribute selectors
  - hidden row: tr.duckmage-row-hidden beats UA table-row default
  - copy cell padding: .duckmage-random-table prefix beats table td defaults
- Merge duplicate .duckmage-icon-option (add position:relative to original)
- Remove duplicate .duckmage-rt-folder-header (first declaration already has
  display:flex and align-items:center)
- Expand #fff to #ffffff

README.md:
- Change title from "Hexmaker" to "Hexmap World Creator" to match manifest.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:06:16 -04:00
isaprettycoolguy@protonmail.com
d91ea4eb57 add initial gm layer pass 2026-05-10 16:22:38 -04:00
isaprettycoolguy@protonmail.com
31f9bbe0d8 fix up faction overlay and add legend, add region overlay, add region encounter tables 2026-05-10 09:10:15 -04:00
isaprettycoolguy@protonmail.com
90d2496fc3 add and enhance faction overlay. 2026-05-09 20:49:23 -04:00
isaprettycoolguy@protonmail.com
4b141857b3 fixes and adding overlays and icon upload 2026-04-11 12:15:54 -04:00
isaprettycoolguy@protonmail.com
37c4a866bc auto update links in the random tables 2026-04-04 11:51:53 -04:00
nyxsys
ca49d08331 fix issues from pr, begin optimizing again 2026-03-30 16:19:57 -04:00
isaprettycoolguy@protonmail.com
2091648b26 add actual edge pathing 2026-03-26 21:07:04 -04:00
isaprettycoolguy@protonmail.com
eb0e7a841c allow user to set random weights to negative and add -1 to all 2026-03-25 13:32:56 -04:00
isaprettycoolguy@protonmail.com
d9c4f85087 allow user to add path types, include undo/redo support for them 2026-03-25 13:18:24 -04:00
isaprettycoolguy@protonmail.com
0f205e0702 adjust UX and make terrain more easily edited 2026-03-24 19:56:52 -04:00
isaprettycoolguy@protonmail.com
632e514c3e add undo and redo 2026-03-23 22:26:50 -04:00
isaprettycoolguy@protonmail.com
b16e590f70 add license and additional palette support 2026-03-23 15:38:32 -04:00
isaprettycoolguy@protonmail.com
81fcd9cccc optimizations and clean up hex map ui 2026-03-20 19:30:13 -04:00
isaprettycoolguy@protonmail.com
68d4edb65d reorganize files 2026-03-20 15:35:35 -04:00
isaprettycoolguy@protonmail.com
b8f3c5df05 add filter to random table view 2026-03-18 21:35:46 -04:00
isaprettycoolguy@protonmail.com
7557d18c2e expand tests and enhance workflow editing 2026-03-18 17:19:32 -04:00
isaprettycoolguy@protonmail.com
803d2fc5a5 improve adding/removing labels to workflows 2026-03-18 08:40:04 -04:00
isaprettycoolguy@protonmail.com
b6af1a5b13 clean up workflow view, remove encounter column from hex table 2026-03-17 22:39:46 -04:00
isaprettycoolguy@protonmail.com
583c3f656e create workflow tool 2026-03-17 16:18:42 -04:00
isaprettycoolguy@protonmail.com
2ebee21308 improve random table styling 2026-03-16 18:55:06 -04:00
isaprettycoolguy@protonmail.com
2447c12568 make it easy for user to add links to tables 2026-03-16 17:38:39 -04:00
isaprettycoolguy@protonmail.com
68e2a51c91 improve terrain drawing 2026-03-16 16:30:23 -04:00
isaprettycoolguy@protonmail.com
48d4b4ea5e add regions, fix abiliensure additional regions work properly with default setting and so on 2026-03-16 12:46:57 -04:00
isaprettycoolguy@protonmail.com
ed49bd663f reorganize hex map ui 2026-03-16 11:01:20 -04:00
isaprettycoolguy@protonmail.com
e82417d743 go through review process and make a file to do so again in the future 2026-03-15 09:34:53 -04:00
isaprettycoolguy@protonmail.com
bdb9807e32 add click and d 2026-03-14 21:10:06 -04:00
isaprettycoolguy@protonmail.com
c7e177554c add delete table function to tree view 2026-03-14 20:32:10 -04:00
isaprettycoolguy@protonmail.com
c283ffe9c8 set up random table view to enable the ability to generate folders with notes based on the tables. ux fixes 2026-03-14 19:51:32 -04:00
isaprettycoolguy@protonmail.com
4cf513585f make random tables view start collapsed, add include/exclude from the dropdowns for random tables 2026-03-14 18:44:08 -04:00