Module:Sandbox

local slot = require( Module:Inventory slot ).slot local animate = require( Module:AnimateSprite ).animate local addSlot = function( args, item, prefix, class, default ) local none, nostacksize prefix = prefix or '' if #prefix == 0 then none = 'none' nostacksize = ((item ==  or nil) and ) or (args and args[item] and args[item]:gsub( '[,%d]',  ) or ) end return slot{ nostacksize or args[item], mod = args.Mod, link = none or args[prefix .. 'link'], title = none or args[prefix .. 'title'], class = class, default = default, parsed = args.parsed } end local bannerSprite = function ( args ) return animate{ args.Sprite, sheet = 'SlotSprite' } end

local p = {}

-- Loom function p.loom( f ) local args = f	if f == mw.getCurrentFrame then args = f:getParent.args else f = mw.getCurrentFrame end local body = mw.html.create( 'span' ):addClass( 'mcui mcui-Loom pixel-image' ) local tapestry = body:tag( 'span' ):addClass( 'mcui-tapestry' ) if args.Banner and #args.Banner>0 then tapestry:wikitext( addSlot( args, 'Banner', 'B', 'mcui-inputBanner' ) ) end if args.Dye and #args.Dye>0 then tapestry:wikitext( addSlot( args, 'Dye', 'D', 'mcui-inputDye' ) ) end if args.Pattern and #args.Pattern>0 then tapestry:wikitext( addSlot( args, 'Pattern', 'P', 'mcui-inputPattern' ) ) end tapestry:tag( 'span' ):tag( 'br' ):done local arrow = body:tag( 'span' ):addClass( 'mcui-loomArrow' ) if args.arrow or  ~=  then arrow:css(			'background-image',			''		) end arrow :tag( 'span' ) :addClass( 'mcui-bannerSprite' ) :wikitext( bannerSprite( args ) ) body :tag( 'span' ) :addClass( 'mcui-output' ) :wikitext( addSlot( args, 'Output', 'O', 'invslot-large' ) ) return tostring( mw.html.create( 'div' ):node( body ) ) end

return p