模块:Achievements
此模块的文档可以在模块:Achievements/doc创建
-- Module:achievements
-- Made with ♥ by User:Leranjun
local p = {}
local getArgs = require("Module:Arguments").getArgs
local generate = require("Module:achievements/single").generate
local LIST = mw.loadData("Module:achievements/list")
function p.main(frame)
local styles = frame:extensionTag("templatestyles", "", {src = "Template:成就/styles.css"})
return styles .. p._main(getArgs(frame))
end
function p._main(args)
local r = ""
local box = mw.html.create("div"):addClass("lr-achieve-box")
local set = {}
local i = 1
while (args[i]) do
set[LIST[args[i]]] = args[i]
i = i + 1
end
for i = 1, LIST[1] do
if (set[i]) then
r = r .. generate(set[i], args[set[i] .. "-time"])
end
end
r = tostring(box:node(r))
return r
end
return p