fix: restore rescaleLabels on load

This commit is contained in:
Azgaar 2021-10-09 19:25:59 +03:00
parent 24b6023458
commit 167e2f2c66
2 changed files with 61 additions and 30 deletions

View file

@ -234,7 +234,7 @@ function parseLoadedData(data) {
if (settings[20]) mapName.value = settings[20]; if (settings[20]) mapName.value = settings[20];
if (settings[21]) hideLabels.checked = +settings[21]; if (settings[21]) hideLabels.checked = +settings[21];
if (settings[22]) stylePreset.value = settings[22]; if (settings[22]) stylePreset.value = settings[22];
if (settings[23]) rescaleLabels.checked = settings[23]; if (settings[23]) rescaleLabels.checked = +settings[23];
})(); })();
void (function parseConfiguration() { void (function parseConfiguration() {

View file

@ -181,15 +181,15 @@ window.Markers = (function () {
const river = pack.rivers.find(r => r.i === pack.cells.r[cell]); const river = pack.rivers.find(r => r.i === pack.cells.r[cell]);
const riverName = river ? `${river.name} ${river.type}` : "river"; const riverName = river ? `${river.name} ${river.type}` : "river";
const name = river && P(0.2) ? river.name : burg.name; const name = river && P(0.2) ? river.name : burg.name;
const weightedAdjectives = { const weightedAdjectives = {
"stone":10, stone: 10,
"wooden":1, wooden: 1,
"lengthy":2, lengthy: 2,
"formidable":2, formidable: 2,
"rickety":1, rickety: 1,
"beaten":1, beaten: 1,
"weathered":1, weathered: 1
}; };
notes.push({id, name: `${name} Bridge`, legend: `A ${rw(weightedAdjectives)} bridge spans over the ${riverName} near ${burg.name}`}); notes.push({id, name: `${name} Bridge`, legend: `A ${rw(weightedAdjectives)} bridge spans over the ${riverName} near ${burg.name}`});
quantity--; quantity--;
} }
@ -468,15 +468,15 @@ window.Markers = (function () {
const waterfalls = Array.from(cells.i.filter(i => cells.r[i] && !occupied[i] && cells.h[i] >= 50 && cells.c[i].some(c => cells.h[c] < 40 && cells.r[c]))); const waterfalls = Array.from(cells.i.filter(i => cells.r[i] && !occupied[i] && cells.h[i] >= 50 && cells.c[i].some(c => cells.h[c] < 40 && cells.r[c])));
const quantity = getQuantity(waterfalls, 1, 5, multiplier); const quantity = getQuantity(waterfalls, 1, 5, multiplier);
if (!quantity) return; if (!quantity) return;
const descriptions = [ const descriptions = [
"A gorgeous waterfall flows here", "A gorgeous waterfall flows here",
"The rapids of an exceptionally beautiful waterfall", "The rapids of an exceptionally beautiful waterfall",
"An impressive waterfall has cut through the land", "An impressive waterfall has cut through the land",
"The cascades of a stunning waterfall", "The cascades of a stunning waterfall",
"A river drops down from a great height forming a wonderous waterfall", "A river drops down from a great height forming a wonderous waterfall",
"A breathtaking waterfall cuts through the landscape", "A breathtaking waterfall cuts through the landscape"
]; ];
for (let i = 0; i < waterfalls.length && i < quantity; i++) { for (let i = 0; i < waterfalls.length && i < quantity; i++) {
const cell = waterfalls[i]; const cell = waterfalls[i];
const id = addMarker({cell, icon, type, dy: 54, px: 16}); const id = addMarker({cell, icon, type, dy: 54, px: 16});
@ -569,7 +569,7 @@ window.Markers = (function () {
let quantity = getQuantity(hills, 30, 600, multiplier); let quantity = getQuantity(hills, 30, 600, multiplier);
if (!quantity) return; if (!quantity) return;
const adjectives = [ const adjectives = [
"great", "great",
"big", "big",
"huge", "huge",
@ -582,12 +582,29 @@ window.Markers = (function () {
"hungry", "hungry",
"magical", "magical",
"superior", "superior",
"terrifying", "terrifying",
"horrifying", "horrifying",
"feared" "feared"
]; ];
const subjects = ["Locals", "Elders", "Inscriptions", "Tipplers", "Legends", "Whispers", "Rumors", "Journeying folk", "Tales"]; const subjects = ["Locals", "Elders", "Inscriptions", "Tipplers", "Legends", "Whispers", "Rumors", "Journeying folk", "Tales"];
const species = ["Ogre", "Troll", "Cyclops", "Giant", "Monster", "Beast", "Dragon", "Undead", "Ghoul", "Vampire", "Hag", "Banshee", "Bearded Devil", "Roc", "Hydra", "Warg"]; const species = [
"Ogre",
"Troll",
"Cyclops",
"Giant",
"Monster",
"Beast",
"Dragon",
"Undead",
"Ghoul",
"Vampire",
"Hag",
"Banshee",
"Bearded Devil",
"Roc",
"Hydra",
"Warg"
];
const modusOperandi = [ const modusOperandi = [
"steals cattle at night", "steals cattle at night",
"prefers eating children", "prefers eating children",
@ -595,11 +612,11 @@ window.Markers = (function () {
"keeps the region at bay", "keeps the region at bay",
"eats kids whole", "eats kids whole",
"abducts young women", "abducts young women",
"terrorizes the region", "terrorizes the region",
"harasses travelers in the area", "harasses travelers in the area",
"snatches people from homes", "snatches people from homes",
"attacks anyone who dares to approach its lair", "attacks anyone who dares to approach its lair",
"attacks unsuspecting victims" "attacks unsuspecting victims"
]; ];
while (quantity) { while (quantity) {
@ -812,7 +829,21 @@ window.Markers = (function () {
let quantity = getQuantity(ruins, 80, 1200, multiplier); let quantity = getQuantity(ruins, 80, 1200, multiplier);
if (!quantity) return; if (!quantity) return;
const types = ["City", "Town", "Settlement", "Pyramid", "Fort", "Stronghold", "Temple", "Sacred site", "Mausoleum", "Outpost", "Fortification", "Fortress", "Castle"]; const types = [
"City",
"Town",
"Settlement",
"Pyramid",
"Fort",
"Stronghold",
"Temple",
"Sacred site",
"Mausoleum",
"Outpost",
"Fortification",
"Fortress",
"Castle"
];
while (quantity) { while (quantity) {
const [cell] = extractAnyElement(ruins); const [cell] = extractAnyElement(ruins);