Anonymous

Module:Prayer: Difference between revisions

From Melvor Idle
getPrayerTable: Order prayers by level, in line with in-game appearance
(Substitute links with Icons.Icon() where possible to benefit from ambiguous link handling)
(getPrayerTable: Order prayers by level, in line with in-game appearance)
Line 164: Line 164:
   result = result..'\r\n!colspan="2"|Prayer!!'..Icons.Icon({"Prayer", type="skill", notext=true})..' Lvl'
   result = result..'\r\n!colspan="2"|Prayer!!'..Icons.Icon({"Prayer", type="skill", notext=true})..' Lvl'
   result = result..'!!Effects!!Point Cost'
   result = result..'!!Effects!!Point Cost'
 
  local prayerList = Shared.clone(SkillData.Prayer)
  table.sort(prayerList, function(a, b)
                          if a.prayerLevel == b.prayerLevel then
                            return a.name < b.name
                          else
                          return a.prayerLevel < b.prayerLevel
                          end
                        end)


   for i, prayer in Shared.skpairs(SkillData.Prayer) do
   for i, prayer in ipairs(prayerList) do
     result = result..'\r\n|-'
     result = result..'\r\n|-'
     result = result..'\r\n|'..Icons.Icon({prayer.name, type='prayer', notext=true, size='50'})
     result = result..'\r\n|'..Icons.Icon({prayer.name, type='prayer', notext=true, size='50'})