Merge pull request #191 from hppeng-wynn/crafter-undefined-fix

Fix fatal typo causing default ings to show as undefined in crafter
This commit is contained in:
hppeng-wynn 2022-08-02 23:45:58 -07:00 committed by GitHub
commit f95d8c9d95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 20 deletions

View file

@ -31,16 +31,6 @@ let player_craft;
function init_crafter() {
//no ing
console.log("all ingredients");
console.log(ingMap);
console.log("all recipes");
console.log(recipeMap);
/*console.log(ingList);
console.log(recipeList);
console.log(ingIDMap);
console.log(recipeIDMap);*/
try {
document.getElementById("recipe-choice").addEventListener("change", (event) => {
updateMaterials();
@ -56,17 +46,16 @@ function init_crafter() {
});
for (let i = 1; i < 4; ++i) {
document.getElementById("mat-1-"+i).setAttribute("onclick", document.getElementById("mat-1-"+i).getAttribute("onclick") + "; calculateCraftSchedule();");
document.getElementById("mat-2-"+i).setAttribute("onclick", document.getElementById("mat-2-"+i).getAttribute("onclick") + "; calculateCraftSchedule();");
document.getElementById("mat-1-"+i).addEventListener("click", (e) => calculateCraftSchedule());
document.getElementById("mat-2-"+i).addEventListener("click", (e) => calculateCraftSchedule());
}
for (let i = 1; i < 7; ++i) {
document.getElementById("ing-choice-" + i ).setAttribute("oninput", "calculateCraftSchedule();");
document.getElementById("ing-choice-" + i ).addEventListener("oninput", (e) => calculateCraftSchedule());
}
for (const str of ["slow", "normal", "fast"]) {
document.getElementById(str + "-atk-button").setAttribute("onclick", document.getElementById(str + "-atk-button").getAttribute("onclick") + "; calculateCraftSchedule();");
document.getElementById(str + "-atk-button").addEventListener("onclick", (e) => calculateCraftSchedule());
}
populateFields();
decodeCraft(ing_url_tag);
} catch (error) {
@ -259,12 +248,10 @@ function populateFields() {
ing_list.appendChild(el);
}
}
}
/*
Copies the CR Hash (CR-blahblahblah)
*/
* Copies the CR Hash (CR-blahblahblah)
*/
function copyRecipeHash() {
if (player_craft) {
copyTextToClipboard("CR-"+location.hash.slice(1));

View file

@ -197,7 +197,7 @@ function init_ing_maps() {
posMods: {"left": 0, "right": 0, "above": 0, "under": 0, "touching": 0, "notTouching": 0}
};
ing.id = 4001 + ing.pid;
ing.diplayName = ing.name;
ing.displayName = ing.name;
switch(i) {
case 0:
ing.itemIDs["strReq"] = powderIng["skpReq"];