Anonymous

Module:Skills: Difference between revisions

From Melvor Idle
Added getPotionNavbox
(typo fixing)
(Added getPotionNavbox)
Line 131: Line 131:
   end
   end


  result = result..'\r\n|}'
  return result
end
function p.getPotionNavbox(frame)
  --•
  local result = '{| class="wikitable" style="margin:auto; clear:both; width: 100%"'
  result = result..'\r\n!colspan=2|'..Icons.Icon({'Herblore', 'Potions', type='skill'})
  local CombatPots = {}
  local SkillPots = {}
  for i, potData in Shared.skpairs(SkillData.Herblore.ItemData) do
    if potData.category == 0 then
      table.insert(CombatPots, Icons.Icon({potData.name, type='item', img=(potData.name..' I')}))
    else
      table.insert(SkillPots, Icons.Icon({potData.name, type='item', img=(potData.name..' I')}))
    end
  end
  result = result..'\r\n|-\r\n!Combat Potions\r\n|class="center" style="vertical-align:middle;"'
  result = result..'|'..table.concat(CombatPots, ' • ')
  result = result..'\r\n|-\r\n!Skill Potions\r\n|class="center" style="vertical-align:middle;"'
  result = result..'|'..table.concat(SkillPots, ' • ')
   result = result..'\r\n|}'
   result = result..'\r\n|}'
   return result
   return result