Module:Items: Difference between revisions

Add blocked/occupied slot
(getItemGrid: Amend to use new CSS class rather than per-cell styles)
(Add blocked/occupied slot)
 
Line 497: Line 497:
["Gem"] = "Gems_(Equipment)"
["Gem"] = "Gems_(Equipment)"
}
}
local slotText = {}
function getSlotText(slotList)
for i, slot in ipairs(item.validSlots) do
local slotText = {}
local slotLink = slotLinkMap[slot]
for i, slot in ipairs(slotList) do
if slotLink == nil then
local slotLink = slotLinkMap[slot]
table.insert(slotText, slot)
if slotLink == nil then
else
table.insert(slotText, slot)
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
else
end
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
end
if slot == 'Passive' then
isPassive = true
if slot == 'Passive' then
isPassive = true
end
end
end
return slotText
end
end
slotText = getSlotText(item.validSlots)
table.insert(resultPart, "\r\n|-\r\n|'''Equipment Slot:''' "..table.concat(slotText, ', '))
table.insert(resultPart, "\r\n|-\r\n|'''Equipment Slot:''' "..table.concat(slotText, ', '))
if item.occupiesSlots ~= nil then
slotText = getSlotText(item.occupiesSlots)
table.insert(resultPart, "\r\n|-\r\n|'''Blocked Slot:''' "..table.concat(slotText, ', '))
end
end
end
--For weapons with a special attack, show the details
--For weapons with a special attack, show the details
239

edits