Module:Sandbox

local p = {}

local moduleSprite = Module:Sprite local moduleInvData = Module:SlotSprite

local sprite = require( moduleSprite ).sprite local ids = mw.loadData( moduleInvData ).ids

function p.animate( f ) local args = f	if f == mw.getCurrentFrame then args = f:getParent.args end local icons = {} local icon local image for icon in mw.text.gsplit( args[1], '%s*;%s*' ) do		if icon == '' then table.insert( icons, '  ' ) else table.insert( icons, ' ' .. image .. ' ' ) end end icons[1] = icons[1]:gsub( '^ ', ' ' ) return ' ' .. table.concat( icons ) .. ' ' end

function p.image( icon ) local args = icon if icon == mw.getCurrentFrame then args = icon:getParent.args end local idData = ids[args[1]] if idData then image = sprite{ iddata = idData, data = args.sheet }	end

return image end

return p