From 59462a4f15838ce7c098ce5090505fd4bbd6305c Mon Sep 17 00:00:00 2001
From: Azgaar
Date: Sun, 1 Sep 2024 21:42:34 +0200
Subject: [PATCH 01/30] fix: #1118 - get lake shoreline if missing
---
utils/pathUtils.js | 10 ++++++++--
versioning.js | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/utils/pathUtils.js b/utils/pathUtils.js
index ff3bbf2a..e148270b 100644
--- a/utils/pathUtils.js
+++ b/utils/pathUtils.js
@@ -21,7 +21,10 @@ function getVertexPaths({getType, options}) {
if (onborderCell === undefined) continue;
const feature = pack.features[cells.f[onborderCell]];
- if (feature.type === "lake" && feature.shoreline.every(ofSameType)) continue; // inner lake
+ if (feature.type === "lake") {
+ if (!feature.shoreline) Lakes.getShoreline(feature);
+ if (feature.shoreline.every(ofSameType)) continue; // inner lake
+ }
const startingVertex = cells.v[cellId].find(v => vertices.c[v].some(ofDifferentType));
if (startingVertex === undefined) throw new Error(`Starting vertex for cell ${cellId} is not found`);
@@ -104,7 +107,10 @@ function getVertexPath(cellsArray) {
if (onborderCell === undefined) continue;
const feature = pack.features[cells.f[onborderCell]];
- if (feature.type === "lake" && feature.shoreline.every(ofSameType)) continue; // inner lake
+ if (feature.type === "lake") {
+ if (!feature.shoreline) Lakes.getShoreline(feature);
+ if (feature.shoreline.every(ofSameType)) continue; // inner lake
+ }
const startingVertex = cells.v[cellId].find(v => vertices.c[v].some(ofDifferentType));
if (startingVertex === undefined) throw new Error(`Starting vertex for cell ${cellId} is not found`);
diff --git a/versioning.js b/versioning.js
index 8a5f9393..403ae70c 100644
--- a/versioning.js
+++ b/versioning.js
@@ -12,7 +12,7 @@
*
* Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0
*/
-const VERSION = "1.101.00";
+const VERSION = "1.101.01";
{
document.title += " v" + VERSION;
From 23e24845263daf6f22e98b3b8d7fc97d6185b0d1 Mon Sep 17 00:00:00 2001
From: Azgaar
Date: Mon, 2 Sep 2024 01:56:32 +0200
Subject: [PATCH 02/30] chore: supporters list update
---
modules/dynamic/supporters.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/dynamic/supporters.js b/modules/dynamic/supporters.js
index 478516fa..d6f9019a 100644
--- a/modules/dynamic/supporters.js
+++ b/modules/dynamic/supporters.js
@@ -580,4 +580,6 @@ MisterPete
Johanna Martin
Marmalade_MacGuffin
James Benware
-FortunesFaded`;
+FortunesFaded
+breadsticks
+Murderbits`;
From d42fd5cf92c371e0063b50b0c7d75424ef09378f Mon Sep 17 00:00:00 2001
From: Azgaar
Date: Mon, 2 Sep 2024 12:16:51 +0200
Subject: [PATCH 03/30] fix: year and era - unlock both on lock icon click
---
index.html | 8 +++++---
modules/ui/general.js | 12 +++++++-----
versioning.js | 2 +-
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/index.html b/index.html
index ef4d1660..8eb8d2c2 100644
--- a/index.html
+++ b/index.html
@@ -1529,7 +1529,9 @@
|
-
+
|
|
-
+
|
Year and era |
@@ -8046,7 +8048,7 @@
-
+
diff --git a/modules/ui/general.js b/modules/ui/general.js
index 7fd7e4d5..3530a442 100644
--- a/modules/ui/general.js
+++ b/modules/ui/general.js
@@ -429,17 +429,19 @@ function highlightEmblemElement(type, el) {
// assign lock behavior
document.querySelectorAll("[data-locked]").forEach(function (e) {
- e.addEventListener("mouseover", function (event) {
+ e.addEventListener("mouseover", e => {
+ e.stopPropagation();
if (this.className === "icon-lock")
tip("Click to unlock the option and allow it to be randomized on new map generation");
else tip("Click to lock the option and always use the current value on new map generation");
- event.stopPropagation();
});
e.addEventListener("click", function () {
- const id = this.id.slice(5);
- if (this.className === "icon-lock") unlock(id);
- else lock(id);
+ const fn = this.className === "icon-lock" ? unlock : lock;
+ const ids = this.dataset.ids.split(",");
+
+ if (ids.length) ids.forEach(fn);
+ else fn(this.id.slice(5));
});
});
diff --git a/versioning.js b/versioning.js
index 403ae70c..ac005116 100644
--- a/versioning.js
+++ b/versioning.js
@@ -12,7 +12,7 @@
*
* Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0
*/
-const VERSION = "1.101.01";
+const VERSION = "1.101.02";
{
document.title += " v" + VERSION;
From b273c77166ad4932d3aba0ac8a10e86d06227b10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?=
Date: Wed, 4 Sep 2024 02:34:48 +0200
Subject: [PATCH 04/30] added icon-dot-circled to locate burg in burg editor
menu (#1123)
* added icon-dot-circled to locate burg
- icon dot-circled
- function zoomIntoBurg()
* pack.burgs[id] and icons
pack.burgs[id].x and y
icon target and map pin
* Update versioning.js to 1.102.0
* Update index.html burg-editor.js to 1.102.00
---
index.html | 5 +++--
modules/ui/burg-editor.js | 9 +++++++++
versioning.js | 2 +-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
index 8eb8d2c2..bf6e48e2 100644
--- a/index.html
+++ b/index.html
@@ -3513,7 +3513,8 @@
-
+
+
|
@@ -1094,6 +1101,9 @@
id="styleGridSizeFriendly"
data-tip="Distance between grid cell centers (in map scale)"
>
+
+
+
@@ -7843,6 +7853,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 168203f7dabd82d5774bbdda572d3151110a68f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?=
Date: Wed, 4 Sep 2024 19:18:35 +0200
Subject: [PATCH 06/30] Friendly text on latitude cell info (#1125)
* Friendly text on latitude cell info
- Added function getLatitudeDescription(latitude)
- Added the text to infoLat on cell info.
* refactored, renamed to getGeozone
* v1.103 on commonUtils.js
---
index.html | 7 ++++---
modules/ui/general.js | 16 +++++++++++++++-
versioning.js | 2 +-
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/index.html b/index.html
index 48be97ff..8211b31e 100644
--- a/index.html
+++ b/index.html
@@ -5736,12 +5736,13 @@
Latitude:
Longitude:
+ Geozone:
Area: 0
Type: n/a
Precipitation: 0
River: no
Population: 0
- Elevation: 0
+ Elevation: 0
Depth: 0
Temperature: 0
Biome: n/a
@@ -8038,7 +8039,7 @@
-
+
@@ -8080,7 +8081,7 @@
-
+
diff --git a/modules/ui/general.js b/modules/ui/general.js
index 3530a442..9e62ef9a 100644
--- a/modules/ui/general.js
+++ b/modules/ui/general.js
@@ -259,10 +259,11 @@ function updateCellInfo(point, i, g) {
const f = cells.f[i];
infoLat.innerHTML = toDMS(getLatitude(y, 4), "lat");
infoLon.innerHTML = toDMS(getLongitude(x, 4), "lon");
+ infoGeozone.innerHTML = getGeozone(getLatitude(y, 4));
infoCell.innerHTML = i;
infoArea.innerHTML = cells.area[i] ? si(getArea(cells.area[i])) + " " + getAreaUnit() : "n/a";
- infoEvelation.innerHTML = getElevation(pack.features[f], pack.cells.h[i]);
+ infoElevation.innerHTML = getElevation(pack.features[f], pack.cells.h[i]);
infoDepth.innerHTML = getDepth(pack.features[f], point);
infoTemp.innerHTML = convertTemperature(grid.cells.temp[g]);
infoPrec.innerHTML = cells.h[i] >= 20 ? getFriendlyPrecipitation(i) : "n/a";
@@ -286,6 +287,19 @@ function updateCellInfo(point, i, g) {
infoBiome.innerHTML = biomesData.name[cells.biome[i]];
}
+function getGeozone(latitude) {
+
+ if (latitude > 66.5) return "Arctic";
+ if (latitude > 35) return "Temperate North";
+ if (latitude > 23.5) return "Subtropical North";
+ if (latitude > 1) return "Tropical North";
+ if (latitude > -1) return "Equatorial";
+ if (latitude > -23.5) return "Tropical South";
+ if (latitude > -35) return "Subtropical South";
+ if (latitude > -66.5) return "Temperate South";
+ return "Antarctic";
+}
+
// convert coordinate to DMS format
function toDMS(coord, c) {
const degrees = Math.floor(Math.abs(coord));
diff --git a/versioning.js b/versioning.js
index 93bbb8e4..283c243e 100644
--- a/versioning.js
+++ b/versioning.js
@@ -12,7 +12,7 @@
*
* Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0
*/
-const VERSION = "1.102.0";
+const VERSION = "1.103.0";
{
document.title += " v" + VERSION;
From 637aa398bba7c7193f28c31aa7d1092c2bb21927 Mon Sep 17 00:00:00 2001
From: Azgaar
Date: Wed, 4 Sep 2024 22:20:56 +0200
Subject: [PATCH 07/30] fix: 1.103.01 - parse old .map - add patch version
---
index.html | 2 +-
modules/io/load.js | 5 ++++-
versioning.js | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
index 8211b31e..03ff61cc 100644
--- a/index.html
+++ b/index.html
@@ -8129,7 +8129,7 @@
-
+