Anonymous user
Module:Inventory slot: Difference between revisions
m
no edit summary
imported>Ttv pedro270707 mNo edit summary |
imported>Ttv pedro270707 mNo edit summary |
||
| Line 26: | Line 26: | ||
local slotCss = { | local slotCss = { | ||
"display: inline-block", | |||
"width: 32px", | "width: 32px", | ||
"height: 32px", | "height: 32px", | ||
| Line 38: | Line 39: | ||
local slot = mw.html.create( "div" ) | local slot = mw.html.create( "div" ) | ||
slot:addClass( "minecraft-item" ) | slot:addClass( "minecraft-item" ) | ||
:cssText( table.concat( slotCss, ";" ) | :cssText( table.concat( slotCss, ";" ) ) | ||
:attr( "data-mctitle", name ) | :attr( "data-mctitle", name ) | ||
slot:wikitext( sprite( { data = "InvSprite", id = item } ) ) | slot:wikitext( sprite( { data = "InvSprite", id = item } ) ) | ||
| Line 48: | Line 49: | ||
slotContainer:wikitext( "<span style='" .. display .. "'>" .. "[[" .. link .. "|" .. tostring( slot ) .. "]]" .. "</span>" ) | slotContainer:wikitext( "<span style='" .. display .. "'>" .. "[[" .. link .. "|" .. tostring( slot ) .. "]]" .. "</span>" ) | ||
else | else | ||
slotContainer:wikitext( tostring( slot ) ) | slotContainer:wikitext( "<span style='" .. display .. "'>" .. tostring( slot ) .. "</span>" ) | ||
end | end | ||
end | end | ||