From 5461685d238e1875f054cb08e45d9288437fc0d5 Mon Sep 17 00:00:00 2001 From: GoteGuru Date: Fri, 1 Apr 2022 00:38:44 +0000 Subject: [PATCH] Lock markers and lock burgs options --- index.html | 15 +++++++++++---- modules/submap.js | 24 ++++++++++++++++-------- modules/ui/submap.js | 8 +++++--- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 2d4407de..e4cd8ea2 100644 --- a/index.html +++ b/index.html @@ -3685,10 +3685,6 @@ -
- - -
@@ -3698,6 +3694,17 @@

+ +

Lock remapped items for:

+
+ + +
+
+ + +
+

Extra / experimental features:

diff --git a/modules/submap.js b/modules/submap.js index 7e562aa2..b3ca8b2b 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -5,6 +5,7 @@ Experimental submaping module window.Submap = (function () { const isWater = (map, id) => map.grid.cells.h[map.pack.cells.g[id]] < 20? true: false; + const inMap = (x,y) => x>0 && x0 && y x>0 && x0 && y cells.t[c] === 1 @@ -379,7 +387,7 @@ window.Submap = (function () { b.cell = cityCell; [b.x, b.y] = cells.p[cityCell]; } - b.lock = true; + if (!b.lock) b.lock = options.lockBurgs; pack.cells.burg[b.cell] = id; if (options.promoteTown) b.capital = 1; }); diff --git a/modules/ui/submap.js b/modules/ui/submap.js index 2ee0181b..084c594b 100644 --- a/modules/ui/submap.js +++ b/modules/ui/submap.js @@ -22,10 +22,12 @@ const generateSubmap = debounce(async function () { const checked = id => Boolean(document.getElementById(id).checked) const options = { copyBurgs: checked("submapCopyBurgs"), - copyMarkers: checked("submapCopyMarkers"), copyZones: checked("submapCopyZones"), - copyZones: checked("submapCopyRivers"), - copyZones: checked("submapCopyRoads"), + copyRivers: checked("submapCopyRivers"), + copyRoads: checked("submapCopyRoads"), + + lockMarkers: checked("submapLockMarkers"), + lockBurgs: checked("submapLockBurgs"), depressRivers: checked("submapDepressRivers"), addLakesInDepressions: checked("submapAddLakeInDepression"),