mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix: heightmap edit in Erase mode
This commit is contained in:
parent
62805dc1a6
commit
8be55eae51
3 changed files with 5 additions and 11 deletions
|
|
@ -157,11 +157,7 @@ function editHeightmap(options) {
|
|||
// Exit customization mode
|
||||
function finalizeHeightmap() {
|
||||
if (viewbox.select("#heights").selectAll("*").size() < 200)
|
||||
return tip(
|
||||
"Insufficient land area! There should be at least 200 land cells to finalize the heightmap",
|
||||
null,
|
||||
"error"
|
||||
);
|
||||
return tip("Insufficient land area. There should be at least 200 land cells!", null, "error");
|
||||
if (byId("imageConverter").offsetParent) return tip("Please exit the Image Conversion mode first", null, "error");
|
||||
|
||||
delete window.edits; // remove global variable
|
||||
|
|
@ -173,6 +169,7 @@ function editHeightmap(options) {
|
|||
if (byId("options").querySelector(".tab > button.active").id === "toolsTab") toolsContent.style.display = "block";
|
||||
layersPreset.disabled = false;
|
||||
exitCustomization.style.display = "none"; // hide finalize button
|
||||
|
||||
restoreDefaultEvents();
|
||||
clearMainTip();
|
||||
closeDialogs();
|
||||
|
|
@ -187,6 +184,7 @@ function editHeightmap(options) {
|
|||
else if (mode === "risk") restoreRiskedData();
|
||||
|
||||
// restore initial layers
|
||||
drawFeatures();
|
||||
byId("heights").remove();
|
||||
turnButtonOff("toggleHeight");
|
||||
document
|
||||
|
|
@ -250,8 +248,6 @@ function editHeightmap(options) {
|
|||
Provinces.getPoles();
|
||||
BurgsAndStates.defineBurgFeatures();
|
||||
|
||||
drawStateLabels();
|
||||
|
||||
Rivers.specify();
|
||||
Features.specify();
|
||||
|
||||
|
|
@ -434,8 +430,6 @@ function editHeightmap(options) {
|
|||
c.center = findCell(c.x, c.y);
|
||||
}
|
||||
|
||||
drawStateLabels();
|
||||
|
||||
if (erosionAllowed) {
|
||||
Rivers.specify();
|
||||
Lakes.generateName();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue