mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
refactor: fix ts errors
This commit is contained in:
parent
98ae3292fc
commit
3018d94618
17 changed files with 83 additions and 54 deletions
|
|
@ -11,6 +11,7 @@ import {link} from "utils/linkUtils";
|
|||
import {minmax, rn} from "utils/numberUtils";
|
||||
import {regenerateMap} from "scripts/generation";
|
||||
import {reMarkFeatures} from "modules/markup";
|
||||
import {editUnits} from "modules/ui/editors";
|
||||
|
||||
// add drag to upload logic, pull request from @evyatron
|
||||
export function addDragToUpload() {
|
||||
|
|
@ -480,7 +481,7 @@ async function parseLoadedData(data) {
|
|||
})();
|
||||
|
||||
void (function restoreEvents() {
|
||||
scaleBar.on("mousemove", () => tip("Click to open Units Editor")).on("click", () => editUnits());
|
||||
scaleBar.on("mousemove", () => tip("Click to open Units Editor")).on("click", editUnits);
|
||||
legend
|
||||
.on("mousemove", () => tip("Drag to change the position. Click to hide the legend"))
|
||||
.on("click", () => clearLegend());
|
||||
|
|
|
|||
|
|
@ -1027,20 +1027,25 @@ function refreshAllEditors() {
|
|||
}
|
||||
|
||||
// dynamically loaded editors
|
||||
async function editStates() {
|
||||
export async function editStates() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/states-editor.js?v=12062022");
|
||||
Editor.open();
|
||||
}
|
||||
|
||||
async function editCultures() {
|
||||
export async function editCultures() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/cultures-editor.js?v=1.87.01");
|
||||
Editor.open();
|
||||
}
|
||||
|
||||
async function editReligions() {
|
||||
export async function editReligions() {
|
||||
if (customization) return;
|
||||
const Editor = await import("../dynamic/editors/religions-editor.js?v=1.87.01");
|
||||
Editor.open();
|
||||
}
|
||||
|
||||
export async function editUnits() {
|
||||
const {open} = await import("./units-editor.js");
|
||||
open();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
import * as d3 from "d3";
|
||||
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {last} from "utils/arrayUtils";
|
||||
import {tip, clearMainTip} from "scripts/tooltips";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {isCtrlPressed} from "utils/keyboardUtils";
|
||||
import {prompt} from "scripts/prompt";
|
||||
import {getNextId} from "utils/nodeUtils";
|
||||
import {P, generateSeed} from "utils/probabilityUtils";
|
||||
import {turnLayerButtonOn} from "layers";
|
||||
import {editUnits} from "modules/ui/editors";
|
||||
import {aleaPRNG} from "scripts/aleaPRNG";
|
||||
import {restoreDefaultEvents} from "scripts/events";
|
||||
import {prompt} from "scripts/prompt";
|
||||
import {clearMainTip, tip} from "scripts/tooltips";
|
||||
import {last} from "utils/arrayUtils";
|
||||
import {findCell} from "utils/graphUtils";
|
||||
import {isCtrlPressed} from "utils/keyboardUtils";
|
||||
import {getNextId} from "utils/nodeUtils";
|
||||
import {rn} from "utils/numberUtils";
|
||||
import {generateSeed, P} from "utils/probabilityUtils";
|
||||
|
||||
toolsContent.addEventListener("click", function (event) {
|
||||
if (customization) return tip("Please exit the customization mode first", false, "warning");
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {findCell} from "utils/graphUtils";
|
|||
import {tip} from "scripts/tooltips";
|
||||
import {prompt} from "scripts/prompt";
|
||||
|
||||
export function editUnits() {
|
||||
export function open() {
|
||||
closeDialogs("#unitsEditor, .stable");
|
||||
$("#unitsEditor").dialog();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue