resources ("goods") layers

This commit is contained in:
Azgaar 2021-05-04 01:16:39 +03:00
parent dd3581956d
commit 830ef826ee
6 changed files with 54 additions and 33 deletions

View file

@ -739,6 +739,7 @@ function parseLoadedData(data) {
coastline = viewbox.select("#coastline");
prec = viewbox.select("#prec");
population = viewbox.select("#population");
goods = viewbox.select("#goods");
emblems = viewbox.select("#emblems");
labels = viewbox.select("#labels");
icons = viewbox.select("#icons");
@ -830,6 +831,7 @@ function parseLoadedData(data) {
if (hasChild(population, "line")) turnOn("togglePopulation");
if (hasChildren(ice)) turnOn("toggleIce");
if (hasChild(prec, "circle")) turnOn("togglePrec");
if (hasChildren(goods)) turnOn("toggleResources");
if (notHidden(emblems) && hasChild(emblems, "use")) turnOn("toggleEmblems");
if (notHidden(labels)) turnOn("toggleLabels");
if (notHidden(icons)) turnOn("toggleIcons");
@ -1202,6 +1204,11 @@ function parseLoadedData(data) {
gridOverlay.attr("size", null);
}
if (version < 1.7) {
// v 1.7 added resources layer
goods = viewbox.append("g").attr("id", "goods");
}
void function checkDataIntegrity() {
const cells = pack.cells;