mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
restore layers - don't hide, remove unused
This commit is contained in:
parent
a17457ae35
commit
90c87853b1
2 changed files with 16 additions and 14 deletions
|
|
@ -122,9 +122,10 @@ function restoreLayers() {
|
||||||
if (layerIsOn("toggleIce")) drawIce();
|
if (layerIsOn("toggleIce")) drawIce();
|
||||||
if (layerIsOn("toggleEmblems")) drawEmblems();
|
if (layerIsOn("toggleEmblems")) drawEmblems();
|
||||||
|
|
||||||
// states are getting rendered each time, if it's not required than layers should be hidden
|
// some layers are rendered each time, remove them if they are not on
|
||||||
if (!layerIsOn("toggleBorders")) $("#borders").fadeOut();
|
if (!layerIsOn("toggleBorders")) borders.selectAll("path").remove();
|
||||||
if (!layerIsOn("toggleStates")) regions.style("display", "none").selectAll("path").remove();
|
if (!layerIsOn("toggleStates")) regions.selectAll("path").remove();
|
||||||
|
if (!layerIsOn("toggleRivers")) rivers.selectAll("*").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleHeight(event) {
|
function toggleHeight(event) {
|
||||||
|
|
@ -1034,13 +1035,14 @@ function drawBorders() {
|
||||||
TIME && console.time("drawBorders");
|
TIME && console.time("drawBorders");
|
||||||
borders.selectAll("path").remove();
|
borders.selectAll("path").remove();
|
||||||
|
|
||||||
const cells = pack.cells,
|
const {cells, vertices} = pack;
|
||||||
vertices = pack.vertices,
|
const n = cells.i.length;
|
||||||
n = cells.i.length;
|
|
||||||
const sPath = [],
|
const sPath = [];
|
||||||
pPath = [];
|
const pPath = [];
|
||||||
const sUsed = new Array(pack.states.length).fill("").map(a => []);
|
|
||||||
const pUsed = new Array(pack.provinces.length).fill("").map(a => []);
|
const sUsed = new Array(pack.states.length).fill("").map(_ => []);
|
||||||
|
const pUsed = new Array(pack.provinces.length).fill("").map(_ => []);
|
||||||
|
|
||||||
for (let i = 0; i < cells.i.length; i++) {
|
for (let i = 0; i < cells.i.length; i++) {
|
||||||
if (!cells.state[i]) continue;
|
if (!cells.state[i]) continue;
|
||||||
|
|
|
||||||
|
|
@ -544,15 +544,15 @@ function randomizeHeightmapTemplate() {
|
||||||
volcano: 3,
|
volcano: 3,
|
||||||
highIsland: 22,
|
highIsland: 22,
|
||||||
lowIsland: 9,
|
lowIsland: 9,
|
||||||
continents: 20,
|
continents: 19,
|
||||||
archipelago: 25,
|
archipelago: 23,
|
||||||
mediterranean: 3,
|
mediterranean: 5,
|
||||||
peninsula: 3,
|
peninsula: 3,
|
||||||
pangea: 5,
|
pangea: 5,
|
||||||
isthmus: 2,
|
isthmus: 2,
|
||||||
atoll: 1,
|
atoll: 1,
|
||||||
shattered: 7,
|
shattered: 7,
|
||||||
taklamakan: 2
|
taklamakan: 1
|
||||||
};
|
};
|
||||||
document.getElementById("templateInput").value = rw(templates);
|
document.getElementById("templateInput").value = rw(templates);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue