mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-05 01:51:23 +01:00
prototype for ice seperation
This commit is contained in:
parent
f30ffd812e
commit
7f99323d22
9 changed files with 322 additions and 106 deletions
|
|
@ -406,6 +406,7 @@ async function parseLoadedData(data, mapVersion) {
|
|||
pack.cells.province = data[27] ? Uint16Array.from(data[27].split(",")) : new Uint16Array(pack.cells.i.length);
|
||||
// data[28] had deprecated cells.crossroad
|
||||
pack.cells.routes = data[36] ? JSON.parse(data[36]) : {};
|
||||
pack.ice = data[39] ? JSON.parse(data[39]) : {glaciers: [], icebergs: []};
|
||||
|
||||
if (data[31]) {
|
||||
const namesDL = data[31].split("/");
|
||||
|
|
@ -449,7 +450,11 @@ async function parseLoadedData(data, mapVersion) {
|
|||
if (isVisible(routes) && hasChild(routes, "path")) turnOn("toggleRoutes");
|
||||
if (hasChildren(temperature)) turnOn("toggleTemperature");
|
||||
if (hasChild(population, "line")) turnOn("togglePopulation");
|
||||
if (hasChildren(ice)) turnOn("toggleIce");
|
||||
if (pack.ice?.glaciers?.length || pack.ice?.icebergs?.length) {
|
||||
ice.selectAll("*").remove(); // clear old SVG
|
||||
drawIce(); // re-render ice from data
|
||||
turnOn("toggleIce");
|
||||
}
|
||||
if (hasChild(prec, "circle")) turnOn("togglePrecipitation");
|
||||
if (isVisible(emblems) && hasChild(emblems, "use")) turnOn("toggleEmblems");
|
||||
if (isVisible(labels)) turnOn("toggleLabels");
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ function prepareMapData() {
|
|||
const cellRoutes = JSON.stringify(pack.cells.routes);
|
||||
const routes = JSON.stringify(pack.routes);
|
||||
const zones = JSON.stringify(pack.zones);
|
||||
const ice = JSON.stringify(pack.ice);
|
||||
|
||||
// store name array only if not the same as default
|
||||
const defaultNB = Names.getNameBases();
|
||||
|
|
@ -155,7 +156,8 @@ function prepareMapData() {
|
|||
markers,
|
||||
cellRoutes,
|
||||
routes,
|
||||
zones
|
||||
zones,
|
||||
ice
|
||||
].join("\r\n");
|
||||
return mapData;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue