diff --git a/builder.js b/builder.js index 08d3fb6..5eed02f 100644 --- a/builder.js +++ b/builder.js @@ -1,9 +1,8 @@ -const url_base = location.href.split("#")[0]; const url_tag = location.hash.slice(1); console.log(url_base); console.log(url_tag); -const BUILD_VERSION = "6.9.23"; +const BUILD_VERSION = "6.9.24"; function setTitle() { let text; diff --git a/craft.js b/craft.js index 0ccdcdd..913f6ee 100644 --- a/craft.js +++ b/craft.js @@ -44,6 +44,7 @@ class Craft{ this.atkSpd = attackSpeed; this.hash = hash; this.initCraftStats(); + this.statMap.set("hash", this.hash); } @@ -65,6 +66,7 @@ class Craft{ setHash(hash) { this.hash = hash; this.statMap.set("displayName", "CR-" + this.hash); + this.statMap.set("hash", this.hash); } /* Get all stats for this build. Stores in this.statMap. @pre The craft itself should be valid. No checking of validity of pieces is done here. diff --git a/display.js b/display.js index 575553b..58b5915 100644 --- a/display.js +++ b/display.js @@ -592,11 +592,16 @@ function displayExpandedItem(item, parent_id){ if (item.get("tier") !== " ") { p_elem.classList.add(item.get("tier")); } - if(item.get("tier") === "Crafted") { + if(item.get("crafted")) { + p_elem.remove(); + p_elem = document.createElement("a"); + p_elem.classList.add('itemp'); p_elem.classList.add("smalltitle"); - p_elem.classList.remove("title"); + p_elem.classList.add(item.get("tier")); + p_elem.href = url_base + "crafter.html#" + item.get("hash"); + p_elem.textContent = item.get(id); + active_elem.appendChild(p_elem); } - p_elem.append(document.createElement("br")); let img = document.createElement("img"); img.src = "/media/items/generic-" + item.get("type") + ".png"; img.alt = item.get("type"); @@ -607,7 +612,6 @@ function displayExpandedItem(item, parent_id){ bckgrd.classList.add("itemp"); active_elem.appendChild(bckgrd); bckgrd.appendChild(img); - } else if (skp_order.includes(id)) { //id = str, dex, int, def, or agi if ( item.get("tier") !== "Crafted" && active_elem.nodeName === "DIV") { p_elem.textContent = ""; @@ -748,7 +752,7 @@ function displayExpandedItem(item, parent_id){ if(key === "Damage"){ effect.textContent += elementIcons[skp_elements.indexOf(element)]; } - if (element === "w") { + if (element === "w" && item.get("category") === "armor") { effect.textContent += " / Mana Used"; } specialEffects.appendChild(effect); diff --git a/load.js b/load.js index 241ad4a..6680a3b 100644 --- a/load.js +++ b/load.js @@ -1,4 +1,4 @@ -const DB_VERSION = 33; +const DB_VERSION = 34; // @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js let db; diff --git a/utils.js b/utils.js index 8b61e93..22e89e5 100644 --- a/utils.js +++ b/utils.js @@ -1,3 +1,6 @@ +let getUrl = window.location; +const url_base = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1]; + let skp_order = ["str","dex","int","def","agi"]; let skill = ["Strength", "Dexterity", "Intelligence", "Defense", "Agility"]; let skp_elements = ["e","t","w","f","a"];