Anonymous

Module:Items: Difference between revisions

From Melvor Idle
m
slight tweak to formatting of passive header
(Fixed attack type error)
m (slight tweak to formatting of passive header)
(One intermediate revision by the same user not shown)
Line 207: Line 207:
local resultPart = {}
local resultPart = {}
--For equipment, show the slot they go in
--For equipment, show the slot they go in
local isPassive = false
if item.validSlots ~= nil then
if item.validSlots ~= nil then
local slotLinkMap = {
local slotLinkMap = {
Line 232: Line 233:
else
else
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
table.insert(slotText, '[[' .. slotLink .. '|' .. slot .. ']]')
end
if slot == 'Passive' then
isPassive = true
end
end
end
end
Line 266: Line 271:
--For items with modifiers, show what those are
--For items with modifiers, show what those are
if item.modifiers ~= nil and not Shared.tableIsEmpty(item.modifiers) then
if item.modifiers ~= nil and not Shared.tableIsEmpty(item.modifiers) then
table.insert(resultPart, "\r\n|-\r\n|'''Modifiers:'''\r\n"..Constants.getModifiersText(item.modifiers, true, false, 10))
table.insert(resultPart, "\r\n|-\r\n|'''Modifiers:'''\r\n")
if isPassive then
table.insert(resultPart, '<span style="color:green">Passive:</span><br/>')
end
table.insert(resultPart, Constants.getModifiersText(item.modifiers, true, false, 10))
end
end
return table.concat(resultPart)
return table.concat(resultPart)