refactor(es modules): continue migration

This commit is contained in:
Azgaar 2022-06-25 17:59:03 +03:00
parent 97f2b213c4
commit 030caec6e8
23 changed files with 61 additions and 42 deletions

View file

@ -1,4 +1,5 @@
import {calculateVoronoi, findCell} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
function quickLoad() {
ldb.get("lastMap", blob => {

View file

@ -1,5 +1,6 @@
import {TIME} from "/src/config/logging";
import {getFriendlyHeight} from "./ui/general";
import {last} from "/src/utils/arrayUtils";
window.Markers = (function () {
let config = [];

View file

@ -1,3 +1,5 @@
import {last} from "/src/utils/arrayUtils";
window.Names = (function () {
let chains = [];

View file

@ -1,4 +1,5 @@
import {TIME} from "/src/config/logging";
import {last} from "/src/utils/arrayUtils";
window.Rivers = (function () {
const generate = function (allowErosion = true) {

View file

@ -1,5 +1,6 @@
import {TIME} from "/src/config/logging";
import {findCell} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
window.Routes = (function () {
const getRoads = function () {

View file

@ -1,5 +1,6 @@
"use strict";
class Battle {
import {last} from "/src/utils/arrayUtils";
export class Battle {
constructor(attacker, defender) {
if (customization) return;
closeDialogs(".stable");

View file

@ -1,4 +1,5 @@
import {findGridCell, findGridAll, findCell, getPackPolygon, getGridPolygon} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
export function editHeightmap(options) {
const {mode, tool} = options || {};

View file

@ -1,6 +1,7 @@
import {TIME} from "/src/config/logging";
import {invokeActiveZooming} from "../activeZooming";
import {getGridPolygon} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
let presets = {}; // global object
restoreCustomPresets(); // run on-load

View file

@ -1,4 +1,7 @@
import {stored, lock, locked, applyOption} from "./general";
import {last} from "/src/utils/arrayUtils";
import {byId} from "/src/utils/shorthands";
import {last} from "/src/utils/arrayUtils";
$("#optionsContainer").draggable({handle: ".drag-trigger", snap: "svg", snapMode: "both"});
$("#exitCustomization").draggable({handle: "div"});

View file

@ -1,4 +1,5 @@
import {findCell} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
export function editRegiment(selector) {
if (customization) return;

View file

@ -1,4 +1,5 @@
import {findCell} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
export function overviewRegiments(state) {
if (customization) return;

View file

@ -1,4 +1,5 @@
import {getPackPolygon, findCell} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
export function createRiver() {
if (customization) return;

View file

@ -1,5 +1,4 @@
"use strict";
// UI elements for submap generation
import {byId} from "/src/utils/shorthands";
window.UISubmap = (function () {
byId("submapPointsInput").addEventListener("input", function () {

View file

@ -1,4 +1,5 @@
import {findCell} from "/src/utils/graphUtils";
import {last} from "/src/utils/arrayUtils";
// module to control the Tools options (click to edit, to re-geenerate, tp add)