Module:Inventory icon: Difference between revisions
From Downtime Wiki
MC>MarkusRost m Protected "Module:Inventory icon": High traffic page ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)) |
m 1 revision imported |
(No difference)
|
Latest revision as of 04:39, 25 April 2025
Documentation for this module may be created at Module:Inventory icon/doc
local p = {}
p.icon = function( f )
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
local file = args[1]
local link = args.link
local title = args.title
if file:match( '%.gif$' ) or file:match( '%.png$' ) then
file = 'Invicon ' .. file
else
file = 'Invicon ' .. file .. '.png'
end
return '[[File:' .. file .. '|32x32px|link=' .. ( link or '' ) .. '|class=pixel-image|' .. ( title or '' ) .. ']]'
end
return p