Module:Packlist index:修订间差异
小 (cover up) |
小无编辑摘要 |
||
第1行: | 第1行: | ||
local p = { single = { idx = -100, name = "Memory Archive" } } | local p = { single = { idx = -100, name = "Memory Archive" } } | ||
local plst = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate { title = "packlist" }).packs | local plst = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate { title = "packlist.json" }).packs | ||
local special = { base = true, omatsuri = true, observer = true } | local special = { base = true, omatsuri = true, observer = true } | ||
for i, v in ipairs(plst) do | for i, v in ipairs(plst) do |
2022年10月4日 (二) 18:39的版本
可在Module:Packlist index/doc创建此模块的帮助文档
local p = { single = { idx = -100, name = "Memory Archive" } }
local plst = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate { title = "packlist.json" }).packs
local special = { base = true, omatsuri = true, observer = true }
for i, v in ipairs(plst) do
local co = v.custom_banner and not special[v.id]
local name = v.name_localized.en
if co then name = name .. " Collaboration" end
if (p[v.pack_parent or ""] or p.single).name:find " Collaboration" then
name = p[v.pack_parent].name .. "|" .. p[v.pack_parent].name .. " - " .. name
end
p[v.id] = { idx = i, name = name }
end
return p