feat: migrate label data structure from SVG to data model and update version to 1.113.0

This commit is contained in:
StempunkDev 2026-02-17 01:45:48 +01:00
parent ca6d01f4be
commit 3ab40ada5f
4 changed files with 158 additions and 3 deletions

View file

@ -407,6 +407,7 @@ async function parseLoadedData(data, mapVersion) {
// data[28] had deprecated cells.crossroad
pack.cells.routes = data[36] ? JSON.parse(data[36]) : {};
pack.ice = data[39] ? JSON.parse(data[39]) : [];
pack.labels = data[40] ? JSON.parse(data[40]) : [];
if (data[31]) {
const namesDL = data[31].split("/");
@ -473,7 +474,7 @@ async function parseLoadedData(data, mapVersion) {
{
// dynamically import and run auto-update script
const {resolveVersionConflicts} = await import("../dynamic/auto-update.js?v=1.109.4");
const {resolveVersionConflicts} = await import("../dynamic/auto-update.js?v=1.113.0");
resolveVersionConflicts(mapVersion);
}

View file

@ -104,6 +104,7 @@ function prepareMapData() {
const routes = JSON.stringify(pack.routes);
const zones = JSON.stringify(pack.zones);
const ice = JSON.stringify(pack.ice);
const labels = JSON.stringify(pack.labels || []);
// store name array only if not the same as default
const defaultNB = Names.getNameBases();
@ -158,7 +159,8 @@ function prepareMapData() {
cellRoutes,
routes,
zones,
ice
ice,
labels
].join("\r\n");
return mapData;
}