diff --git a/js/build_utils.js b/js/build_utils.js index 430d55c..58e863d 100644 --- a/js/build_utils.js +++ b/js/build_utils.js @@ -218,7 +218,6 @@ function expandItem(item) { } expandedItem.set("minRolls",minRolls); expandedItem.set("maxRolls",maxRolls); - expandedItem.set("powders", []); return expandedItem; } diff --git a/js/builder_graph.js b/js/builder_graph.js index be33da8..e54fd02 100644 --- a/js/builder_graph.js +++ b/js/builder_graph.js @@ -203,13 +203,11 @@ class ItemInputNode extends InputNode { type_match = item.statMap.get('type') === this.none_item.statMap.get('type'); } if (type_match) { - if (powdering !== undefined) { - if (item.statMap.get('category') === 'armor') { - applyArmorPowders(item.statMap, powdering); - } - else if (item.statMap.get('category') === 'weapon') { - apply_weapon_powders(item.statMap, powdering); - } + if (item.statMap.get('category') === 'armor') { + applyArmorPowders(item.statMap, powdering); + } + else if (item.statMap.get('category') === 'weapon') { + apply_weapon_powders(item.statMap, powdering); } return item; } @@ -247,6 +245,7 @@ class ItemInputDisplayNode extends ComputeNode { this.input_field = document.getElementById(eq+"-choice"); this.health_field = document.getElementById(eq+"-health"); this.level_field = document.getElementById(eq+"-lv"); + this.powder_field = document.getElementById(eq+"-powder"); // possibly None this.image = item_image; this.fail_cb = true; } @@ -271,10 +270,18 @@ class ItemInputDisplayNode extends ComputeNode { this.input_field.classList.add("is-invalid"); return null; } + if (item.statMap.has('powders')) { + this.powder_field.placeholder = "powders"; + } if (item.statMap.has('NONE')) { return null; } + + if (item.statMap.has('powders')) { + this.powder_field.placeholder = item.statMap.get('slots') + ' slots'; + } + const tier = item.statMap.get('tier'); this.input_field.classList.add(tier); if (this.health_field) { diff --git a/js/display.js b/js/display.js index a45eae1..a3edcf9 100644 --- a/js/display.js +++ b/js/display.js @@ -419,7 +419,7 @@ function displayExpandedItem(item, parent_id){ } } //Show powder specials ;-; - let nonConsumables = ["relik", "wand", "bow", "spear", "dagger", "chestplate", "helmet", "leggings", "boots", "ring", "bracelet", "necklace"]; + let nonConsumables = ["relik", "wand", "bow", "spear", "dagger", "chestplate", "helmet", "leggings", "boots"];//, "ring", "bracelet", "necklace"]; if(nonConsumables.includes(item.get("type"))) { let powder_special = document.createElement("div"); powder_special.classList.add("col");