Bureaucrats, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, translator
2,564
edits
(oof) |
(Add single item slot) |
||
Line 100: | Line 100: | ||
countSpan:addClass("invslot-stacksize") | countSpan:addClass("invslot-stacksize") | ||
end | end | ||
return spriteDiv | |||
end | |||
p = {} | |||
-- Make a single item | |||
function p.SingleItem( f ) | |||
local args = f.args | |||
if #args == 0 then | |||
args = f:getParent().args or {""} | |||
end | |||
local sprite | |||
local image = args['image'] or args['Image'] | |||
if image then | |||
local Sprite = require([[Module:Sprite]]) | |||
sprite = Sprite.Custom:new(args[1], image) | |||
else | |||
local spriteSheet = args['spriteSheet'] or | |||
args['SpriteSheet'] | |||
if spriteSheet then | |||
sprite = Sprite | |||
:new(spriteSheet) | |||
:setItem(mw.text.trim(args[1] or "")) | |||
else | |||
sprite = require([[Module:InventorySlot]]).Decode(args[1]) | |||
end | |||
end | |||
if args['small'] or args['Small'] then | |||
sprite:SetSize(16) | |||
else | |||
sprite:SetSize(args['size'] or args['Size'] or 32) | |||
end | |||
local inline = args['inline'] or args['Inline'] | |||
local spriteDiv | |||
spriteDiv = sprite:GenerateHTML("span") | |||
spriteDiv:css("display","inline-block") | |||
spriteDiv:css("vertical-align","middle") | |||
spriteDiv:css("border-width","2px") | |||
spriteDiv:css("border-style","solid") | |||
spriteDiv:css("background-color","#67AFD0") | |||
spriteDiv:css("border-color","#1A536E #C0DEEB #C0DEEB #1A536E") | |||
return spriteDiv | return spriteDiv |
edits