Completed synths won't highlight materials anymore

master
Wynd 2025-06-29 23:02:50 +03:00
parent fecd6e866f
commit c371008360
1 changed files with 11 additions and 2 deletions

View File

@ -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) {