From c3710083604fa834d7d1a5d647f7fa9013e8033f Mon Sep 17 00:00:00 2001 From: Wynd Date: Sun, 29 Jun 2025 23:02:50 +0300 Subject: [PATCH] Completed synths won't highlight materials anymore --- public/scripts/kh1/synth.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/public/scripts/kh1/synth.js b/public/scripts/kh1/synth.js index f743536..7a2a79b 100644 --- a/public/scripts/kh1/synth.js +++ b/public/scripts/kh1/synth.js @@ -33,14 +33,23 @@ function update_synth_completions(recipe) { function highlight_ingredients(label) { let mats = []; - const ingredients = label.querySelectorAll("label ul li"); + const ingredients = label.querySelectorAll("ul li"); + const checkbox = label.parentElement.querySelectorAll(".recipe")[0]; + + const elems = document.querySelectorAll("#mats ul li"); + + if (checkbox.checked) { + for (const elem of elems) { + elem.style.color = "#fff"; + } + return; + } for (const ingredient of ingredients) { const name = ingredient.dataset["synthItemName"]; mats.push(name); } - const elems = document.querySelectorAll("#mats ul li"); for (const elem of elems) { const isCrossed = elem.style.textDecoration === "line-through"; if (isCrossed) {