diff --git a/index.html b/index.html index 3c5683e..4f628de 100644 --- a/index.html +++ b/index.html @@ -666,6 +666,8 @@ if (abilityEffort > maxEffort) { inpAbilityEffort.value = maxEffort; } + + updateAbilityCostDisplay(); }; const calculateAbilityCost = () => { @@ -700,6 +702,18 @@ dspAbilityCost.appendChild(document.createTextNode(cost)); }; + const poolValueChanged = () => { + updateAbilityCostDisplay(); + }; + + const poolEdgeChanged = () => { + updateAbilityCostDisplay(); + }; + + const abilityCostChanged = () => { + updateAbilityCostDisplay(); + }; + document.addEventListener( "DOMContentLoaded", () => { @@ -716,6 +730,15 @@ .querySelectorAll("input[name=pool-selector]") .forEach((elem) => {elem.addEventListener("change", poolSelectionChanged)}); + for (var poolValueInput of Object.values(inpPoolValue)) { + poolValueInput.addEventListener("input", poolValueChanged); + } + + for (var poolEdgeInput of Object.values(inpPoolEdge)) { + poolEdgeInput.addEventListener("input", poolEdgeChanged); + } + + inpAbilityCost.addEventListener("input", abilityCostChanged); inpAbilityEffort.addEventListener("input", abilityEffortChanged); btnNoCharCreateCharacter.addEventListener("click", createCharacter);