mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v 0.8.11b
This commit is contained in:
parent
a24b2ed10f
commit
ee20388f6f
1 changed files with 3 additions and 3 deletions
|
|
@ -91,7 +91,7 @@ function editBiomes() {
|
||||||
|
|
||||||
// add listeners
|
// add listeners
|
||||||
body.querySelectorAll("div.biomes").forEach(el => el.addEventListener("mouseenter", ev => biomeHighlightOn(ev)));
|
body.querySelectorAll("div.biomes").forEach(el => el.addEventListener("mouseenter", ev => biomeHighlightOn(ev)));
|
||||||
body.querySelectorAll("div.biomes").forEach(el => el.addEventListener("mouseleave", ev => biomeHighlightOff(ev)));
|
body.querySelectorAll("div.biomes").forEach(el => el.addEventListener("mouseleave", ev => biomeHighlightOff(ev)));
|
||||||
body.querySelectorAll("div.biomes").forEach(el => el.addEventListener("click", selectBiomeOnLineClick));
|
body.querySelectorAll("div.biomes").forEach(el => el.addEventListener("click", selectBiomeOnLineClick));
|
||||||
body.querySelectorAll("div > input[type='color']").forEach(el => el.addEventListener("input", biomeChangeColor));
|
body.querySelectorAll("div > input[type='color']").forEach(el => el.addEventListener("input", biomeChangeColor));
|
||||||
body.querySelectorAll("div > input.biomeName").forEach(el => el.addEventListener("input", biomeChangeName));
|
body.querySelectorAll("div > input.biomeName").forEach(el => el.addEventListener("input", biomeChangeName));
|
||||||
|
|
@ -129,10 +129,10 @@ function editBiomes() {
|
||||||
|
|
||||||
function biomeChangeHabitability() {
|
function biomeChangeHabitability() {
|
||||||
const biome = +this.parentNode.dataset.id;
|
const biome = +this.parentNode.dataset.id;
|
||||||
const failed = isNaN(+this.value) || +this.value < 0 || +this.value > 999;
|
const failed = isNaN(+this.value) || +this.value < 0 || +this.value > 9999;
|
||||||
if (failed) {
|
if (failed) {
|
||||||
this.value = biomesData.habitability[biome];
|
this.value = biomesData.habitability[biome];
|
||||||
tip("Please provide a valid number in range 0-999", false, "error");
|
tip("Please provide a valid number in range 0-9999", false, "error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
biomesData.habitability[biome] = +this.value;
|
biomesData.habitability[biome] = +this.value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue