491
次編輯
(尝试自动按照官方分类生成曲目索引,效果不好就删掉) |
(怎么复制粘贴忘记改了) |
||
(未顯示同一使用者於中間所作的 1 次修訂) | |||
第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=' | 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 .. ' | 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 .. ' | list = list .. "<abbr title=' 该内容 仅 在Nintendo switch 版 上。'>" .. expand(songs[i].ns) | ||
.. '</abbr><sup class="noprint Template-Fact">[仅[[Arcaea (NS版)|NS版]]]</sup>' | |||
first=false | first=false | ||
end | end | ||
final | final['group' .. i] = categoryNames[i] | ||
final | final['list' .. i] = list | ||
end | end | ||
return final | return frame:expandTemplate{title = '曲目索引',args=final} | ||
end | end | ||
return p | return p |
次編輯