From 20ecf0e085d3fc2a26f08b5be1bcebc43fe17a0d Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 1 Jan 2019 21:56:35 -0600 Subject: [PATCH] Tentatively fixed buttons/etc from being enabled when turned on in a category that is collapsed --- game.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/game.js b/game.js index fcf331f..5dd3dca 100644 --- a/game.js +++ b/game.js @@ -4273,6 +4273,35 @@ function loadPreset() { } function grabFormData(form, warnings, panels, buttons, stats) { + + // verify that this input box is in something we enabled + + + let parent = form.parentElement; + + + while(true) { + if (parent.id == "custom-species") + { + break; + } + + if (parent.classList.contains("reveal-if-active")) + { + let sib = parent.previousSibling.previousSibling; + + if (!sib.checked) { + console.log("aborting " + form.id); + return; + } + + } + + parent = parent.parentElement; + + + } + if (form.hasAttribute("data-warning")) { warnings.push(form.getAttribute("data-warning")); } @@ -4487,7 +4516,6 @@ function enable_victim(category) { } function enable_button(name) { - console.log(name); document.getElementById("button-action-" + name).style.display = "inline"; }