17,481
edits
No edit summary |
(_getHerblorePotionTable: Fix overall potion icons) |
||
Line 170: | Line 170: | ||
["currencies"] = potion.currencyCosts | ["currencies"] = potion.currencyCosts | ||
}, 'N/A', nil, '<br>') | }, 'N/A', nil, '<br>') | ||
-- Prefetch potion items, as these are required for the overall row | |||
-- as well as the tier rows | |||
local potionItems, lastPotionIdx = {}, 1 | |||
for j, potionID in ipairs(potion.potionIDs) do | |||
potionItems[j] = Items.getItemByID(potionID) | |||
lastPotionIdx = j | |||
end | |||
local row = html:tag('tr') | local row = html:tag('tr') | ||
row:tag('td'):wikitext(Icons.Icon({ | row:tag('td'):wikitext(Icons.Icon({potionItems[lastPotionIdx].name, type='item', notext=true, nolink=true})) | ||
:attr('rowspan', 4):wikitext('[['..potion.name..']]') | :attr('rowspan', 4):wikitext('[['..potion.name..']]') | ||
row:tag('td'):attr('rowspan', 4):wikitext(level) | row:tag('td'):attr('rowspan', 4):wikitext(level) | ||
Line 184: | Line 192: | ||
:attr('data-sort-value', Icons.getExpansionID(potion.potionIDs[1])) | :attr('data-sort-value', Icons.getExpansionID(potion.potionIDs[1])) | ||
for j, potionID in ipairs(potion.potionIDs) do | for j, potionID in ipairs(potion.potionIDs) do | ||
local tierPot = potionItems[j] | |||
local tierPot = | |||
-- First row needs to be added to the main row of the rowspan row. | -- First row needs to be added to the main row of the rowspan row. |