Merge pull request #80 from hppeng-wynn/crafter_fix

Restore crafter to working condition i think
This commit is contained in:
hppeng-wynn 2022-07-06 11:36:24 -07:00 committed by GitHub
commit 5d8c5aa6b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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