Completed synths won't highlight materials anymore
parent
fecd6e866f
commit
c371008360
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue