Module:Abilities/icon: Difference between revisions

migrated icon functions to its own module
Tag: Recreated
 
m Move p.get_attr_icon to here
Line 27: Line 27:
end
end


function p._getAttrIcon(attrType)
function p.getAttrIcon(attrType)
return getAttrIcon(attrType)
return getAttrIcon(attrType)
end
end


function p.getAttrIcon(frame)
function p.getAttrIconFile(frame)
     local args = frame.args
     local args = frame.args
     local attrType = args[1]
     local attrType = args[1]
      
      
return getAttrIcon(attrType)
local attr_type = frame.args[1]
local icon = getAttrIcon(attr_type)
if icon == nil then
return ''
end
 
return string.format('[[File:%s|%s|18px|link=%s]]', icon.img or '', icon.size or '', icon.link or '')
end
end