From 57fa608cff0495bf1dea066def9400fe2e5f6f91 Mon Sep 17 00:00:00 2001 From: reschan Date: Sun, 10 Jul 2022 10:35:06 +0700 Subject: [PATCH] fix special queries --- builder/index.html | 1 - items/index.html | 1 - js/damage_calc.js | 1 - js/sq2items.js | 9 +++++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/builder/index.html b/builder/index.html index 6dd9d65..fd299e5 100644 --- a/builder/index.html +++ b/builder/index.html @@ -1399,7 +1399,6 @@ - diff --git a/items/index.html b/items/index.html index f50a15c..183b479 100644 --- a/items/index.html +++ b/items/index.html @@ -144,7 +144,6 @@ - diff --git a/js/damage_calc.js b/js/damage_calc.js index ce4f32a..a8b0b72 100644 --- a/js/damage_calc.js +++ b/js/damage_calc.js @@ -5,7 +5,6 @@ function get_base_dps(item) { //SUPER JANK @HPP PLS FIX if (item.get("tier") !== "Crafted") { let total_damage = 0; - apply_weapon_powders(item); for (const damage_k of damage_keys) { damages = item.get(damage_k); total_damage += damages[0] + damages[1]; diff --git a/js/sq2items.js b/js/sq2items.js index 811cf0d..7e48900 100644 --- a/js/sq2items.js +++ b/js/sq2items.js @@ -53,6 +53,8 @@ document.addEventListener("DOMContentLoaded", function() { }; }); +let itemCategories = [ "armor", "accessory", "weapon" ]; + const sq2_translate_mappings = { //"Name": "name", //"Display Name": "displayName", @@ -185,6 +187,9 @@ function displayItems(items_copy) { bckgrdbox.id = "item"+i+"b"; items_parent.appendChild(box); item.set("powders", []); + if (item.get("category") == "weapon") { + apply_weapon_powders(item); + } displayExpandedItem(item, bckgrdbox.id, true); } } @@ -219,12 +224,12 @@ function doItemSearch() { for (let i = 1; i <= 4; ++i) { let raw_dat = document.getElementById("filter"+i+"-choice").value; - let filter_dat = translate_mappings[raw_dat]; + let filter_dat = sq2_translate_mappings[raw_dat]; if (filter_dat !== undefined) { queries.push(new IdQuery(filter_dat)); continue; } - filter_dat = special_mappings[raw_dat]; + filter_dat = sq2_special_mappings[raw_dat]; if (filter_dat !== undefined) { queries.push(filter_dat); continue;