Module:Skills/Artisan: Difference between revisions

_getHerblorePotionTable: Fix overall potion icons
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({potion.name .. ' IV', type='item', notext=true, nolink=true}))
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]))


local tierRows = {}
for j, potionID in ipairs(potion.potionIDs) do
for j, potionID in ipairs(potion.potionIDs) do
local rowTxt = {}
local tierPot = potionItems[j]
local tierPot = Items.getItemByID(potionID)
-- 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.