automatically pit output to input and store data

This commit is contained in:
Azgaar 2021-06-26 00:41:43 +03:00
parent d6aac8d12c
commit 3892370816
7 changed files with 347 additions and 270 deletions

View file

@ -92,9 +92,9 @@ function selectStyleElement() {
if (sel === "terrs") {
styleHeightmap.style.display = "block";
styleHeightmapScheme.value = terrs.attr("scheme");
styleHeightmapTerracing.value = styleHeightmapTerracingOutput.value = terrs.attr("terracing");
styleHeightmapSkip.value = styleHeightmapSkipOutput.value = terrs.attr("skip");
styleHeightmapSimplification.value = styleHeightmapSimplificationOutput.value = terrs.attr("relax");
styleHeightmapTerracingInput.value = styleHeightmapTerracingOutput.value = terrs.attr("terracing");
styleHeightmapSkipInput.value = styleHeightmapSkipOutput.value = terrs.attr("skip");
styleHeightmapSimplificationInput.value = styleHeightmapSimplificationOutput.value = terrs.attr("relax");
styleHeightmapCurve.value = terrs.attr("curve");
}
@ -419,20 +419,17 @@ styleHeightmapScheme.addEventListener("change", function () {
drawHeightmap();
});
styleHeightmapTerracing.addEventListener("input", function () {
styleHeightmapTerracingOutput.value = this.value;
styleHeightmapTerracingInput.addEventListener("input", function () {
terrs.attr("terracing", this.value);
drawHeightmap();
});
styleHeightmapSkip.addEventListener("input", function () {
styleHeightmapSkipOutput.value = this.value;
styleHeightmapSkipInput.addEventListener("input", function () {
terrs.attr("skip", this.value);
drawHeightmap();
});
styleHeightmapSimplification.addEventListener("input", function () {
styleHeightmapSimplificationOutput.value = this.value;
styleHeightmapSimplificationInput.addEventListener("input", function () {
terrs.attr("relax", this.value);
drawHeightmap();
});