Module:Items: Difference between revisions

_getOtherItemBoxText: Add links for equipment slots
(Fixed indenting)
(_getOtherItemBoxText: Add links for equipment slots)
Line 270: Line 270:
--For equipment, show the slot they go in
--For equipment, show the slot they go in
if item.validSlots ~= nil then
if item.validSlots ~= nil then
table.insert(resultPart, "\r\n|-\r\n|'''Equipment Slot:''' "..table.concat(item.validSlots, ', '))
local slotLinkMap = {
["Helmet"] = 'Equipment#Helmets',
["Platebody"] = 'Equipment#Platebodies',
["Boots"] = 'Equipment#Boots',
["Weapon"] = 'Equipment#Weapons',
["Shield"] = 'Equipment#Offhand',
["Amulet"] = 'Equipment#Amulets',
["Ring"] = 'Equipment#Rings',
["Gloves"] = 'Equipment#Gloves',
["Quiver"] = 'Equipment#Ammunition',
["Cape"] = 'Equipment#Capes',
["Passive"] = 'Combat Passive Slot',
["Summon1"] = 'Summoning',
["Summon2"] = 'Summoning'
}
local slotText = {}
for i, slot in ipairs(item.validSlots) do
local slotLink = slotLinkMap[slot]
if slotLink == nil then
table.insert(slotText, slot)
else
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
end
end
table.insert(resultPart, "\r\n|-\r\n|'''Equipment Slot:''' "..table.concat(slotText, ', '))
end
end
--For weapons with a special attack, show the details
--For weapons with a special attack, show the details