feat: zones - auto-update

This commit is contained in:
Azgaar 2024-08-30 17:50:41 +02:00
parent 26c608402c
commit fdf0d163a8
2 changed files with 12 additions and 1 deletions

View file

@ -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();
}
}

View file

@ -33,6 +33,7 @@ const VERSION = "1.100.00";
<ul>
<strong>Latest changes:</strong>
<li>Zones update</li>
<li>Notes Editor: on-demand AI text generation</li>
<li>New style preset: Dark Seas</li>
<li>New routes generation algorithm</li>