Commit graph

1647 commits

Author SHA1 Message Date
Claude
9243c43d2d
fix(obsidian): pass string elementId instead of number to editObsidianNote
The editObsidianNote function expects elementId as a string (e.g. 'burg123')
but was receiving a number. This caused elementId.replace() to fail.

Fixed in both:
- burg-editor.js: Pass 'burg' + id instead of id
- markers-editor.js: Pass id (already a string) instead of marker.i
2025-11-14 04:11:45 +00:00
Claude
619bea1b99
feat: integrate Obsidian notes into burg and marker editors
Replace the old TinyMCE notes editor with Obsidian integration in:
- Burg editor "Edit note" button
- Marker editor "Edit note" button

Changes:
- modules/ui/burg-editor.js: Update editBurgLegend() to call editObsidianNote()
- modules/ui/markers-editor.js: Update editMarkerLegend() to call editObsidianNote()
- Both functions fall back to old editNotes() if Obsidian is not configured
- index.html: Update version hashes to 1.108.13

Now when users click "Edit note" on a burg or marker, they get the modern
Markdown editor with Obsidian vault integration instead of the old WYSIWYG.
2025-11-14 03:59:19 +00:00
Claude
de926c5456
chore: remove debug logging from default map feature 2025-11-14 03:55:45 +00:00
Claude
e8767ce01a
debug: update version hashes for cache busting 2025-11-14 03:44:27 +00:00
Claude
390e70f63a
debug: add logging to troubleshoot default map issue 2025-11-14 03:43:51 +00:00
Claude
45f56b8c5d
fix: persist onloadBehavior setting for default map feature
The default map feature was not working on page refresh because the
onloadBehavior dropdown value was not being persisted or restored.

Changes:
- main.js: Restore onloadBehavior from localStorage on page load
- save.js: saveAsDefaultMap() now saves "default" to localStorage
- save.js: clearDefaultMap() now removes the localStorage setting
- index.html: Update version hashes to 1.108.13

Now when users click "Set as default", the setting persists across
page refreshes and their default map loads automatically.
2025-11-14 03:38:33 +00:00
Claude
57b7980dbc
fix(v1.108.13): add comprehensive race condition guards in load.js
Add typeof checks for all function calls to modules loaded with defer attribute.
This prevents ReferenceError when loading old maps (1.108.11) in version 1.108.13.

Functions protected:
- getCurrentPreset() - from style.js
- addCustomColorScheme() - from style.js
- updateTextureSelectValue() - from style.js
- focusOn() - from editors.js
- invokeActiveZooming() - from zoom.js
- fitMapToScreen() - from zoom.js
- declareFont() - from fonts.js
- moveBurgToGroup() - from burgs.js (3 locations)

This fixes zoom/pan issues when loading old maps.
2025-11-14 03:30:12 +00:00
Claude
74b9310c57
fix: check if updateTextureSelectValue is defined before calling 2025-11-14 03:22:23 +00:00
Claude
a1f9c6dde3
fix: update load.js version hash to bust cache 2025-11-14 03:17:33 +00:00
Claude
8d7a1635f9
fix: prevent ReferenceError when loading maps before style.js loads
Check if heightmapColorSchemes is defined before accessing it to
prevent race condition between load.js and style.js initialization.
2025-11-14 03:10:35 +00:00
Nathan Eckenrode
428349f6fb
Merge branch 'master' into claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM 2025-11-13 22:01:51 -05:00
Claude
769d3a31bb
feat: add Obsidian vault integration for modern Markdown notes
Add comprehensive Obsidian integration as intermediate step toward
PostgreSQL migration, enabling modern Markdown-based note editing:

**Features:**
- Obsidian Local REST API integration for vault access
- Coordinate-based note matching (searches vault YAML frontmatter)
- Shows top 5-8 closest matches when clicking burgs/markers
- Modern Markdown editor with live preview
- [[Wikilink]] support for connecting notes
- "Open in Obsidian" button to jump to native app
- Configuration UI for API setup and testing

**Technical Implementation:**
- modules/io/obsidian-bridge.js - Core API integration layer
- modules/ui/obsidian-notes-editor.js - Markdown editor UI
- modules/ui/obsidian-config.js - Configuration panel
- OBSIDIAN_INTEGRATION.md - Complete setup/usage guide

**Coordinate Matching:**
- Parses YAML frontmatter for x/y coordinates
- Calculates distance to clicked element
- Supports nested (coordinates.x) and flat (x:) formats
- Handles missing FMG IDs (common with PostgreSQL imports)

**User Workflow:**
1. Configure Obsidian REST API connection
2. Click burg/marker in FMG
3. System finds matching notes by coordinates
4. Select note or create new one
5. Edit in modern Markdown editor
6. Save syncs to Obsidian vault instantly

This replaces the "Win95-style TinyMCE" editor with a clean,
modern Markdown experience while maintaining compatibility with
the eventual PostgreSQL backend migration. Users can edit notes
in either FMG or Obsidian - both stay in sync via file system.

Version: 1.108.13
2025-11-14 02:57:07 +00:00
Claude
acc2d112f3
feat: add default map setting feature
Add ability to set a specific map as the default that opens on load:

- Add 'Open default map' option to onload behavior dropdown
- Implement saveAsDefaultMap() to store map as default in IndexedDB
- Implement clearDefaultMap() to remove default map setting
- Modify checkLoadParameters() to load default map when configured
- Add UI buttons in Save dialog for setting/clearing default map
- Update version to 1.108.12 and hash in index.html

Users can now:
1. Open any map they want as default
2. Go to Options > Onload behavior > Select "Open default map"
3. Save > Click "Set as default" button
4. The map will now open automatically every time

This sets the foundation for the planned time-based worldbuilding
and lore database features by ensuring users always start with
their primary world map.
2025-11-14 02:33:16 +00:00
Claude
6afa016920
docs: add comprehensive CLAUDE.md for AI assistants
Add detailed documentation to help AI assistants understand and work
with the Fantasy Map Generator codebase, including:

- Project architecture and technology stack
- Directory structure and file organization
- Data model and core concepts (pack object, Voronoi mesh)
- Code conventions and module patterns
- Development workflow and versioning process
- Common development tasks and patterns
- Performance considerations and best practices
- Troubleshooting guide and quick reference

This guide provides AI assistants with essential context about the
codebase's unique characteristics (no build system, global object
pattern, typed arrays, D3.js rendering) to enable more effective
contributions.
2025-11-14 02:21:52 +00:00
Copilot
f73a8906ce
Add comprehensive GitHub Copilot instructions for Fantasy Map Generator (#1233)
* Initial plan

* Add comprehensive GitHub Copilot instructions for Fantasy Map Generator

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

* chore: copilot instructions

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
2025-08-29 17:20:03 +02:00
Azgaar
538cc3423a fix: 1227 2025-08-29 14:36:34 +02:00
Ender-Emp
ab08dc9429
fix regex of 'and' adjectivization rule (#1225) 2025-08-02 13:48:10 +02:00
Azgaar
d06ebe5ac8 fix(v1.108.11): add external icons to export in base64 format 2025-07-18 02:31:10 +02:00
Azgaar
738732364e fix(ui): correct marker note lookup by adding prefix 2025-07-02 00:52:41 +02:00
Azgaar
c26827bfe5 fix(markers-overview): correct note lookup by marker id 2025-07-01 23:16:07 +02:00
Nekomantikku
a3dcc8d2c4
Merge pull request #1212 from Nekomantikku/master
Add shell script to launch local HTTP server and open browser (GNU/Linux)
2025-06-20 00:18:57 +02:00
Azgaar
d9391d6d97
Merge pull request #1211 from Azgaar/ollama
Ollama: local AI text generation
2025-06-14 16:13:59 +02:00
Azgaar
c891689796 feat(ai-generator): update supported AI models list 2025-06-14 15:24:23 +02:00
Azgaar
d96e339043 chore: update version to 1.108.8 2025-06-14 15:20:41 +02:00
Azgaar
bba3587e50 refactor: ollama generation 2025-06-14 15:20:01 +02:00
Krory
fe2fa6d6b8
Ollama integration as a new AI provider (#1208)
* ollama implementation

* ollama implementation

* Update ai-generator.js

* Update README.md

* Create OLLAMAREADME.MD

* Update OLLAMAREADME.MD

* Update notes-editor.js

* Update index.html

* Update OLLAMAREADME.MD

* Update ai-generator.js
2025-06-14 14:03:06 +02:00
Greger
004097ef93
Make id field in exports more consistent. (#1210)
The id field for geojson export was not consistent with csv exports.
Removes the prefix on routes, rivers and markers geojson, and on
markers csv, to make them all use only an integer as id.

This makes it easier to import and do joins in other software.
2025-06-11 00:42:31 +02:00
Azgaar
a6f66e9828 fix: grid layer to not be clickable 2025-03-09 13:29:45 +01:00
Ruichka
8131f25456
Allow data URI scheme for custom images (#1196)
* Allow data URL external images

* fix

* removed inconsistency
2025-03-08 14:51:48 +01:00
Azgaar
f859439fc8 refactor: drawReliefIcons, v1.108.4 2025-02-15 18:13:45 +01:00
Azgaar
4dd34e13d1 refactor: drawReliefIcons, v1.108.4 2025-02-15 18:03:54 +01:00
Azgaar
791347b1ee feat: generate less water ice, v1.108.3 2025-02-15 17:45:16 +01:00
Azgaar
12b8b941e3 fix: remove old lake paths on drawFeatures, v1.108.2 2025-02-15 15:09:39 +01:00
Azgaar
d98ef5717e perf: set text-rendering to optimizeSpeed, v1.108.1 2025-02-15 14:43:51 +01:00
Azgaar
764993b680 fix: remove old feature masks, v1.108.0 2025-02-15 13:06:14 +01:00
Azgaar
e39ca793f2 feat: add growthRate to safe file 2025-02-13 02:54:37 +01:00
Azgaar
e526646076 fix: notes editor size to be relative to canvas size 2025-02-10 12:41:14 +01:00
Azgaar
51c47a18d2 fix: external icons - battle screen 2025-02-10 01:39:21 +01:00
Azgaar
01a69fd40b Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator 2025-02-08 15:13:23 +01:00
Azgaar
22636b1b62 fix: data integrity checks - better Stripping issue detection, v1.107.1 2025-02-08 15:12:57 +01:00
Azgaar
92b0b4d306
Merge pull request #1187 from Azgaar/linked-icons
Custom images for Markers and Regiments
2025-02-08 14:21:44 +01:00
Azgaar
0be14790d2 feat: rerender affected layers on auto-update 2025-02-08 14:15:59 +01:00
Azgaar
33a02aeea0 chore: cleanup 2025-02-08 14:06:33 +01:00
Azgaar
d51deffdac feat: make lined icons work for all elements, v1.107.0 2025-02-08 14:05:28 +01:00
Issac411
7b8ffd025f
custom pictures for regiments (#1183)
* forms and ajustements

* variable size for style as requested
2025-01-19 23:29:27 +01:00
Azgaar
5bb33311fb fix: 1.106.7 - rivers starting width calc 2024-12-17 17:11:13 +01:00
Azgaar
04c6fb3ee7 feat: like temp likeness, 1.106.6 2024-12-17 12:48:41 +01:00
Azgaar
f15bccd610 style: increase dialog buttons size 2024-12-16 14:30:11 +01:00
Azgaar
6d4c9f6b18 fix: sumap - clip routes by bbox 2024-12-14 15:12:38 +01:00
Azgaar
488f51a0f4 fix: don't mask routes 2024-12-13 19:53:57 +01:00