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