本站文本内容除另有声明外,转载时均必须注明出处,并遵守CC BY-NC-SA 3.0协议。(转载须知)
本站是中文Minecraft Wiki的镜像站,与Mojang Studios、Weird Gloop没有从属关系。(免责声明)
全站通知:
模块:AnimateText
刷
历
编
跳到导航
跳到搜索
local p = {}
function p.animate( f )
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
delimiter = args.delimiter or args.d or ',,'
local text = {}
for row in mw.text.gsplit( args[1], '%s*' .. delimiter .. '%s*' ) do
if row == '' then
table.insert( text, '<span><br></span>' )
else
table.insert( text, '<span>' .. row .. '</span>' )
end
end
text[1] = text[1]:gsub( '^<span>', '<span class="animated-active">' )
return '<span class="animated">' .. table.concat( text ) .. '</span>'
end
return p