Anonymous

Module:Sandbox/AuronTest: Difference between revisions

From Melvor Idle
_getItemCategories: Generate categories for equipment slots other than passive
(_getOtherItemBoxText: Correct equipment slot code)
(_getItemCategories: Generate categories for equipment slots other than passive)
Line 331: Line 331:
   if item.tier ~= nil then result = result..'[[Category:'..Shared.titleCase(item.tier)..' '..item.type..']]' end
   if item.tier ~= nil then result = result..'[[Category:'..Shared.titleCase(item.tier)..' '..item.type..']]' end
   if item.hasSpecialAttack then result = result..'[[Category:Items With Special Attacks]]' end
   if item.hasSpecialAttack then result = result..'[[Category:Items With Special Attacks]]' end
   if item.validSlots ~= nil and Shared.contains(item.validSlots, 'Passive') then result = result..'[[Category:Passive Items]]' end
   if item.validSlots ~= nil then
    local slotRemap = {
      ['Passive'] = 'Passive Items',
      ['Summon1'] = 'Summoning Familiars',
      ['Summon2'] = ''
    }
    for i, slotName in ipairs(item.validSlots) do
      local slotRemapName = slotName
      if slotRemap[slotName] ~= nil then slotRemapName = slotRemap[slotName] end
      if slotRemapName ~= '' then result = result .. '[[Category:' .. slotRemapName .. ']]' end
    end
  end
   if item.modifiers ~= nil then
   if item.modifiers ~= nil then
     local modsDL = {
     local modsDL = {