Jump to content

Module:Inventory slot: Difference between revisions

m
Added padding to remove empty space between items and removed page existence check
imported>Ttv pedro270707
mNo edit summary
imported>Ttv pedro270707
m (Added padding to remove empty space between items and removed page existence check)
Line 55: Line 55:
"width: 32px",
"width: 32px",
"height: 32px",
"height: 32px",
"position: relative"
"position: relative",
"padding: 2px"
}
}
for i, value in ipairs(p.parseString( args.item )) do
for i, value in ipairs(p.parseString( args.item )) do
Line 108: Line 109:
if subitem:match( '\.gif$' ) or subitem:match( '\.png$' ) then
if subitem:match( '\.gif$' ) or subitem:match( '\.png$' ) then
if link and mw.title.new( link ).exists then
if link then
slot:wikitext( "<span class=\"sprite pixelated\">[[File:" .. subitem .. "|160px|link=" .. link .. "]]</span>" )
slot:wikitext( "<span class=\"sprite pixelated\">[[" .. subitem .. "|160px|link=" .. link .. "]]</span>" )
else
else
slot:wikitext( "<span class=\"sprite pixelated\">[[File:" .. subitem .. "|160px|link=]]</span>" )
slot:wikitext( "<span class=\"sprite pixelated\">[[File:" .. subitem .. "|160px|link=]]</span>" )
Line 115: Line 116:
slotContainer:wikitext( tostring( slot ) )
slotContainer:wikitext( tostring( slot ) )
else
else
if link and mw.title.new( link ).exists then
if link then
slotContainer:wikitext( "<span style='" .. display .. "'>" .. "[[" .. link .. "|" .. tostring( slot ) .. "]]" .. "</span>" )
slotContainer:wikitext( "<span style='" .. display .. "'>" .. "[[" .. link .. "|" .. tostring( slot ) .. "]]" .. "</span>" )
else
else