2,875
edits
(Center align level requirement) |
No edit summary |
||
Line 147: | Line 147: | ||
table.sort(potionArray, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end) | table.sort(potionArray, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end) | ||
local | local html = mw.html.create('table') | ||
:addClass('wikitable sortable stickyHeader mw-collapsible') | |||
html:tag('tr'):addClass('headerRow-0') | |||
:tag('th'):wikitext('Potion') | |||
:tag("th"):wikitext(Icons.Icon({'Herblore', type='skill', notext=true}) .. '<br>Level') | |||
:tag('th'):wikitext('XP') | |||
:tag('th'):wikitext('Ingredients') | |||
:tag('th'):wikitext('[[DLC]]') | |||
:tag('th'):wikitext('Tier') | |||
:css('width', '30px') | |||
--:tag('th'):wikitext('Value') | |||
:tag('th'):wikitext('Charges') | |||
:tag('th'):wikitext('Effect') | |||
for i, potion in ipairs(potionArray) do | for i, potion in ipairs(potionArray) do | ||
Line 160: | Line 169: | ||
["items"] = potion.itemCosts, | ["items"] = potion.itemCosts, | ||
["currencies"] = potion.currencyCosts | ["currencies"] = potion.currencyCosts | ||
}, 'N/A', nil, ' | }, 'N/A', nil, '<br>') | ||
local row = html:tag('tr') | |||
row:tag('td'):attr('rowspan', 4):wikitext('[['..potion.name..']]') | |||
row:tag('td'):attr('rowspan', 4):wikitext(level) | |||
:css('text-align', 'center') | |||
row:tag('td'):attr('rowspan', 4):wikitext(Shared.formatnum(baseXP)) | |||
:attr('data-sort-value', baseXP) | |||
:css('text-align', 'right') | |||
row:tag('td'):attr('rowspan', 4):wikitext(costText) | |||
row:tag('td'):attr('rowspan', 4):wikitext(Icons.getExpansionIcon(potion.potionIDs[1])) | |||
:css('text-align', 'center') | |||
:attr('data-sort-value', Icons.getExpansionID(potion.potionIDs[1])) | |||
local tierRows = {} | local tierRows = {} | ||
Line 173: | Line 187: | ||
local rowTxt = {} | local rowTxt = {} | ||
local tierPot = Items.getItemByID(potionID) | local tierPot = Items.getItemByID(potionID) | ||
table. | |||
-- First row needs to be added to the main row of the rowspan row. | |||
-- The other 3 need to be added to the main table as new rows. | |||
local tierRow = j == 1 and row or html:tag('tr') | |||
tierRow:tag('td'):wikitext(Icons.Icon({tierPot.name, type='item', notext=true})) | |||
:wikitext('[[' .. tierPot.name .. '|' .. tierSuffix[j] .. ']]') | |||
--tierRow:tag('td'):wikitext(Items.getValueText(tierPot)) | |||
-- :css('text-align', 'right') | |||
-- :attr('data-sort-value', tierPot.sellsFor) | |||
tierRow:tag('td'):wikitext(tierPot.charges) | |||
:css('text-align', 'right') | |||
tierRow:tag('td'):wikitext(p._getPotionDescription(tierPot)) | |||
end | end | ||
end | end | ||
return tostring(html) | |||
return | |||
end | end | ||
edits