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 14: | Line 14: | ||
local height = args.height or 32 | local height = args.height or 32 | ||
local item = args.item | local item = args.item | ||
local pageName = mw.title.getCurrentTitle().text | local pageName = mw.title.getCurrentTitle().text | ||
Line 36: | Line 35: | ||
local name = value.name | local name = value.name | ||
local item = value.item | local item = value.item | ||
local link = nil | |||
local slot = mw.html.create( "div" ) | local slot = mw.html.create( "div" ) | ||
slot:addClass( "minecraft-item" ) | slot:addClass( "minecraft-item" ) | ||
Line 41: | Line 41: | ||
:attr( "data-mctitle", name ) | :attr( "data-mctitle", name ) | ||
slot:wikitext( sprite( { data = "InvSprite", id = item } ) ) | slot:wikitext( sprite( { data = "InvSprite", id = item } ) ) | ||
slotContainer: | if item ~= pageName and item then | ||
link = item | |||
end | |||
if link then | |||
slotContainer:wikitext( "[[" .. link .. "|" .. tostring( slot ) .. "]]" ) | |||
else | |||
slotContainer:wikitext( tostring( slot ) ) | |||
end | |||
end | end | ||