Anonymous

Module:Prayer: Difference between revisions

From Melvor Idle
Try this again without using overloads
(Undo revision 64398 by Vazkii (talk))
Tag: Undo
(Try this again without using overloads)
Line 131: Line 131:


function p.getPrayerTable(frame)
function p.getPrayerTable(frame)
return p.getPrayerTableFiltered(frame, function(prayer) return true end)
end
function p.getPrayerTableFiltered(frame, prayerPredicate)
local result = '{| class="wikitable sortable stickyHeader"'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class=headerRow-0'
result = result..'\r\n|-class=headerRow-0'
Line 136: Line 140:
result = result..'!!Effects!!Point Cost'
result = result..'!!Effects!!Point Cost'


local prayerList = p.getPrayers(function(prayer) return true end)
local prayerList = p.getPrayers(prayerPredicate)
table.sort(prayerList, function(a, b)
table.sort(prayerList, function(a, b)
if a.level == b.level then
if a.level == b.level then
48

edits