Anonymous

Module:Navboxes: Difference between revisions

From Melvor Idle
Created Familiar Navbox
mNo edit summary
(Created Familiar Navbox)
Line 9: Line 9:
local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local Items = require('Module:Items')


function p.getFarmingNavbox(frame)
function p.getFarmingNavbox(frame)
Line 194: Line 195:
   result = result..'\r\n|}'
   result = result..'\r\n|}'


  return result
end
function p.getFamiliarNavbox(frame)
  local familiars = Items.getItems(function(item) return item.type == 'Familiar' end)
  table.sort(familiars, function(a, b) return a.summoningLevel < b.summoningLevel end)
  local result = '{| class="wikitable" style="margin:auto; clear:both; width: 100%"'
  result = result..'\r\n!colspan=2|[[File:Summoning_(skill).svg|25px|link=Summoning]] [[Summoning|Summoning Familiars]]'
  local iconArray = {}
  for i, fam in Shared.skpairs(familiars) do
    table.insert(iconArray, Icons.Icon({fam.name, type='item'}))
  end
  result = result..'\r\n|-\r\n|'..table.concat(iconArray, ' • ')
  result = result..'\r\n|}'
   return result
   return result
end
end


return p
return p