From f5bd48c12770c09d7fe9fd02526cf6749c3192b4 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 11 Jun 2025 22:15:46 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Don=E2=80=99t=20let=20ability=20effort?= =?UTF-8?q?=20count=20to=20be=20raised=20above=20the=20maximum=20effort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.html b/index.html index 43e50bf..0457ae5 100644 --- a/index.html +++ b/index.html @@ -433,6 +433,7 @@ speed: document.getElementById("inp-pool-edge-speed"), intellect: document.getElementById("inp-pool-edge-intellect"), }; + const inpAbilityEffort = document.getElementById("inp-ability-effort"); const dspAbilityPool = document.getElementById("dsp-ability-pool"); @@ -655,6 +656,15 @@ } }; + const abilityEffortChanged = () => { + var maxEffort = Number(inpMaxEffort.value); + var abilityEffort = Number(inpAbilityEffort.value); + + if (abilityEffort > maxEffort) { + inpAbilityEffort.value = maxEffort; + } + }; + document.addEventListener( "DOMContentLoaded", () => { @@ -671,6 +681,8 @@ .querySelectorAll("input[name=pool-selector]") .forEach((elem) => {elem.addEventListener("change", poolSelectionChanged)}); + inpAbilityEffort.addEventListener("input", abilityEffortChanged); + btnNoCharCreateCharacter.addEventListener("click", createCharacter); btnCreateCharacter.addEventListener("click", createCharacter); btnSaveCharacter.addEventListener("click", saveCurrentCharacter);