From 5f0f42a98af2e314c3eabe44b3ce61fdd30f69e0 Mon Sep 17 00:00:00 2001 From: hppeng Date: Wed, 6 Jul 2022 01:40:52 -0700 Subject: [PATCH] Restore crafter to working condition i think --- js/crafter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/crafter.js b/js/crafter.js index bb40c7e..865b740 100644 --- a/js/crafter.js +++ b/js/crafter.js @@ -44,14 +44,16 @@ function init_crafter() { try { document.getElementById("recipe-choice").addEventListener("change", (event) => { updateMaterials(); + updateCraftedImage(); calculateCraftSchedule(); }); + document.getElementById("recipe-choice").addEventListener("oninput", (event) => { + updateCraftedImage(); + }); document.getElementById("level-choice").addEventListener("change", (event) => { updateMaterials(); calculateCraftSchedule(); }); - document.getElementById("recipe-choice").setAttribute("oninput", "updateCraftedImage()"); - document.getElementById("recipe-choice").setAttribute("change", "updateCraftedImage()"); for (let i = 1; i < 4; ++i) { document.getElementById("mat-1-"+i).setAttribute("onclick", document.getElementById("mat-1-"+i).getAttribute("onclick") + "; calculateCraftSchedule();"); @@ -177,7 +179,7 @@ function calculateCraft() { //Display Craft Stats // displayCraftStats(player_craft, "craft-stats"); let mock_item = player_craft.statMap; - apply_weapon_powders(mock_item); + if (mock_item.get('category') === 'weapon') { apply_weapon_powders(mock_item) }; displayExpandedItem(mock_item, "craft-stats"); //Display Ingredients' Stats