This commit is contained in:
Azgaar 2020-06-21 20:54:48 +03:00
parent 1e60b477fb
commit 783ea4a35f

View file

@ -109,6 +109,8 @@ optionsContent.addEventListener("change", function(event) {
if (id === "zoomExtentMin" || id === "zoomExtentMax") changeZoomExtent(value); if (id === "zoomExtentMin" || id === "zoomExtentMax") changeZoomExtent(value);
else if (id === "optionsSeed") generateMapWithSeed(); else if (id === "optionsSeed") generateMapWithSeed();
else if (id === "uiSizeInput") changeUIsize(value); else if (id === "uiSizeInput") changeUIsize(value);
else if (id === "yearInput") changeYear();
else if (id === "eraInput") changeEra();
}); });
optionsContent.addEventListener("click", function(event) { optionsContent.addEventListener("click", function(event) {
@ -408,6 +410,18 @@ function regenerateEra() {
options.eraShort = options.era.split(" ").map(w => w[0].toUpperCase()).join(""); options.eraShort = options.era.split(" ").map(w => w[0].toUpperCase()).join("");
} }
function changeYear() {
if (!yearInputthis.value) return;
if (isNaN(+yearInput.value)) {tip("Current year should be a number", false, "error"); return;}
options.year = +yearInput.value;
}
function changeEra() {
if (!eraInput.value) return;
lock("era");
options.era = eraInput.value;
}
// remove all saved data from LocalStorage and reload the page // remove all saved data from LocalStorage and reload the page
function restoreDefaultOptions() { function restoreDefaultOptions() {
localStorage.clear(); localStorage.clear();