diff --git a/index.css b/index.css
index 505b0716..b4ec49ce 100644
--- a/index.css
+++ b/index.css
@@ -2077,7 +2077,6 @@ div.textual span,
}
#notesBody > iframe {
- pointer-events: none;
user-select: none;
}
diff --git a/index.html b/index.html
index 6c03982b..d0a0c35c 100644
--- a/index.html
+++ b/index.html
@@ -7980,7 +7980,7 @@
-
+
@@ -7991,7 +7991,7 @@
-
+
diff --git a/modules/markers-generator.js b/modules/markers-generator.js
index 14d3ee59..dce9f4ab 100644
--- a/modules/markers-generator.js
+++ b/modules/markers-generator.js
@@ -56,6 +56,7 @@ window.Markers = (function () {
{type: "rifts", icon: "ð", min: 5, each: 3000, multiplier: +isFantasy, list: listRifts, add: addRift},
{type: "disturbed-burials", icon: "ð", min: 20, each: 3000, multiplier: +isFantasy, list: listDisturbedBurial, add: addDisturbedBurial},
{type: "necropolises", icon: "ðŠĶ", min: 20, each: 1000, multiplier: 1, list: listNecropolis, add: addNecropolis},
+ {type: "encounters", icon: "ð§", min: 10, each: 1000, multiplier: 1, list: listEncounters, add: addEncounter},
];
}
@@ -603,7 +604,7 @@ window.Markers = (function () {
function addDungeon(id, cell) {
const dungeonSeed = `${seed}${cell}`;
const name = "Dungeon";
- const legend = `
`;
+ const legend = ``;
notes.push({id, name, legend});
}
@@ -849,18 +850,16 @@ window.Markers = (function () {
const culture = cells.culture[cell];
const biome = cells.biome[cell];
const height = cells.p[cell];
- const locality =
- height >= 70
- ? "highlander"
- : [1, 2].includes(biome)
- ? "desert"
- : [3, 4].includes(biome)
- ? "mounted"
- : [5, 6, 7, 8, 9].includes(biome)
- ? "forest"
- : biome === 12
- ? "swamp"
- : "angry";
+
+ const locality = ((height, biome) => {
+ if (height >= 70) return "highlander";
+ if ([1, 2].includes(biome)) return "desert";
+ if ([3, 4].includes(biome)) return "mounted";
+ if ([5, 6, 7, 8, 9].includes(biome)) return "forest";
+ if (biome === 12) return "swamp";
+ return "angry";
+ })(height, biome);
+
const name = `${Names.getCulture(culture)} ${ra(animals)}`;
const legend = `A gang of ${locality} ${rw(types)}.`;
notes.push({id, name, legend});
@@ -1270,5 +1269,16 @@ window.Markers = (function () {
notes.push({id, name, legend});
}
+ function listEncounters({cells}) {
+ return cells.i.filter(i => !occupied[i] && cells.h[i] >= 20 && cells.pop[i] > 1);
+ }
+
+ function addEncounter(id, cell) {
+ const name = "Random encounter";
+ const encounterSeed = cell; // use just cell Id to not overwhelm the Vercel KV database
+ const legend = `You have encountered a character.
`;
+ notes.push({id, name, legend});
+ }
+
return {add, generate, regenerate, getConfig, setConfig, deleteMarker};
})();
diff --git a/modules/ui/general.js b/modules/ui/general.js
index 191b7126..7dc6a2ac 100644
--- a/modules/ui/general.js
+++ b/modules/ui/general.js
@@ -87,6 +87,8 @@ function handleMouseMove() {
if (cellInfo?.offsetParent) updateCellInfo(point, i, gridCell);
}
+let currentNoteId = null; // store currently displayed node to not rerender to often
+
// show note box on hover (if any)
function showNotes(e) {
if (notesEditor?.offsetParent) return;
@@ -96,13 +98,17 @@ function showNotes(e) {
const note = notes.find(note => note.id === id);
if (note !== undefined && note.legend !== "") {
+ if (currentNoteId === id) return;
+ currentNoteId = id;
+
document.getElementById("notes").style.display = "block";
document.getElementById("notesHeader").innerHTML = note.name;
document.getElementById("notesBody").innerHTML = note.legend;
- } else if (!options.pinNotes && !markerEditor?.offsetParent) {
+ } else if (!options.pinNotes && !markerEditor?.offsetParent && !e.shiftKey) {
document.getElementById("notes").style.display = "none";
document.getElementById("notesHeader").innerHTML = "";
document.getElementById("notesBody").innerHTML = "";
+ currentNoteId = null;
}
}
@@ -160,7 +166,7 @@ function showMapTooltip(point, e, i, g) {
}
if (group === "labels") return tip("Click to edit the Label");
- if (group === "markers") return tip("Click to edit the Marker and pin the marker note");
+ if (group === "markers") return tip("Click to edit the Marker. Hold Shift to not close the assosiated note");
if (group === "ruler") {
const tag = e.target.tagName;
diff --git a/versioning.js b/versioning.js
index fcbb08c4..564a69b2 100644
--- a/versioning.js
+++ b/versioning.js
@@ -1,7 +1,7 @@
"use strict";
// version and caching control
-const version = "1.93.03"; // generator version, update each time
+const version = "1.93.04"; // generator version, update each time
{
document.title += " v" + version;
@@ -28,6 +28,7 @@ const version = "1.93.03"; // generator version, update each time
Latest changes:
+ - Random encounter markers (integration with Deorum)
- Auto-load of the last saved map is now optional (see Onload behavior in Options)
- New label placement algorithm for states
- North and South Poles temperature can be set independently