Anonymous

Module:Skills/Artisan: Difference between revisions

From Melvor Idle
Use mw.html instead
(Update for v1.3)
(Use mw.html instead)
Line 277: Line 277:
end
end


local resultPart = {}
local html = mw.html.create('table')
table.insert(resultPart, '{| class="wikitable"')
:addClass('wikitable sortable stickyHeader')
table.insert(resultPart, '\r\n!colspan=4|[['..potionName..']]')
table.insert(resultPart, '\r\n|-\r\n!Potion!!Tier!!Charges!!Effect')
html:tag('tr')
:tag('th'):attr('colspan', 4)
  :wikitext([['..potionName..']])
:tag('tr')
:tag('th'):wikitext('Potion')
:tag('th'):wikitext('Tier')
:tag('th'):wikitext('Charges')
:tag('th'):wikitext('Effect')


for i, potionID in ipairs(recipe.potionIDs) do
for i, potionID in ipairs(recipe.potionIDs) do
Line 286: Line 293:
local potion = Items.getItemByID(potionID)
local potion = Items.getItemByID(potionID)
if potion ~= nil then
if potion ~= nil then
table.insert(resultPart, '\r\n|-')
html:tag('tr')
table.insert(resultPart, '\r\n| ' .. Icons.Icon({potion.name, type='item', notext=true, size='60'}))
    :tag('td'):wikitext(Icons.Icon({potion.name, type='item', notext=true, size='25'}))
table.insert(resultPart, '|| ' .. Icons.getExpansionIcon(potion.id) .. Icons.Icon({potion.name, tier, type='item', noicon=true}))
    :tag('td'):wikitext(Icons.getExpansionIcon(potion.id))
table.insert(resultPart, '|| ' .. potion.charges .. '|| ' .. p._getPotionDescription(potion))
          :wikitext(Icons.Icon({potion.name, tier, type='item', noicon=true}))
:tag('td'):wikitext(potion.charges)
:tag('td'):wikitext(p._getPotionDescription(potion))
end
end
end
end


table.insert(resultPart, '\r\n|}')
return tostring(html)
return table.concat(resultPart)
end
end


2,873

edits