From f19b891421d3cffe085803c5049132c388e0d6bf Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 15 Aug 2024 15:46:55 +0200 Subject: [PATCH] Urquhart routes (#1072) * feat: routes generation * feat: routes rendering * feat: searoutes fix, changing reGraph * feat: searoute - change pathfinding algo * feat: routes - cleanup code * feat: routes - change data format * feat: routes - add routes to json export * feat: edit routes - start * feat: edit routes - main * feat: edit routes - EP * feat: edit routes - remove route * feat: route - generate names * feat: route - continue * Refactor route merging logic for improved performance * feat: routes - show name in tooltip * feat: routes - create route dialog * feat: update data on control point remove * feat: routes editor - split route * feat: add join route functionality to routes editor * feat: Add join route functionality to routes editor * feat: Update join route tooltip in routes editor * feat: routes overview - sort by length * feat: routes overview - fix distanceScale value * feat: routes overview - create route * Refactor getMiddlePoint function to getCloseToEdgePoint * feat: routes - change data format, fix issues * feat: routes - regenerateRoutes * feat: routes - add route on burg creation * chore - remove merge conflict markers * chore - remove merge conflict markers * feat: routes name - no unnamed burg names * feat: routes - lock routes * fix: routes - split routes * feat: routes - tip correction * feat: routes - auto-update part 1 * feat: routes - return old rePacj logic to not break auto-update * feat: routes - auto-update - add connections --------- Co-authored-by: Azgaar --- index.css | 9 +- index.html | 330 ++++--- libs/flatqueue.js | 57 ++ main.js | 32 +- modules/biomes.js | 22 +- modules/burgs-and-states.js | 37 +- modules/dynamic/auto-update.js | 55 ++ modules/dynamic/editors/states-editor.js | 2 +- modules/dynamic/export-json.js | 58 +- modules/dynamic/overview/charts-overview.js | 2 - modules/io/export.js | 35 +- modules/io/load.js | 8 +- modules/io/save.js | 12 +- modules/markers-generator.js | 37 +- modules/religions-generator.js | 28 +- modules/routes-generator.js | 934 +++++++++++++++----- modules/submap.js | 25 +- modules/ui/battle-screen.js | 255 +++++- modules/ui/biomes-editor.js | 2 +- modules/ui/burgs-overview.js | 9 +- modules/ui/editors.js | 76 +- modules/ui/elevation-profile.js | 67 +- modules/ui/general.js | 11 +- modules/ui/heightmap-editor.js | 13 +- modules/ui/hotkeys.js | 3 +- modules/ui/lakes-editor.js | 3 +- modules/ui/layers.js | 30 +- modules/ui/measurers.js | 12 +- modules/ui/options.js | 4 +- modules/ui/provinces-editor.js | 2 +- modules/ui/rivers-editor.js | 72 +- modules/ui/rivers-overview.js | 32 +- modules/ui/route-group-editor.js | 85 ++ modules/ui/routes-creator.js | 140 +++ modules/ui/routes-editor.js | 583 +++++++----- modules/ui/routes-overview.js | 187 ++++ modules/ui/style.js | 2 +- modules/ui/submap.js | 7 +- modules/ui/tools.js | 47 +- modules/ui/units-editor.js | 12 +- modules/ui/world-configurator.js | 7 +- utils/colorUtils.js | 22 +- utils/commonUtils.js | 23 +- utils/debugUtils.js | 58 ++ utils/functionUtils.js | 10 +- utils/graphUtils.js | 32 - versioning.js | 5 +- 47 files changed, 2462 insertions(+), 1032 deletions(-) create mode 100644 libs/flatqueue.js create mode 100644 modules/ui/route-group-editor.js create mode 100644 modules/ui/routes-creator.js create mode 100644 modules/ui/routes-overview.js create mode 100644 utils/debugUtils.js diff --git a/index.css b/index.css index f1cac6a8..555b650c 100644 --- a/index.css +++ b/index.css @@ -258,7 +258,6 @@ i.icon-lock { cursor: pointer; } -#routeEditor > *, #labelEditor div { display: inline-block; } @@ -1618,6 +1617,7 @@ div.states > .riverType { #burgBody > div > div, #riverBody > div, +#routeBody > div, #lakeBody > div { padding: 0.1em; } @@ -1625,6 +1625,7 @@ div.states > .riverType { #riverBody div.label, #riverBody input, #riverBody select, +#routeBody div.label, #lakeBody div.label, #lakeBody input, #lakeBody select { @@ -1632,6 +1633,12 @@ div.states > .riverType { width: 7em; } +#routeBody input, +#routeBody select { + display: inline-block; + width: 10em; +} + #stateNameEditor div.label, #provinceNameEditor div.label, #regimentBody div.label, diff --git a/index.html b/index.html index d4ed06de..4ed5b75a 100644 --- a/index.html +++ b/index.html @@ -138,7 +138,7 @@ } - + @@ -610,6 +610,7 @@ id="toggleRoutes" data-tip="Trade routes: click to toggle, drag to raise or lower the layer. Ctrl + click to edit layer style" data-shortcut="U" + class="buttonoff" onclick="toggleRoutes(event)" > Routes @@ -2119,6 +2120,9 @@ + @@ -2171,7 +2175,7 @@ - + - +
Show
@@ -2700,7 +2704,7 @@ data-tip="Provide a name for the new group" style="display: none; width: 10em" /> - + @@ -2857,7 +2861,7 @@
Type:
- + @@ -3627,7 +3678,7 @@
- +
@@ -5460,6 +5505,47 @@
+ +