mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor(es modules): set up aliases
This commit is contained in:
parent
7755d8b588
commit
9206f46c42
4 changed files with 27 additions and 18 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import {prompt} from "/src/scripts/prompt";
|
||||
import {byId, store, stored} from "/src/utils/shorthands";
|
||||
import {stored, byId, store} from "utils/shorthands";
|
||||
import {layerIsOn} from "./utils";
|
||||
|
||||
export function initLayers() {
|
||||
|
|
@ -77,12 +76,14 @@ const defaultPresets = {
|
|||
};
|
||||
|
||||
function restoreCustomPresets() {
|
||||
const storedPresets = JSON.parse(stored("presets"));
|
||||
if (!storedPresets) {
|
||||
const storedPresentsRaw = stored("presets");
|
||||
if (!storedPresentsRaw) {
|
||||
presets = structuredClone(defaultPresets);
|
||||
return;
|
||||
}
|
||||
|
||||
const storedPresets = JSON.parse(storedPresentsRaw);
|
||||
|
||||
for (const preset in storedPresets) {
|
||||
if (presets[preset]) continue;
|
||||
byId("layersPreset").add(new Option(preset, preset));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {byId} from "/src/utils/shorthands";
|
||||
import {byId} from "utils/shorthands";
|
||||
import {updatePresetInput} from "./init";
|
||||
|
||||
export function layerIsOn(toggleId: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue