From 364f33975f962daa340b3f9c360b4367a22beed3 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 26 Jun 2022 01:25:25 +0300 Subject: [PATCH] refactor(es modules): continue migration --- index.html | 5 +- modules/define-svg.js | 7 -- modules/dynamic/editors/cultures-editor.js | 4 +- modules/dynamic/editors/religions-editor.js | 2 +- modules/dynamic/editors/states-editor.js | 2 +- modules/dynamic/export-json.js | 2 + modules/dynamic/hierarchy-tree.js | 1 + modules/dynamic/installation.js | 2 + modules/dynamic/overview/charts-overview.js | 1 + modules/fonts.js | 41 ++++++++---- modules/io/cloud.js | 3 +- modules/io/export.js | 9 +-- modules/io/load.js | 1 + modules/io/save.js | 12 ++-- modules/names-generator.js | 1 + modules/ui/3d.js | 29 +++++++-- modules/ui/battle-screen.js | 1 + modules/ui/biomes-editor.js | 2 +- modules/ui/burg-editor.js | 2 +- modules/ui/burgs-overview.js | 2 +- modules/ui/coastline-editor.js | 1 + modules/ui/diplomacy-editor.js | 2 +- modules/ui/editors.js | 1 + modules/ui/emblems-editor.js | 1 + modules/ui/heightmap-editor.js | 2 +- modules/ui/ice-editor.js | 2 +- modules/ui/labels-editor.js | 2 +- modules/ui/lakes-editor.js | 1 + modules/ui/layers.js | 1 + modules/ui/military-overview.js | 5 +- modules/ui/namesbase-editor.js | 1 + modules/ui/notes-editor.js | 4 +- modules/ui/options.js | 2 +- modules/ui/provinces-editor.js | 2 +- modules/ui/regiment-editor.js | 2 +- modules/ui/regiments-overview.js | 2 +- modules/ui/relief-editor.js | 2 +- modules/ui/rivers-creator.js | 2 +- modules/ui/rivers-editor.js | 2 +- modules/ui/routes-editor.js | 2 +- modules/ui/style.js | 3 +- modules/ui/stylePresets.js | 3 +- modules/ui/temperature-graph.js | 72 +++++++++++++++++---- modules/ui/tools.js | 2 +- modules/ui/units-editor.js | 1 + modules/ui/world-configurator.js | 4 +- modules/ui/zones-editor.js | 2 +- src/main.ts | 7 +- src/scripts/events.ts | 2 +- src/scripts/options/lock.ts | 1 + 50 files changed, 180 insertions(+), 85 deletions(-) diff --git a/index.html b/index.html index 7cd238a1..734bce55 100644 --- a/index.html +++ b/index.html @@ -7703,9 +7703,9 @@ - + - + @@ -7755,7 +7755,6 @@ - number[][] diff --git a/modules/define-svg.js b/modules/define-svg.js index 5f59577e..0e71d13a 100644 --- a/modules/define-svg.js +++ b/modules/define-svg.js @@ -150,13 +150,6 @@ function defineSvg(width, height) { .attr("fill", "#e8f0f6") .attr("filter", "url(#splotch)"); - // assign events separately as not a viewbox child - 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()); - landmass.append("rect").attr("x", 0).attr("y", 0).attr("width", width).attr("height", height); oceanPattern diff --git a/modules/dynamic/editors/cultures-editor.js b/modules/dynamic/editors/cultures-editor.js index e2883238..a1969ca3 100644 --- a/modules/dynamic/editors/cultures-editor.js +++ b/modules/dynamic/editors/cultures-editor.js @@ -1,6 +1,6 @@ import {restoreDefaultEvents} from "/src/scripts/events"; import {findAll, findCell, getPackPolygon, isLand} from "/src/utils/graphUtils"; -import {showMainTip, clearMainTip} from "/src/scripts/tooltips"; +import {tip, showMainTip, clearMainTip} from "/src/scripts/tooltips"; import {byId} from "/src/utils/shorthands"; const $body = insertEditorHtml(); @@ -59,7 +59,6 @@ function insertEditorHtml() {