From e21999a736a6929e87a475f639223f69fa392ee8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 17 Nov 2025 22:27:47 +0000 Subject: [PATCH] feat(markers): add province information to markers, v1.108.14 - Attach province ID to markers when created (markers-generator.js) - Add migration function to populate province data for old maps (load.js) - Clean up code formatting and remove user-specific Obsidian paths - Update version to 1.108.14 - Update file hashes in index.html --- index.html | 4 ++-- modules/io/load.js | 3 +++ modules/markers-generator.js | 23 +++++++++-------------- versioning.js | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 1e60bf17..c54130fd 100644 --- a/index.html +++ b/index.html @@ -8218,7 +8218,7 @@ - + @@ -8278,7 +8278,7 @@ - + diff --git a/modules/io/load.js b/modules/io/load.js index 9e235e57..fc65bb69 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -716,6 +716,9 @@ async function parseLoadedData(data, mapVersion) { // sort markers by index pack.markers.sort((a, b) => a.i - b.i); } + + // assign biome and province info to markers for old maps or maps without this data + if (typeof assignBiomeAndProvinceInfo !== "undefined") assignBiomeAndProvinceInfo(); } { diff --git a/modules/markers-generator.js b/modules/markers-generator.js index ebf544e2..9aab5483 100644 --- a/modules/markers-generator.js +++ b/modules/markers-generator.js @@ -177,20 +177,15 @@ window.Markers = (function () { if (marker.cell === undefined) return; const i = last(pack.markers)?.i + 1 || 0; const [x, y] = getMarkerCoordinates(marker.cell); - // Attach biome and province info - const biome = pack.cells.biome[marker.cell]; - const province = pack.cells.province ? pack.cells.province[marker.cell] : undefined; - // Add Obsidian note path (customize as needed) - const obsidianNotePath = `Neblub/Orbis/Markers/${marker.type}-${marker.cell}`; - marker = {...base, x, y, ...marker, i, biome, province, obsidianNotePath}; -// Utility to open Obsidian note for a marker -window.openObsidianNote = function(notePath) { - const uri = `obsidian://open?vault=Neblub&file=${encodeURIComponent(notePath)}`; - window.open(uri, '_blank'); -}; - pack.markers.push(marker); - occupied[marker.cell] = true; - return marker; + + // Attach biome and province info + const biome = pack.cells.biome[marker.cell]; + const province = pack.cells.province ? pack.cells.province[marker.cell] : undefined; + + marker = {...base, x, y, ...marker, i, biome, province}; + pack.markers.push(marker); + occupied[marker.cell] = true; + return marker; } function deleteMarker(markerId) { diff --git a/versioning.js b/versioning.js index 9cb511be..d177db14 100644 --- a/versioning.js +++ b/versioning.js @@ -14,7 +14,7 @@ */ -const VERSION = "1.108.13"; +const VERSION = "1.108.14"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");