mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: fix ts errors
This commit is contained in:
parent
98ae3292fc
commit
3018d94618
17 changed files with 83 additions and 54 deletions
|
|
@ -8,6 +8,8 @@ import {editStyle, calculateFriendlyGridSize, shiftCompass} from "modules/ui/sty
|
|||
import {turnLayerButtonOn, turnLayerButtonOff, layerIsOn} from "./utils";
|
||||
import {renderLayer} from "./renderers";
|
||||
import {getInputNumber, getInputValue} from "utils/nodeUtils";
|
||||
// @ts-expect-error js module
|
||||
import {editUnits} from "modules/ui/editors";
|
||||
|
||||
const layerTogglesMap = {
|
||||
toggleBiomes,
|
||||
|
|
@ -465,20 +467,14 @@ function toggleScaleBar(event?: MouseEvent) {
|
|||
if (!layerIsOn("toggleScaleBar")) {
|
||||
turnLayerButtonOn("toggleScaleBar");
|
||||
$("#scaleBar").fadeIn();
|
||||
if (isCtrlPressed(event)) openUnitsEditor();
|
||||
if (isCtrlPressed(event)) editUnits();
|
||||
} else {
|
||||
if (isCtrlPressed(event)) openUnitsEditor();
|
||||
if (isCtrlPressed(event)) editUnits();
|
||||
else {
|
||||
$("#scaleBar").fadeOut();
|
||||
turnLayerButtonOff("toggleScaleBar");
|
||||
}
|
||||
}
|
||||
|
||||
async function openUnitsEditor() {
|
||||
// @ts-ignore untyped module
|
||||
const {editUnits} = await import("../modules/ui/units-editor.js");
|
||||
editUnits();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleZones(event?: MouseEvent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue