模块:Achievements/single
< 模块:Achievements
1.38>牛腩面2022年7月4日 (一) 17:58的版本 (导入1个版本)
此模块的文档可以在模块:Achievements/single/doc创建
-- Module:achievements/single
-- Made with ♥ by User:Leranjun
local p = {}
local getArgs = require("Module:Arguments").getArgs
local generate = require("Module:achievements/core").generate
local LIST = mw.loadData("Module:achievements/data")
function p.main(frame)
local r = ""
local args = getArgs(frame)
if (args.templatestyles == "true") then
r = r .. frame:extensionTag("templatestyles", "", {src = "Template:成就/styles.css"})
end
r = r .. p.generate(args[1], args.time, frame)
return r
end
function p.generate(key, time, frame)
frame = frame or mw.getCurrentFrame()
local data = LIST[key]
if (data) then
local args = {
["img"] = frame:callParserFunction("filepath", data[1]),
["title"] = data[2],
["sub"] = data[3],
["desc"] = data[4],
["time"] = time
}
return generate(args)
else
return ""
end
end
return p