Module:Prayer: Difference between revisions

Add soul points table
(Update for v1.3)
(Add soul points table)
Line 178: Line 178:
result = result..'||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})
result = result..'||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})
result = result..'||style="text-align:right;"|'..Shared.formatnum(item.prayerPoints)
result = result..'||style="text-align:right;"|'..Shared.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, size='50'})
result = result..'||' .. Icons.getExpansionIcon(item.id) .. Icons.Icon({item.name, type='item', noicon=true})
result = result..'||style="text-align:right;"|'..Shared.formatnum(item.soulPoints)
result = result..'||'..ItemSources._getItemSources(item, false, false)
result = result..'||'..ItemSources._getItemSources(item, false, false)
end
end