941
个编辑
Economy666(讨论 | 贡献) 小无编辑摘要 |
Economy666(讨论 | 贡献) 小无编辑摘要 |
||
第69行: | 第69行: | ||
end | end | ||
function p.packLink(packName, short) | function p.packLink(packName, short, ns) | ||
-- 曲包名称转换成链接 | -- 曲包名称转换成链接 | ||
-- short | -- short | ||
-- true 简短(x Collaboration y) | -- true 简短(x Collaboration y) | ||
-- false 完整(x Collaboration - Collaboration y) | -- false 完整(x Collaboration - Collaboration y) | ||
-- ns 适用于Arcaea和Memory Archive曲包 | |||
-- true NS版曲包 | |||
-- false 移动版曲包 | |||
local discrete_pack = {['Arcaea']='曲包', ['Memory Archive']=''} | |||
-- 分离双平台页的曲包,value为后缀附加内容: '曲包'->' (xx版曲包)' ; ''->' (xx版)' | |||
local cc = 'Collaboration %- Collaboration' | local cc = 'Collaboration %- Collaboration' | ||
local ccl = 'Collaboration#Collaboration' | local ccl = 'Collaboration#Collaboration' | ||
local packLink = string.gsub(packName, cc, ccl) | local linkFlag = '' | ||
if discrete_pack[packName] then | |||
if ns then | |||
linkFlag = (' (NS版%s)'):format(discrete_pack[packName]) | |||
else | |||
linkFlag = (' (移动版%s)'):format(discrete_pack[pack_main]) | |||
end | |||
end | |||
local packLink = string.gsub(packName, cc, ccl) .. linkFlag | |||
local packDisplay | local packDisplay | ||
if short then | if short then | ||
第84行: | 第100行: | ||
packDisplay = packName | packDisplay = packName | ||
end | end | ||
local | local pack = link(packLink, packDisplay) | ||
return pack | |||
end | end | ||
function p.packLinkFrame(frame) | function p.packLinkFrame(frame) | ||
if frame then | if frame then | ||
local name = frame.args['name'] or nil | |||
local short = frame.args['short'] or nil | |||
local ns = frame.args['ns'] or nil | |||
return p.packLink(name, short, ns) | |||
else | else | ||
return '' | return 'none' | ||
end | end | ||
end | end |
个编辑