From fdf0d163a8b717332d63f4666e886564c93d28d7 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Fri, 30 Aug 2024 17:50:41 +0200 Subject: [PATCH] feat: zones - auto-update --- modules/dynamic/auto-update.js | 12 +++++++++++- versioning.js | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/dynamic/auto-update.js b/modules/dynamic/auto-update.js index a01a1bb8..a11faa31 100644 --- a/modules/dynamic/auto-update.js +++ b/modules/dynamic/auto-update.js @@ -928,6 +928,16 @@ export function resolveVersionConflicts(mapVersion) { if (isOlderThan("1.100.0")) { // v1.100.00 added zones to pack data - zones.stlye("display", "none"); + pack.zones = []; + zones.selectAll("g").each(function () { + const i = pack.zones.length; + const name = this.dataset.description; + const type = this.dataset.type; + const color = this.getAttribute("fill"); + const cells = this.dataset.cells.split(",").map(Number); + pack.zones.push({i, name, type, cells, color}); + }); + zones.style("display", null).selectAll("*").remove(); + if (layerIsOn("toggleZones")) drawZones(); } } diff --git a/versioning.js b/versioning.js index 1c1cb580..c8acea04 100644 --- a/versioning.js +++ b/versioning.js @@ -33,6 +33,7 @@ const VERSION = "1.100.00";