mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor(es modules): temporary remove alias
This commit is contained in:
parent
4814bce58d
commit
4feed39d5c
68 changed files with 165 additions and 148 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
|
@ -2,11 +2,11 @@ import {TIME} from "/src/config/logging";
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {layerIsOn} from "./ui/layers";
|
import {layerIsOn} from "./ui/layers";
|
||||||
import {getColors, getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
import {getColors, getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
||||||
import {getMiddlePoint} from "@/utils/lineUtils";
|
import {getMiddlePoint} from "/src/utils/lineUtils";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {rand, P, each, gauss, ra, rw, generateSeed} from "@/utils/probabilityUtils";
|
import {rand, P, each, gauss, ra, rw, generateSeed} from "/src/utils/probabilityUtils";
|
||||||
import {round, splitInTwo} from "@/utils/stringUtils";
|
import {round, splitInTwo} from "/src/utils/stringUtils";
|
||||||
import {trimVowels, getAdjective} from "@/utils/languageUtils";
|
import {trimVowels, getAdjective} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
window.BurgsAndStates = (function () {
|
window.BurgsAndStates = (function () {
|
||||||
const generate = function () {
|
const generate = function () {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {P, rw} from "@/utils/probabilityUtils";
|
import {P, rw} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
window.COA = (function () {
|
window.COA = (function () {
|
||||||
const tinctures = {
|
const tinctures = {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {TIME} from "/src/config/logging";
|
import {TIME} from "/src/config/logging";
|
||||||
import {getColors} from "/src/utils/colorUtils";
|
import {getColors} from "/src/utils/colorUtils";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {rand, P, rw, biased} from "@/utils/probabilityUtils";
|
import {rand, P, rw, biased} from "/src/utils/probabilityUtils";
|
||||||
import {abbreviate} from "@/utils/languageUtils";
|
import {abbreviate} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
window.Cultures = (function () {
|
window.Cultures = (function () {
|
||||||
let cells;
|
let cells;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand, P, rw} from "@/utils/probabilityUtils";
|
import {rand, P, rw} from "/src/utils/probabilityUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
// update old .map version to the current one
|
// update old .map version to the current one
|
||||||
export function resolveVersionConflicts(version) {
|
export function resolveVersionConflicts(version) {
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
import {abbreviate} from "@/utils/languageUtils";
|
import {abbreviate} from "/src/utils/languageUtils";
|
||||||
import {debounce} from "@/utils/functionUtils";
|
import {debounce} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
const $body = insertEditorHtml();
|
const $body = insertEditorHtml();
|
||||||
addListeners();
|
addListeners();
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
import {abbreviate} from "@/utils/languageUtils";
|
import {abbreviate} from "/src/utils/languageUtils";
|
||||||
import {debounce} from "@/utils/functionUtils";
|
import {debounce} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
const $body = insertEditorHtml();
|
const $body = insertEditorHtml();
|
||||||
addListeners();
|
addListeners();
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import {byId} from "/src/utils/shorthands";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand, P} from "@/utils/probabilityUtils";
|
import {rand, P} from "/src/utils/probabilityUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
import {getAdjective} from "@/utils/languageUtils";
|
import {getAdjective} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
const $body = insertEditorHtml();
|
const $body = insertEditorHtml();
|
||||||
addListeners();
|
addListeners();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {shouldRegenerateGrid, generateGrid} from "/src/utils/graphUtils";
|
import {shouldRegenerateGrid, generateGrid} from "/src/utils/graphUtils";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {generateSeed} from "@/utils/probabilityUtils";
|
import {generateSeed} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
const initialSeed = generateSeed();
|
const initialSeed = generateSeed();
|
||||||
let graph = getGraph(grid);
|
let graph = getGraph(grid);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
appendStyleSheet();
|
appendStyleSheet();
|
||||||
insertHtml();
|
insertHtml();
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import {isWater} from "/src/utils/graphUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {si, convertTemperature} from "@/utils/unitUtils";
|
import {si, convertTemperature} from "/src/utils/unitUtils";
|
||||||
import {rollups} from "@/utils/functionUtils";
|
import {rollups} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
const entitiesMap = {
|
const entitiesMap = {
|
||||||
states: {
|
states: {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
const capitalize = text => text.charAt(0).toUpperCase() + text.slice(1);
|
const capitalize = text => text.charAt(0).toUpperCase() + text.slice(1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import {TIME} from "/src/config/logging";
|
||||||
import {createTypedArray} from "/src/utils/arrayUtils";
|
import {createTypedArray} from "/src/utils/arrayUtils";
|
||||||
import {findGridCell} from "/src/utils/graphUtils";
|
import {findGridCell} from "/src/utils/graphUtils";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {rand, P, getNumberInRange} from "@/utils/probabilityUtils";
|
import {rand, P, getNumberInRange} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
window.HeightmapGenerator = (function () {
|
window.HeightmapGenerator = (function () {
|
||||||
let grid = null;
|
let grid = null;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {getGridPolygon} from "/src/utils/graphUtils";
|
import {getGridPolygon} from "/src/utils/graphUtils";
|
||||||
import {unique} from "/src/utils/arrayUtils";
|
import {unique} from "/src/utils/arrayUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {getCoordinates} from "@/utils/coordinateUtils";
|
import {getCoordinates} from "/src/utils/coordinateUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {getBase64} from "@/utils/functionUtils";
|
import {getBase64} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
// download map as SVG
|
// download map as SVG
|
||||||
async function saveSVG() {
|
async function saveSVG() {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ import {restoreDefaultEvents} from "/src/scripts/events";
|
||||||
import {calculateVoronoi, findCell} from "/src/utils/graphUtils";
|
import {calculateVoronoi, findCell} from "/src/utils/graphUtils";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {parseError} from "@/utils/errorUtils";
|
import {parseError} from "/src/utils/errorUtils";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {link} from "@/utils/linkUtils";
|
import {link} from "/src/utils/linkUtils";
|
||||||
import {ldb} from "@/scripts/indexedDB";
|
import {ldb} from "/src/scripts/indexedDB";
|
||||||
|
|
||||||
function quickLoad() {
|
function quickLoad() {
|
||||||
ldb.get("lastMap", blob => {
|
ldb.get("lastMap", blob => {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {ldb} from "@/scripts/indexedDB";
|
import {ldb} from "/src/scripts/indexedDB";
|
||||||
import {ra} from "@/utils/probabilityUtils";
|
import {ra} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
// functions to save project as .map file
|
// functions to save project as .map file
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ import {TIME} from "/src/config/logging";
|
||||||
import {getFriendlyHeight} from "./ui/general";
|
import {getFriendlyHeight} from "./ui/general";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand, P, gauss, ra, rw} from "@/utils/probabilityUtils";
|
import {rand, P, gauss, ra, rw} from "/src/utils/probabilityUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {convertTemperature} from "@/utils/unitUtils";
|
import {convertTemperature} from "/src/utils/unitUtils";
|
||||||
import {getAdjective, list} from "@/utils/languageUtils";
|
import {getAdjective, list} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
window.Markers = (function () {
|
window.Markers = (function () {
|
||||||
let config = [];
|
let config = [];
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {TIME} from "/src/config/logging";
|
import {TIME} from "/src/config/logging";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {rand, gauss, ra} from "@/utils/probabilityUtils";
|
import {rand, gauss, ra} from "/src/utils/probabilityUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
import {nth} from "@/utils/languageUtils";
|
import {nth} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
window.Military = (function () {
|
window.Military = (function () {
|
||||||
const generate = function () {
|
const generate = function () {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {locked} from "/src/scripts/options/lock";
|
import {locked} from "/src/scripts/options/lock";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rand, P, ra} from "@/utils/probabilityUtils";
|
import {rand, P, ra} from "/src/utils/probabilityUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {vowel} from "@/utils/languageUtils";
|
import {vowel} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
window.Names = (function () {
|
window.Names = (function () {
|
||||||
let chains = [];
|
let chains = [];
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {TIME} from "@/config/logging";
|
import {TIME} from "/src/config/logging";
|
||||||
import {clipPoly} from "@/utils/lineUtils";
|
import {clipPoly} from "/src/utils/lineUtils";
|
||||||
import {rn} from "@/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {P} from "@/utils/probabilityUtils";
|
import {P} from "/src/utils/probabilityUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
window.OceanLayers = (function () {
|
window.OceanLayers = (function () {
|
||||||
let cells, vertices, pointsN, used;
|
let cells, vertices, pointsN, used;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {getPackPolygon} from "/src/utils/graphUtils";
|
import {getPackPolygon} from "/src/utils/graphUtils";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {rand} from "@/utils/probabilityUtils";
|
import {rand} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
window.ReliefIcons = (function () {
|
window.ReliefIcons = (function () {
|
||||||
const ReliefIcons = function () {
|
const ReliefIcons = function () {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {findAll} from "/src/utils/graphUtils";
|
||||||
import {unique} from "/src/utils/arrayUtils";
|
import {unique} from "/src/utils/arrayUtils";
|
||||||
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
import {getRandomColor, getMixedColor} from "/src/utils/colorUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand, P, ra, rw, biased} from "@/utils/probabilityUtils";
|
import {rand, P, ra, rw, biased} from "/src/utils/probabilityUtils";
|
||||||
import {trimVowels, getAdjective, abbreviate} from "@/utils/languageUtils";
|
import {trimVowels, getAdjective, abbreviate} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
window.Religions = (function () {
|
window.Religions = (function () {
|
||||||
// name generation approach and relative chance to be selected
|
// name generation approach and relative chance to be selected
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {TIME} from "/src/config/logging";
|
import {TIME} from "/src/config/logging";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
window.Rivers = (function () {
|
window.Rivers = (function () {
|
||||||
const generate = function (allowErosion = true) {
|
const generate = function (allowErosion = true) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {TIME} from "/src/config/logging";
|
import {TIME} from "/src/config/logging";
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
window.Routes = (function () {
|
window.Routes = (function () {
|
||||||
const getRoads = function () {
|
const getRoads = function () {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {getMiddlePoint} from "@/utils/lineUtils";
|
import {getMiddlePoint} from "/src/utils/lineUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
|
|
||||||
window.Submap = (function () {
|
window.Submap = (function () {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {throttle} from "@/utils/functionUtils";
|
import {throttle} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
window.ThreeD = (function () {
|
window.ThreeD = (function () {
|
||||||
const options = {
|
const options = {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {wiki} from "@/utils/linkUtils";
|
import {wiki} from "/src/utils/linkUtils";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {rand, P, Pint} from "@/utils/probabilityUtils";
|
import {rand, P, Pint} from "/src/utils/probabilityUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {getAdjective, list} from "@/utils/languageUtils";
|
import {getAdjective, list} from "/src/utils/languageUtils";
|
||||||
|
|
||||||
export class Battle {
|
export class Battle {
|
||||||
constructor(attacker, defender) {
|
constructor(attacker, defender) {
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import {restoreDefaultEvents} from "/src/scripts/events";
|
||||||
import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
|
import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {getRandomColor} from "/src/utils/colorUtils";
|
import {getRandomColor} from "/src/utils/colorUtils";
|
||||||
import {openURL} from "@/utils/linkUtils";
|
import {openURL} from "/src/utils/linkUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function editBiomes() {
|
export function editBiomes() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {prompt} from "@/scripts/prompt";
|
import {prompt} from "/src/scripts/prompt";
|
||||||
import {rand} from "@/utils/probabilityUtils";
|
import {rand} from "/src/utils/probabilityUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function editBurg(id) {
|
export function editBurg(id) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {restoreDefaultEvents} from "/src/scripts/events";
|
import {restoreDefaultEvents} from "/src/scripts/events";
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {getCoordinates} from "@/utils/coordinateUtils";
|
import {getCoordinates} from "/src/utils/coordinateUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {si, siToInteger} from "@/utils/unitUtils";
|
import {si, siToInteger} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function overviewBurgs() {
|
export function overviewBurgs() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {getPackPolygon} from "/src/utils/graphUtils";
|
import {getPackPolygon} from "/src/utils/graphUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {clipPoly} from "@/utils/lineUtils";
|
import {clipPoly} from "/src/utils/lineUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function editCoastline(node = d3.event.target) {
|
export function editCoastline(node = d3.event.target) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import {findCell} from "/src/utils/graphUtils";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn, minmax, normalize} from "/src/utils/numberUtils";
|
import {rn, minmax, normalize} from "/src/utils/numberUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
// clear elSelected variable
|
// clear elSelected variable
|
||||||
export function unselect() {
|
export function unselect() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {clearMainTip} from "/src/scripts/tooltips";
|
import {clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {openURL} from "@/utils/linkUtils";
|
import {openURL} from "/src/utils/linkUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function editEmblem(type, id, el) {
|
export function editEmblem(type, id, el) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {findCell, findGridCell} from "/src/utils/graphUtils";
|
import {findCell, findGridCell} from "/src/utils/graphUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {link} from "@/utils/linkUtils";
|
import {link} from "/src/utils/linkUtils";
|
||||||
import {getCoordinates, toDMS} from "@/utils/coordinateUtils";
|
import {getCoordinates, toDMS} from "/src/utils/coordinateUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
// fit full-screen map if window is resized
|
// fit full-screen map if window is resized
|
||||||
window.addEventListener("resize", function (e) {
|
window.addEventListener("resize", function (e) {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import {last, createTypedArray} from "/src/utils/arrayUtils";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {rn, minmax, lim} from "/src/utils/numberUtils";
|
import {rn, minmax, lim} from "/src/utils/numberUtils";
|
||||||
import {link} from "@/utils/linkUtils";
|
import {link} from "/src/utils/linkUtils";
|
||||||
import {prompt} from "@/scripts/prompt";
|
import {prompt} from "/src/scripts/prompt";
|
||||||
import {throttle} from "@/utils/functionUtils";
|
import {throttle} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
export function editHeightmap(options) {
|
export function editHeightmap(options) {
|
||||||
const {mode, tool} = options || {};
|
const {mode, tool} = options || {};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {findGridCell, getGridPolygon} from "/src/utils/graphUtils";
|
import {findGridCell, getGridPolygon} from "/src/utils/graphUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {ra} from "@/utils/probabilityUtils";
|
import {ra} from "/src/utils/probabilityUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function editIce() {
|
export function editIce() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {tip, showMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip} from "/src/scripts/tooltips";
|
||||||
import {round, parseTransform} from "@/utils/stringUtils";
|
import {round, parseTransform} from "/src/utils/stringUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
|
||||||
|
|
||||||
export function editLabel() {
|
export function editLabel() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {getPackPolygon} from "/src/utils/graphUtils";
|
import {getPackPolygon} from "/src/utils/graphUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand} from "@/utils/probabilityUtils";
|
import {rand} from "/src/utils/probabilityUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function editLake() {
|
export function editLake() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ import {last} from "/src/utils/arrayUtils";
|
||||||
import {stored, store} from "/src/utils/shorthands";
|
import {stored, store} from "/src/utils/shorthands";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {clipPoly} from "@/utils/lineUtils";
|
import {clipPoly} from "/src/utils/lineUtils";
|
||||||
import {rn, minmax, normalize} from "/src/utils/numberUtils";
|
import {rn, minmax, normalize} from "/src/utils/numberUtils";
|
||||||
import {isCtrlClick} from "@/utils/keyboardUtils";
|
import {isCtrlClick} from "/src/utils/keyboardUtils";
|
||||||
import {prompt} from "@/scripts/prompt";
|
import {prompt} from "/src/scripts/prompt";
|
||||||
import {rand, P} from "@/utils/probabilityUtils";
|
import {rand, P} from "/src/utils/probabilityUtils";
|
||||||
import {convertTemperature} from "@/utils/unitUtils";
|
import {convertTemperature} from "/src/utils/unitUtils";
|
||||||
import {getBase64} from "@/utils/functionUtils";
|
import {getBase64} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
let presets = {};
|
let presets = {};
|
||||||
restoreCustomPresets(); // run on-load
|
restoreCustomPresets(); // run on-load
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {wiki} from "@/utils/linkUtils";
|
import {wiki} from "/src/utils/linkUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function overviewMilitary() {
|
export function overviewMilitary() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {unique} from "/src/utils/arrayUtils";
|
import {unique} from "/src/utils/arrayUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {openURL} from "@/utils/linkUtils";
|
import {openURL} from "/src/utils/linkUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
|
|
||||||
export function editNamesbase() {
|
export function editNamesbase() {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {lock, locked} from "/src/scripts/options/lock";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {byId, stored} from "/src/utils/shorthands";
|
import {byId, stored} from "/src/utils/shorthands";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {rand, P, gauss} from "@/utils/probabilityUtils";
|
import {rand, P, gauss} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
$("#optionsContainer").draggable({handle: ".drag-trigger", snap: "svg", snapMode: "both"});
|
$("#optionsContainer").draggable({handle: ".drag-trigger", snap: "svg", snapMode: "both"});
|
||||||
$("#exitCustomization").draggable({handle: "div"});
|
$("#exitCustomization").draggable({handle: "div"});
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import {unique} from "/src/utils/arrayUtils";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {getRandomColor} from "/src/utils/colorUtils";
|
import {getRandomColor} from "/src/utils/colorUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand, P} from "@/utils/probabilityUtils";
|
import {rand, P} from "/src/utils/probabilityUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function editProvinces() {
|
export function editProvinces() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import {findCell} from "/src/utils/graphUtils";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function editRegiment(selector) {
|
export function editRegiment(selector) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import {findCell} from "/src/utils/graphUtils";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {capitalize} from "@/utils/stringUtils";
|
import {capitalize} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function overviewRegiments(state) {
|
export function overviewRegiments(state) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {findCell, getPackPolygon} from "/src/utils/graphUtils";
|
import {findCell, getPackPolygon} from "/src/utils/graphUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {getSegmentId} from "@/utils/lineUtils";
|
import {getSegmentId} from "/src/utils/lineUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {rand} from "@/utils/probabilityUtils";
|
import {rand} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
export function editRiver(id) {
|
export function editRiver(id) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {getSegmentId} from "@/utils/lineUtils";
|
import {getSegmentId} from "/src/utils/lineUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {getNextId} from "@/utils/nodeUtils";
|
import {getNextId} from "/src/utils/nodeUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function editRoute(onClick) {
|
export function editRoute(onClick) {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
import {getBase64} from "@/utils/functionUtils";
|
import {getBase64} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
// add available filters to lists
|
// add available filters to lists
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {isJsonValid} from "@/utils/stringUtils";
|
import {isJsonValid} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
const systemPresets = [
|
const systemPresets = [
|
||||||
"default",
|
"default",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {byId} from "/src/utils/shorthands";
|
import {byId} from "/src/utils/shorthands";
|
||||||
import {clearMainTip} from "/src/scripts/tooltips";
|
import {clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {parseError} from "@/utils/errorUtils";
|
import {parseError} from "/src/utils/errorUtils";
|
||||||
import {rn, minmax} from "/src/utils/numberUtils";
|
import {rn, minmax} from "/src/utils/numberUtils";
|
||||||
import {debounce} from "@/utils/functionUtils";
|
import {debounce} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
window.UISubmap = (function () {
|
window.UISubmap = (function () {
|
||||||
byId("submapPointsInput").addEventListener("input", function () {
|
byId("submapPointsInput").addEventListener("input", function () {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {round} from "@/utils/stringUtils";
|
import {round} from "/src/utils/stringUtils";
|
||||||
import {convertTemperature} from "@/utils/unitUtils";
|
import {convertTemperature} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function showBurgTemperatureGraph(id) {
|
export function showBurgTemperatureGraph(id) {
|
||||||
const b = pack.burgs[id];
|
const b = pack.burgs[id];
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ import {findCell} from "/src/utils/graphUtils";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {isCtrlClick} from "@/utils/keyboardUtils";
|
import {isCtrlClick} from "/src/utils/keyboardUtils";
|
||||||
import {prompt} from "@/scripts/prompt";
|
import {prompt} from "/src/scripts/prompt";
|
||||||
import {getNextId} from "@/utils/nodeUtils";
|
import {getNextId} from "/src/utils/nodeUtils";
|
||||||
import {P, generateSeed} from "@/utils/probabilityUtils";
|
import {P, generateSeed} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
toolsContent.addEventListener("click", function (event) {
|
toolsContent.addEventListener("click", function (event) {
|
||||||
if (customization) return tip("Please exit the customization mode first", false, "warning");
|
if (customization) return tip("Please exit the customization mode first", false, "warning");
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import {restoreDefaultEvents} from "/src/scripts/events";
|
import {restoreDefaultEvents} from "/src/scripts/events";
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {prompt} from "@/scripts/prompt";
|
import {prompt} from "/src/scripts/prompt";
|
||||||
|
|
||||||
export function editUnits() {
|
export function editUnits() {
|
||||||
closeDialogs("#unitsEditor, .stable");
|
closeDialogs("#unitsEditor, .stable");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {tip} from "/src/scripts/tooltips";
|
import {tip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {round, parseTransform} from "@/utils/stringUtils";
|
import {round, parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function editWorld() {
|
export function editWorld() {
|
||||||
if (customization) return;
|
if (customization) return;
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {findAll, findCell, getPackPolygon} from "/src/utils/graphUtils";
|
||||||
import {unique} from "/src/utils/arrayUtils";
|
import {unique} from "/src/utils/arrayUtils";
|
||||||
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {getNextId} from "@/utils/nodeUtils";
|
import {getNextId} from "/src/utils/nodeUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export function editZones() {
|
export function editZones() {
|
||||||
closeDialogs();
|
closeDialogs();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {debounce} from "@/utils/functionUtils";
|
import {debounce} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
// temporary expose to global
|
// temporary expose to global
|
||||||
window.scale = 1;
|
window.scale = 1;
|
||||||
|
|
|
||||||
11
src/main.ts
11
src/main.ts
|
|
@ -1,6 +1,8 @@
|
||||||
// Azgaar (azgaar.fmg@yandex.com). Minsk, 2017-2022. MIT License
|
// Azgaar (azgaar.fmg@yandex.com). Minsk, 2017-2022. MIT License
|
||||||
// https://github.com/Azgaar/Fantasy-Map-Generator
|
// https://github.com/Azgaar/Fantasy-Map-Generator
|
||||||
|
|
||||||
|
console.log("Hello World");
|
||||||
|
|
||||||
import {invokeActiveZooming} from "../modules/activeZooming";
|
import {invokeActiveZooming} from "../modules/activeZooming";
|
||||||
import {applyPreset, drawBorders, drawRivers, drawStates} from "../modules/ui/layers";
|
import {applyPreset, drawBorders, drawRivers, drawStates} from "../modules/ui/layers";
|
||||||
import {applyMapSize, applyStoredOptions, randomizeOptions} from "../modules/ui/options";
|
import {applyMapSize, applyStoredOptions, randomizeOptions} from "../modules/ui/options";
|
||||||
|
|
@ -21,12 +23,13 @@ import {
|
||||||
isLand,
|
isLand,
|
||||||
shouldRegenerateGrid
|
shouldRegenerateGrid
|
||||||
} from "./utils/graphUtils";
|
} from "./utils/graphUtils";
|
||||||
import {parseError} from "@/utils/errorUtils";
|
import {parseError} from "./utils/errorUtils";
|
||||||
import {rn, minmax, normalize} from "./utils/numberUtils";
|
import {rn, minmax, normalize} from "./utils/numberUtils";
|
||||||
import {createTypedArray} from "./utils/arrayUtils";
|
import {createTypedArray} from "./utils/arrayUtils";
|
||||||
import {clipPoly} from "@/utils/lineUtils";
|
import {clipPoly} from "./utils/lineUtils";
|
||||||
import {rand, P, gauss, ra, rw, generateSeed} from "@/utils/probabilityUtils";
|
import {rand, P, gauss, ra, rw, generateSeed} from "./utils/probabilityUtils";
|
||||||
import {getAdjective} from "@/utils/languageUtils";
|
import {getAdjective} from "./utils/languageUtils";
|
||||||
|
import {debounce} from "./utils/functionUtils";
|
||||||
import {byId} from "./utils/shorthands";
|
import {byId} from "./utils/shorthands";
|
||||||
import "./components";
|
import "./components";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {rn} from "../utils/numberUtils";
|
import {rn} from "../utils/numberUtils";
|
||||||
import {parseTransform} from "@/utils/stringUtils";
|
import {parseTransform} from "/src/utils/stringUtils";
|
||||||
|
|
||||||
export function drawLegend(name: string, data: unknown[]) {
|
export function drawLegend(name: string, data: unknown[]) {
|
||||||
legend.selectAll("*").remove(); // fully redraw every time
|
legend.selectAll("*").remove(); // fully redraw every time
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import {findCell} from "/src/utils/graphUtils";
|
import {findCell} from "/src/utils/graphUtils";
|
||||||
import {last} from "/src/utils/arrayUtils";
|
import {last} from "/src/utils/arrayUtils";
|
||||||
import {getSegmentId} from "@/utils/lineUtils";
|
import {getSegmentId} from "/src/utils/lineUtils";
|
||||||
import {rn} from "/src/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
import {round, parseTransform} from "@/utils/stringUtils";
|
import {round, parseTransform} from "/src/utils/stringUtils";
|
||||||
import {si} from "@/utils/unitUtils";
|
import {si} from "/src/utils/unitUtils";
|
||||||
|
|
||||||
export class Rulers {
|
export class Rulers {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import {dragLegendBox} from "../modules/legend";
|
import {dragLegendBox} from "../modules/legend";
|
||||||
import {findCell, findGridCell} from "../utils/graphUtils";
|
import {findCell, findGridCell} from "../utils/graphUtils";
|
||||||
import {tip, showMainTip} from "./tooltips";
|
import {tip, showMainTip} from "./tooltips";
|
||||||
import {si, convertTemperature} from "@/utils/unitUtils";
|
import {si, convertTemperature} from "/src/utils/unitUtils";
|
||||||
import {debounce} from "@/utils/functionUtils";
|
import {debounce} from "/src/utils/functionUtils";
|
||||||
|
|
||||||
export function restoreDefaultEvents() {
|
export function restoreDefaultEvents() {
|
||||||
Zoom.setZoomBehavior();
|
Zoom.setZoomBehavior();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {ERROR} from "@/config/logging";
|
import {ERROR} from "/src/config/logging";
|
||||||
|
|
||||||
// prompt replacer (prompt does not work in Electron)
|
// prompt replacer (prompt does not work in Electron)
|
||||||
const $prompt: HTMLElement = document.getElementById("prompt")!;
|
const $prompt: HTMLElement = document.getElementById("prompt")!;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {UINT8_MAX, UINT16_MAX, UINT32_MAX} from "@/constants";
|
import {UINT8_MAX, UINT16_MAX, UINT32_MAX} from "/src/constants";
|
||||||
|
|
||||||
export function last<T>(array: T[]) {
|
export function last<T>(array: T[]) {
|
||||||
return array[array.length - 1];
|
return array[array.length - 1];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {P} from "@/utils/probabilityUtils";
|
import {P} from "/src/utils/probabilityUtils";
|
||||||
|
|
||||||
// chars that serve as vowels
|
// chars that serve as vowels
|
||||||
const VOWELS = `aeiouyɑ'əøɛœæɶɒɨɪɔɐʊɤɯаоиеёэыуюяàèìòùỳẁȁȅȉȍȕáéíóúýẃőűâêîôûŷŵäëïöüÿẅãẽĩõũỹąęįǫųāēīōūȳăĕĭŏŭǎěǐǒǔȧėȯẏẇạẹịọụỵẉḛḭṵṳ`;
|
const VOWELS = `aeiouyɑ'əøɛœæɶɒɨɪɔɐʊɤɯаоиеёэыуюяàèìòùỳẁȁȅȉȍȕáéíóúýẃőűâêîôûŷŵäëïöüÿẅãẽĩõũỹąęįǫųāēīōūȳăĕĭŏŭǎěǐǒǔȧėȯẏẇạẹịọụỵẉḛḭṵṳ`;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {ERROR} from "@/config/logging";
|
import {ERROR} from "/src/config/logging";
|
||||||
import {minmax, rn} from "./numberUtils";
|
import {minmax, rn} from "./numberUtils";
|
||||||
|
|
||||||
const d3 = window.d3;
|
const d3 = window.d3;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import {rn} from "@/utils/numberUtils";
|
import {rn} from "/src/utils/numberUtils";
|
||||||
|
|
||||||
// round numbers in string to d decimals
|
// round numbers in string to d decimals
|
||||||
export function round(str: string, d = 1) {
|
export function round(str: string, d = 1) {
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true
|
||||||
"baseUrl": ".",
|
// "baseUrl": ".",
|
||||||
"paths": {
|
// "paths": {
|
||||||
"@/*": ["./src/*"]
|
// "@/*": ["./src/*"]
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
"include": ["src", "utils", "modules"]
|
"include": ["src"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
// version and caching control
|
// version and caching control
|
||||||
const version = "1.87.04"; // generator version, update each time
|
const version = "1.87.04"; // generator version, update each time
|
||||||
|
|
||||||
|
console.log(`version: ${version}`);
|
||||||
|
|
||||||
{
|
{
|
||||||
document.title += " v" + version;
|
document.title += " v" + version;
|
||||||
const loadingScreenVersion = document.getElementById("version");
|
const loadingScreenVersion = document.getElementById("version");
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,24 @@ import {defineConfig} from "vite";
|
||||||
import {fileURLToPath} from "url";
|
import {fileURLToPath} from "url";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
const pathName = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
const resolved = path.resolve(pathName, "./src");
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: "/Fantasy-Map-Generator/",
|
// base: "/Fantasy-Map-Generator/",
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: [
|
||||||
"@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "/src")
|
// "@": "./src"
|
||||||
}
|
// "@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "./src")
|
||||||
|
// "@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "/src")
|
||||||
|
{
|
||||||
|
find: "@",
|
||||||
|
replacement: path.resolve(pathName, "./src"),
|
||||||
|
customResolver: request => {
|
||||||
|
console.log(request);
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue