From 2efe9be3a448c8da216ec9b24d2e6f7ebc9aeb0e Mon Sep 17 00:00:00 2001 From: Azgaar Date: Thu, 26 Sep 2024 02:32:09 +0200 Subject: [PATCH 01/38] feat: start --- index.html | 55 ++++++++++++++++++---------- modules/dynamic/auto-update.js | 3 ++ modules/renderers/draw-burg-icons.js | 24 ++++++------ styles/default.json | 20 ++++++---- versioning.js | 2 +- 5 files changed, 63 insertions(+), 41 deletions(-) diff --git a/index.html b/index.html index df07d894..f8c60e08 100644 --- a/index.html +++ b/index.html @@ -6208,7 +6208,7 @@ - + @@ -6218,25 +6218,6 @@ - - - - - - Port - - - - - - - @@ -7778,6 +7759,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/dynamic/auto-update.js b/modules/dynamic/auto-update.js index e14e594f..2986000d 100644 --- a/modules/dynamic/auto-update.js +++ b/modules/dynamic/auto-update.js @@ -964,5 +964,8 @@ export function resolveVersionConflicts(mapVersion) { defs.select("#water").selectAll("path, use").remove(); viewbox.select("#coastline").selectAll("path, use").remove(); drawFeatures(); + + // v1.106.0 change burg groups and added customizable icons + icons.selectAll("circle, use").remove(); } } diff --git a/modules/renderers/draw-burg-icons.js b/modules/renderers/draw-burg-icons.js index 8e11bf3b..54f72e34 100644 --- a/modules/renderers/draw-burg-icons.js +++ b/modules/renderers/draw-burg-icons.js @@ -8,20 +8,20 @@ function drawBurgIcons() { // capitals const capitals = pack.burgs.filter(b => b.capital && !b.removed); const capitalIcons = burgIcons.select("#cities"); - const capitalSize = capitalIcons.attr("size") || 1; + const capitalIcon = capitalIcons.attr("data-icon") || "#icon-circle"; const capitalAnchors = anchors.selectAll("#cities"); const capitalAnchorsSize = capitalAnchors.attr("size") || 2; capitalIcons - .selectAll("circle") + .selectAll("use") .data(capitals) .enter() - .append("circle") + .append("use") .attr("id", d => "burg" + d.i) + .attr("href", capitalIcon) .attr("data-id", d => d.i) - .attr("cx", d => d.x) - .attr("cy", d => d.y) - .attr("r", capitalSize); + .attr("x", d => d.x) + .attr("y", d => d.y); capitalAnchors .selectAll("use") @@ -38,20 +38,20 @@ function drawBurgIcons() { // towns const towns = pack.burgs.filter(b => b.i && !b.capital && !b.removed); const townIcons = burgIcons.select("#towns"); - const townSize = townIcons.attr("size") || 0.5; + const townIcon = townIcons.attr("data-icon") || "#icon-circle"; const townsAnchors = anchors.selectAll("#towns"); const townsAnchorsSize = townsAnchors.attr("size") || 1; townIcons - .selectAll("circle") + .selectAll("use") .data(towns) .enter() - .append("circle") + .append("use") .attr("id", d => "burg" + d.i) + .attr("href", townIcon) .attr("data-id", d => d.i) - .attr("cx", d => d.x) - .attr("cy", d => d.y) - .attr("r", townSize); + .attr("x", d => d.x) + .attr("y", d => d.y); townsAnchors .selectAll("use") diff --git a/styles/default.json b/styles/default.json index 9168debc..f67ffe57 100644 --- a/styles/default.json +++ b/styles/default.json @@ -338,14 +338,16 @@ "font-family": "Almendra SC" }, "#burgIcons > #cities": { + "data-icon": "#icon-star", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 1, + "font-size": 2, "stroke": "#3e3e4b", - "stroke-width": 0.24, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 10, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" }, "#anchors > #cities": { "opacity": 1, @@ -364,14 +366,16 @@ "font-family": "Almendra SC" }, "#burgIcons > #towns": { + "data-icon": "#icon-circle", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, - "size": 0.5, + "font-size": 1, "stroke": "#3e3e4b", - "stroke-width": 0.12, - "stroke-dasharray": "", - "stroke-linecap": "butt" + "stroke-width": 10, + "stroke-dasharray": null, + "stroke-linecap": "butt", + "stroke-linejoin": "round" }, "#anchors > #towns": { "opacity": 1, diff --git a/versioning.js b/versioning.js index 0afaecdd..139d7f0e 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.6"; +const VERSION = "1.106.0"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); { From fc1982ff5b9d5093f34718da412bbe12c1f5ddec Mon Sep 17 00:00:00 2001 From: Azgaar Date: Fri, 27 Sep 2024 12:54:20 +0200 Subject: [PATCH 02/38] feat: start --- styles/default.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/default.json b/styles/default.json index f67ffe57..fe9dfd0f 100644 --- a/styles/default.json +++ b/styles/default.json @@ -338,7 +338,7 @@ "font-family": "Almendra SC" }, "#burgIcons > #cities": { - "data-icon": "#icon-star", + "data-icon": "#icon-square", "opacity": 1, "fill": "#ffffff", "fill-opacity": 0.7, From d7d79ad7407c4198dd48a01b123fb38b5c822321 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 29 Sep 2024 14:24:44 +0200 Subject: [PATCH 03/38] refactor: split states and burgs generators --- index.css | 2 +- index.html | 30 +- main.js | 12 +- modules/burgs-generator.js | 279 ++++++++++++++++ modules/dynamic/auto-update.js | 20 +- modules/dynamic/editors/states-editor.js | 16 +- modules/markers-generator.js | 2 +- modules/provinces-generator.js | 4 +- modules/religions-generator.js | 9 +- ...urgs-and-states.js => states-generator.js} | 304 ++---------------- modules/submap.js | 2 +- modules/ui/burgs-overview.js | 25 ++ modules/ui/diplomacy-editor.js | 2 +- modules/ui/editors.js | 4 +- modules/ui/heightmap-editor.js | 7 +- modules/ui/provinces-editor.js | 6 +- modules/ui/style-presets.js | 34 +- modules/ui/tools.js | 45 ++- 18 files changed, 445 insertions(+), 358 deletions(-) create mode 100644 modules/burgs-generator.js rename modules/{burgs-and-states.js => states-generator.js} (68%) diff --git a/index.css b/index.css index 0244eb23..b30130f8 100644 --- a/index.css +++ b/index.css @@ -1892,7 +1892,7 @@ div.editorLine { } #militaryOptionsTable input[type="number"] { - width: 4em; + width: 5em; } #militaryOptionsTable button { diff --git a/index.html b/index.html index c21af9bb..8e958451 100644 --- a/index.html +++ b/index.html @@ -5321,6 +5321,7 @@
+
+ +