Module:Items: Difference between revisions

Added p.getExpansionIcon
(Fixed "other" -> Equip Requirements)
(Added p.getExpansionIcon)
Line 593: Line 593:
end
end
return tostring(resultTable)
return tostring(resultTable)
end
function p._getExpansionIcon(item)
local ns, _ = GameData.getLocalID(item.id)
if ns == 'melvorTotH' then
return Icons.TotH()..' '
else
return ''
end
end
--Returns the expansion icon for the item if it has one
function p.getExpansionIcon(frame)
local itemName = frame.args ~= nil and frame.args[1] or frame
local item = p.getItem(itemName)
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
end
return p._getExpansionIcon(item)
end
end


return p
return p