Anonymous

Module:Items: Difference between revisions

From Melvor Idle
Added links and also moved quantity over
(Fixed quantity column)
(Added links and also moved quantity over)
Line 1,010: Line 1,010:
   end
   end
   result = result..'{| class="wikitable sortable"'
   result = result..'{| class="wikitable sortable"'
   result = result..'\r\n!colspan=2|Item Created!!Type!!Requirements!!XP!!Quantity!!Ingredients'
   result = result..'\r\n!colspan=2|Item Created!!Type!!Requirements!!XP!!Ingredients'
   for i, row in pairs(useArray) do
   for i, row in pairs(useArray) do
    result = result..'\r\n|-\r\n|'..Icons.Icon({row.item.name, type='item', notext=true, size=50})..'||'..row.item.name
     local qty = row.qty ~= nil and row.qty or 1
     local qty = row.qty ~= nil and row.qty or 1
    result = result..'\r\n|-\r\n|data-sort-value="'..qty..'"|'
    result = result..Icons.Icon({row.item.name, type='item', notext=true, size=50})..'||'
    if qty > 1 then result = result..qty..'x ' end
    result = result..'[['..row.item.name..']]'
     if row.skill == 'Upgrade' then
     if row.skill == 'Upgrade' then
       result = result..'||data-sort-value="Upgrade"|[[Upgrading Items|Upgrade]]'
       result = result..'||data-sort-value="Upgrade"|[[Upgrading Items|Upgrade]]'
Line 1,029: Line 1,032:
       result = result..'||data-sort-value="'..row.xp..'"|'..row.xp..' '..Icons.Icon({row.skill, type='skill', notext=true})..' XP'
       result = result..'||data-sort-value="'..row.xp..'"|'..row.xp..' '..Icons.Icon({row.skill, type='skill', notext=true})..' XP'
     end
     end
     result = result..'||'..qty..'||'
     result = result..'||'
     for i, mat in pairs(row.mats) do
     for i, mat in pairs(row.mats) do
       local matID = mat.id ~= nil and mat.id or mat[1]
       local matID = mat.id ~= nil and mat.id or mat[1]