Module:Prayer: Difference between revisions

Removed functions in favour of manual tables
No edit summary
(Removed functions in favour of manual tables)
 
Line 187: Line 187:


return tostring(html)
return tostring(html)
end
function p.getBonesTable(frame)
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Bone!!Prayer Points!!Sources'
local itemArray = Items.getItems(function(item) return item.prayerPoints ~= nil and item.prayerPoints > 0 end)
table.sort(itemArray, function(a, b) return a.prayerPoints < b.prayerPoints end)
for i, item in ipairs(itemArray) do
result = result..'\r\n|-'
result = result..'\r\n|'..Icons.Icon({item.name, type='item', notext=true})
result = result..'||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})
result = result..'||style="text-align:right;"|'..Num.formatnum(item.prayerPoints)
result = result..'||'..ItemSources._getItemSources(item, false, false)
end
result = result..'\r\n|}'
return result
end
function p.getSoulsTable(frame)
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Soul!!Soul Points!!Sources'
local itemArray = Items.getItems(function(item) return item.soulPoints ~= nil and item.soulPoints > 0 end)
table.sort(itemArray, function(a, b) return a.soulPoints < b.soulPoints end)
for i, item in ipairs(itemArray) do
result = result..'\r\n|-'
result = result..'\r\n|'..Icons.Icon({item.name, type='item', notext=true})
result = result..'||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})
result = result..'||style="text-align:right;"|'..Num.formatnum(item.soulPoints)
result = result..'||'..ItemSources._getItemSources(item, false, false)
end
result = result..'\r\n|}'
return result
end
end


return p
return p
2,875

edits