Module:AnimateSprite

local p = {}

function p.animate( f ) local args = f	if f == mw.getCurrentFrame then args = f:getParent.args end local icons = {} local sprite = require( 'Module:Sprite' ).sprite local sheet = args.sheet or 'InvSprite' local ids = mw.loadData( 'Module:' .. sheet ).ids local function image( icon ) local idData = ids[icon] or ids[mw.ustring.lower( icon ):gsub( '[%s%+]', '-' )] return idData and sprite({				iddata = idData,				data = sheet			}) or '' end for icon in mw.text.gsplit( args[1], '%s*;%s*' ) do icons[#icons+1] = ' ' .. (#icon > 0 and image( icon ) or ' ') .. ' '	end icons[1] = icons[1]:gsub( '^ ', ' ' ) return ' ' .. table.concat( icons ) .. ' ' end

return p