Module:Inventory slot: Difference between revisions

m
no edit summary
imported>Ttv pedro270707
m (Added the in-game item which is air)
imported>Ttv pedro270707
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 49: Line 49:
local slotContainer = mw.html.create( "div" )
local slotContainer = mw.html.create( "div" )
slotContainer:addClass( "inventory-slot" )
slotContainer:addClass( "inventory-slot" )
:addClass( "animated" )
:cssText( table.concat( slotContainerCss, ";" ) )
:cssText( table.concat( slotContainerCss, ";" ) )
Line 114: Line 115:
-- Use an image if the item ends in .gif or .png
-- Use an image if the item ends in .gif or .png
if subitem:match( '\.gif$' ) or subitem:match( '\.png$' ) then
if subitem:match( '\.gif$' ) or subitem:match( '\.png$' ) then
if link then
slot:wikitext( "<span class=\"sprite pixelated\" style=\"width: 32px; height: 32px;\">[[File:" .. subitem .. "|160px|link=" .. (link or "") .. "]]</span>" )
slot:wikitext( "<span class=\"sprite pixelated\">[[File:" .. subitem .. "|160px|link=" .. link .. "]]</span>" )
else
slot:wikitext( "<span class=\"sprite pixelated\">[[File:" .. subitem .. "|160px|link=]]</span>" )
end
slotContainer:wikitext( tostring( slot ) )
slotContainer:wikitext( tostring( slot ) )
else
else