diff --git a/index.html b/index.html index c1ef6c90..eb3c2ef5 100644 --- a/index.html +++ b/index.html @@ -1631,10 +1631,10 @@ Cultures number - + - + @@ -8053,7 +8053,7 @@ - + @@ -8072,13 +8072,13 @@ - + - + diff --git a/modules/cultures-generator.js b/modules/cultures-generator.js index 65c4f6ba..3096f96c 100644 --- a/modules/cultures-generator.js +++ b/modules/cultures-generator.js @@ -8,7 +8,10 @@ window.Cultures = (function () { cells = pack.cells; const cultureIds = new Uint16Array(cells.i.length); // cell cultures - let count = Math.min(+culturesInput.value, +culturesSet.selectedOptions[0].dataset.max); + + const culturesInputNumber = +byId("culturesInput").value; + const culturesInSetNumber = +byId("culturesSet").selectedOptions[0].dataset.max; + let count = Math.min(culturesInputNumber, culturesInSetNumber); const populated = cells.i.filter(i => cells.s[i]); // populated cells if (populated.length < count * 25) { diff --git a/modules/ui/options.js b/modules/ui/options.js index 1ac4c8ad..88bf53db 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -558,10 +558,10 @@ function applyStoredOptions() { if (key.slice(0, 5) === "style") applyOption(stylePreset, key, key.slice(5)); } - if (stored("winds")) options.winds = localStorage.getItem("winds").split(",").map(Number); - if (stored("temperatureEquator")) options.temperatureEquator = +localStorage.getItem("temperatureEquator"); - if (stored("temperatureNorthPole")) options.temperatureNorthPole = +localStorage.getItem("temperatureNorthPole"); - if (stored("temperatureSouthPole")) options.temperatureSouthPole = +localStorage.getItem("temperatureSouthPole"); + if (stored("winds")) options.winds = stored("winds").split(",").map(Number); + if (stored("temperatureEquator")) options.temperatureEquator = +stored("temperatureEquator"); + if (stored("temperatureNorthPole")) options.temperatureNorthPole = +stored("temperatureNorthPole"); + if (stored("temperatureSouthPole")) options.temperatureSouthPole = +stored("temperatureSouthPole"); if (stored("military")) options.military = JSON.parse(stored("military")); if (stored("tooltipSize")) changeTooltipSize(stored("tooltipSize")); diff --git a/modules/ui/tools.js b/modules/ui/tools.js index 2ab57530..9d26e9dd 100644 --- a/modules/ui/tools.js +++ b/modules/ui/tools.js @@ -513,8 +513,8 @@ function regenerateEmblems() { function regenerateReligions() { Religions.generate(); - if (layerIsOn("toggleReligions")) drawReligions(); - else toggleReligions(); + + layerIsOn("toggleReligions") ? drawReligions() : toggleReligions(); refreshAllEditors(); } @@ -523,8 +523,8 @@ function regenerateCultures() { Cultures.expand(); BurgsAndStates.updateCultures(); Religions.updateCultures(); - if (!layerIsOn("toggleCultures")) toggleCultures(); - else drawCultures(); + + layerIsOn("toggleCultures") ? drawCultures() : toggleCultures(); refreshAllEditors(); } diff --git a/versioning.js b/versioning.js index 44eaf676..ade2a04c 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.11"; +const VERSION = "1.105.12"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); {