Anonymous

Module:Navboxes: Difference between revisions

From Melvor Idle
Restore getPotionNavbox after unintended removal
m (getFoodNavbox: Padding to align header)
(Restore getPotionNavbox after unintended removal)
Line 143: Line 143:


   return table.concat(resultPart)
   return table.concat(resultPart)
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
      if potData.name == 'Bird Nests Potion' then
        table.insert(SkillPots, Icons.Icon({"Bird Nest Potion", type='item', img="Bird Nest Potion I"}))
      else
        table.insert(SkillPots, Icons.Icon({potData.name, type='item', img=(potData.name..' I')}))
      end
    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|}'
  return result
end
end