Module:Base skill

From Arknights Terra Wiki
Jump to navigation Jump to search

The Lua source code for the display of base skills through {{Base skill icon}}.


local p = {}
local data = mw.loadData('Module:Base skill/data')
local getArgs = require('Dev:Arguments').getArgs
function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end
function p._main(args)
	local display = args.display or 'default'
	local title = data[args[1] or ''] or ''
	if display == 'template' then
		return '[[File:Skill-'..title..'.png|35x35px|link=]]'
	elseif display == 'table' then
		return '[[File:Skill-'..title..'.png|35x35px|link=]]<div style="margin-top:2px;">'..(args[2] or args[1])..'</div>'
	elseif display == 'default' then
		return '<span style="display:inline-block;">[[File:Skill-'..title..'.png|20x20px|link=]]&#32;'..(args[2] or args[1])'</span>'
	end
end
return p