Module:Packlist index:修订间差异

来自Arcaea中文维基
(cover up)
(fix)
 
(未显示另一用户的1个中间版本)
第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 packName = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate { title = "Transition.json" }).packName
for i, v in ipairs(plst) do
for i, v in ipairs(plst) do
local co = v.custom_banner and not special[v.id]
local name = packName[v.id] or v.name_localized.en
local name = v.name_localized.en
if v.pack_parent and v.id ~= 'epilogue' then
if co then name = name .. " Collaboration" end
name = p[v.pack_parent].name .. "|" .. name
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
end
p[v.id] = { idx = i, name = name }
p[v.id] = { idx = i, name = name }
end
end
p.wacca.name = "WACCA Collaboration"
return p
return p

2023年8月18日 (五) 21:52的最新版本

可在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 packName = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate { title = "Transition.json" }).packName
for i, v in ipairs(plst) do
	local name = packName[v.id] or v.name_localized.en
	if v.pack_parent and v.id ~= 'epilogue' then
		name = p[v.pack_parent].name .. "|" .. name
	end
	p[v.id] = { idx = i, name = name }
end
p.wacca.name = "WACCA Collaboration"
return p