跳到内容

Module:Memory Archive:修订间差异

添加384字节 、​ 2024年6月27日 (星期四)
展开nowiki会爆炸太不行了
(尝试自动按照官方分类生成曲目索引,效果不好就删掉)
 
(展开nowiki会爆炸太不行了)
第3行: 第3行:
local songlistNS = mad.listOf('songs','ns')
local songlistNS = mad.listOf('songs','ns')


local dot='{{ ·}}'
local frame = mw.getCurrentFrame()
local dot=frame:expandTemplate {title ='·'}
function expand(t)
function expand(t)
local res=''
local res=''
第56行: 第57行:
local categoryNames = {'流行/推荐', '搭档', '原创', '综合', '音乐游戏'}
local categoryNames = {'流行/推荐', '搭档', '原创', '综合', '音乐游戏'}
local final='{{曲目索引| 曲包=[[Memory Archive]]| 曲包封面=[[文件:Pack single.png|75px]]|name=Memory Archive曲目索引|color=#84daff'
local final={
['曲包']='[[Memory Archive]]',
[' 曲包封面']='[[文件:Pack single.png|75px]]',
name='Memory Archive曲目索引',
color='#84daff'
}
for i=1,5 do
for i=1,5 do
local list=''
local list=''
第65行: 第71行:
first=false
first=false
end
end
-- 鉴于自动展开 Template:仅 会爆炸这里手动展开
if #songs[i].mobile ~= 0 then
if #songs[i].mobile ~= 0 then
if not first then list = list .. dot end
if not first then list = list .. dot end
list = list .. '{{ | 移动版|' .. expand(songs[i].mobile) .. '}}'
list = list .. "<abbr title=' 该内容 移动版 上。'>" .. expand(songs[i].mobile)
.. '</abbr><sup class="noprint Template-Fact">[仅[[Arcaea (移动版)|移动版]]]</sup>'
first=false
first=false
end
end
if #songs[i].ns ~= 0 then
if #songs[i].ns ~= 0 then
if not first then list = list .. dot end
if not first then list = list .. dot end
list = list .. '{{ |NS |' .. expand(songs[i].ns) .. '}}'
list = list .. "<abbr title=' 该内容 在Nintendo switch 上。'>" .. expand(songs[i].mobile)
.. '</abbr><sup class="noprint Template-Fact">[仅[[Arcaea (NS版)|NS版]]]</sup>'
first=false
first=false
end
end
final = final .. '|group' .. i .. '=' .. categoryNames[i]
final['group' .. i] = categoryNames[i]
final = final .. '|list' .. i .. '=' .. list
final['list' .. i] = list
end
end
return final .. '}}'
return frame:expandTemplate{title = '曲目索引',args=final}
end
end
return p
return p
478

个编辑