mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
restring layers off on heightmap edit
This commit is contained in:
parent
6f08c87015
commit
886ea38b44
2 changed files with 6 additions and 2 deletions
|
|
@ -419,7 +419,7 @@
|
||||||
lineGen.curve(d3.curveBundle.beta(1));
|
lineGen.curve(d3.curveBundle.beta(1));
|
||||||
|
|
||||||
for (const s of states) {
|
for (const s of states) {
|
||||||
if (!s.i || s.removed || (list && !list.includes(s.i))) continue;
|
if (!s.i || s.removed || !s.cells || (list && !list.includes(s.i))) continue;
|
||||||
const used = [];
|
const used = [];
|
||||||
const visualCenter = findCell(s.pole[0], s.pole[1]);
|
const visualCenter = findCell(s.pole[0], s.pole[1]);
|
||||||
const start = cells.state[visualCenter] === s.i ? visualCenter : s.center;
|
const start = cells.state[visualCenter] === s.i ? visualCenter : s.center;
|
||||||
|
|
|
||||||
|
|
@ -120,13 +120,17 @@ function restoreLayers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleHeight(event) {
|
function toggleHeight(event) {
|
||||||
|
if (customization === 1) {
|
||||||
|
tip("You cannot turn off the layer when heightmap is in edit mode", false, "error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!terrs.selectAll("*").size()) {
|
if (!terrs.selectAll("*").size()) {
|
||||||
turnButtonOn("toggleHeight");
|
turnButtonOn("toggleHeight");
|
||||||
drawHeightmap();
|
drawHeightmap();
|
||||||
if (event && isCtrlClick(event)) editStyle("terrs");
|
if (event && isCtrlClick(event)) editStyle("terrs");
|
||||||
} else {
|
} else {
|
||||||
if (event && isCtrlClick(event)) {editStyle("terrs"); return;}
|
if (event && isCtrlClick(event)) {editStyle("terrs"); return;}
|
||||||
if (customization === 1) {tip("You cannot turn off the layer when heightmap is in edit mode", false, "error"); return;}
|
|
||||||
turnButtonOff("toggleHeight");
|
turnButtonOff("toggleHeight");
|
||||||
terrs.selectAll("*").remove();
|
terrs.selectAll("*").remove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue