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 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 local css = '' if ( args.Banner and #args.Banner>0 ) and ( args.Dye and #args.Dye>0 ) then css = 'margin-top', '60px' end local inputPattern = tapestry:tag( 'span' ):addClass( 'mcui-inputPattern' ):css( css ) inputPattern:wikitext( addSlot( args, 'Pattern', 'P' ) ) 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 local sprite = args.Sprite local bannerSprite if sprite and #sprite>0 then bannerSprite = animate{ args.Sprite, sheet = 'SlotSprite' }	else bannerSprite = ' ' end arrow :tag( 'span' ) :addClass( 'mcui-bannerSprite' ) :wikitext( bannerSprite ) body :tag( 'span' ) :addClass( 'mcui-output' ) :wikitext( addSlot( args, 'Output', 'O', 'invslot-large' ) ) return tostring( mw.html.create( 'div' ):node( body ) ) end

return p