mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
added topography
This commit is contained in:
parent
21df872ca2
commit
2c3692f000
5 changed files with 151 additions and 1 deletions
|
|
@ -186,6 +186,7 @@ function drawLayers() {
|
|||
drawFeatures();
|
||||
if (layerIsOn("toggleTexture")) drawTexture();
|
||||
if (layerIsOn("toggleHeight")) drawHeightmap();
|
||||
if (layerIsOn("toggleTopography")) drawTopography();
|
||||
if (layerIsOn("toggleBiomes")) drawBiomes();
|
||||
if (layerIsOn("toggleCells")) drawCells();
|
||||
if (layerIsOn("toggleGrid")) drawGrid();
|
||||
|
|
@ -229,6 +230,18 @@ function toggleHeight(event) {
|
|||
}
|
||||
}
|
||||
|
||||
function toggleTopography(event) {
|
||||
const group = d3.select('#topography');
|
||||
const hasContent = group.selectAll('*').size() > 0;
|
||||
if (!hasContent) {
|
||||
turnButtonOn('toggleTopography');
|
||||
drawTopography();
|
||||
} else {
|
||||
turnButtonOff('toggleTopography');
|
||||
group.selectAll('*').remove();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleTemperature(event) {
|
||||
if (!temperature.selectAll("*").size()) {
|
||||
turnButtonOn("toggleTemperature");
|
||||
|
|
@ -1015,6 +1028,7 @@ function moveLayer(event, ui) {
|
|||
// define connection between option layer buttons and actual svg groups to move the element
|
||||
function getLayer(id) {
|
||||
if (id === "toggleHeight") return $("#terrs");
|
||||
if (id === "toggleTopography") return $("#topography");
|
||||
if (id === "toggleBiomes") return $("#biomes");
|
||||
if (id === "toggleCells") return $("#cells");
|
||||
if (id === "toggleGrid") return $("#gridOverlay");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue