mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: dynamically load modules
This commit is contained in:
parent
a107c58643
commit
347083291f
46 changed files with 161 additions and 164 deletions
|
|
@ -11,6 +11,8 @@ import {gauss, P, rand, rw} from "utils/probabilityUtils";
|
|||
import {byId, stored} from "utils/shorthands";
|
||||
import {regenerateMap} from "scripts/generation";
|
||||
import {fitScaleBar} from "modules/measurers";
|
||||
import {openDialog} from "dialogs";
|
||||
import {closeDialogs} from "dialogs/utils";
|
||||
|
||||
$("#optionsContainer").draggable({handle: ".drag-trigger", snap: "svg", snapMode: "both"});
|
||||
$("#exitCustomization").draggable({handle: "div"});
|
||||
|
|
@ -160,7 +162,7 @@ optionsContent.addEventListener("click", function (event) {
|
|||
else if (id === "optionsMapHistory") showSeedHistoryDialog();
|
||||
else if (id === "optionsCopySeed") copyMapURL();
|
||||
else if (id === "optionsEraRegenerate") regenerateEra();
|
||||
else if (id === "templateInputContainer") openTemplateSelectionDialog();
|
||||
else if (id === "templateInputContainer") openDialog("heightmapSelection");
|
||||
else if (id === "zoomExtentDefault") restoreDefaultZoomExtent();
|
||||
else if (id === "translateExtent") toggleTranslateExtent(event.target);
|
||||
else if (id === "speakerTest") testSpeaker();
|
||||
|
|
@ -650,11 +652,6 @@ function changeEra() {
|
|||
options.era = eraInput.value;
|
||||
}
|
||||
|
||||
async function openTemplateSelectionDialog() {
|
||||
const HeightmapSelectionDialog = await import("../dynamic/heightmap-selection.js");
|
||||
HeightmapSelectionDialog.open();
|
||||
}
|
||||
|
||||
// remove all saved data from LocalStorage and reload the page
|
||||
function restoreDefaultOptions() {
|
||||
localStorage.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue