Fix item page

This commit is contained in:
hppeng 2022-07-16 20:49:06 -07:00
parent a89dd6e741
commit 01648189a8
3 changed files with 17 additions and 10 deletions

View file

@ -58,6 +58,7 @@
<script type="text/javascript" src="/js/build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="/js/icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="/js/damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="/js/powders.js"></script>
<!-- <script type="text/javascript" src="/js/powders.js"></script> --> <!-- <script type="text/javascript" src="/js/powders.js"></script> -->
<script type="text/javascript" src="/js/load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="/js/load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>

View file

@ -1877,6 +1877,7 @@ function displayIDProbabilities(parent_id, item, amp) {
parent_elem.appendChild(table_elem); parent_elem.appendChild(table_elem);
for (const [id,val] of Object.entries(itemMap.get(item_name))) { for (const [id,val] of Object.entries(itemMap.get(item_name))) {
if (rolledIDs.includes(id)) { if (rolledIDs.includes(id)) {
if (!item.get("maxRolls").get(id)) { continue; }
let min = item.get("minRolls").get(id); let min = item.get("minRolls").get(id);
let max = item.get("maxRolls").get(id); let max = item.get("maxRolls").get(id);
//Apply corkian amps //Apply corkian amps

View file

@ -20,14 +20,17 @@ function init_itempage() {
//displayExpandedItem(expandItem(itemMap.get(item_url_tag).statMap, []), "item-view"); //displayExpandedItem(expandItem(itemMap.get(item_url_tag).statMap, []), "item-view");
try{ try{
item = expandItem(itemMap.get(item_url_tag.replaceAll("%20"," ")), []); item = expandItem(itemMap.get(item_url_tag.replaceAll("%20"," ")), []);
displaysq2ExpandedItem(item, "item-view"); if (item.get('category') === 'weapon') {
displaysq2AdditionalInfo("additional-info", item); item.set('powders', []);
displaysq2IDCosts("identification-costs", item); apply_weapon_powders(item);
if (item.get("set") && sets[item.get("set")]) {
displaysq2AllSetBonuses("set-bonus-info",item.get("set"));
} }
console.log(item); displayExpandedItem(item, "item-view");
displaysq2IDProbabilities("identification-probabilities", item, amp_state); displayAdditionalInfo("additional-info", item);
displayIDCosts("identification-costs", item);
if (item.get("set") && sets[item.get("set")]) {
displayAllSetBonuses("set-bonus-info",item.get("set"));
}
displayIDProbabilities("identification-probabilities", item, amp_state);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
console.log(error.stack); console.log(error.stack);
@ -56,6 +59,8 @@ function toggleAmps(button_id) {
} }
(async function() {
load_init(init_itempage); let load_promises = [ load_init() ];
//load_ing_init(init); await Promise.all(load_promises);
init_itempage();
})();