Anonymous

Module:Skills: Difference between revisions

From Melvor Idle
getThievingNavbox: Order NPCs based on level requirement
m (Amend references to other modules)
(getThievingNavbox: Order NPCs based on level requirement)
Line 46: Line 46:
   table.insert(returnPart, '|-\r\n|')
   table.insert(returnPart, '|-\r\n|')
    
    
  local npcData = {}
  for i, npc in ipairs(SkillData.Thieving.NPCs) do
    table.insert(npcData, {["level"] = npc.level, ["name"] = npc.name})
  end
  table.sort(npcData, function(a, b) return a.level < b.level end)
   local npcList = {}
   local npcList = {}
   -- Create row for each NPC
   -- Create row for each NPC
   for i, npc in Shared.skpairs(SkillData.Thieving.NPCs) do
   for i, npc in ipairs(npcData) do
    --local linkText = (npc.name ~= p._getThievingNPCStat(npc, 'pageName') and p._getThievingNPCStat(npc, 'pageName') .. '|' .. npc.name) or npc.name
     table.insert(npcList, Icons.Icon({npc.name, type='thieving'}))
     table.insert(npcList, Icons.Icon({npc.name, type='thieving'}))
   end
   end