跳到内容
折叠侧栏
搜索
创建账号
个人工具
创建账号
登录
导航
首页
最近更改
随机页面
维基项目
方针
指引
讨论版
格式手册
挂起清单
版本更新列表
玩法条目
游戏玩法
界面
机制
搭档
潜力值
世界模式
故事模式
段位挑战
解歌系统
成就系统
版本更新日志
列表条目
定数表
曲目列表
曲包列表
曲师列表
谱师列表
画师列表
背景列表
友情链接
Rotaeno中文维基
工具
链入页面
相关更改
特殊页面
页面信息
查看“Module:Memory Archive”的源代码
模块
讨论
English
阅读
查看源代码
查看历史
更多
阅读
查看源代码
查看历史
←
Module:Memory Archive
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local mad = require 'Module:AnotherData' local songlist = mad.listOf 'songs' local songlistNS = mad.listOf('songs','ns') local p={} function p.main(frame) local dot=frame:expandTemplate {title ='·'} local categories = {'poprec', 'partner', 'original', 'variety', 'musicgames'} local getCategory={} for i=1,5 do getCategory[categories[i]]=i end local songs={} for i=1,5 do songs[i]={both={}, mobile={}, ns={}} end local nsId={} local mobileId={} for i,v in ipairs(songlistNS) do if v.set=='single' or mad.packQueryWrap(v.set,'ns')._parentId_=="single" then nsId[v.id]=1 end end for i,v in ipairs(songlist) do if v.set=='single' then mobileId[v.id]=1 local cate=getCategory[v.category] if nsId[v.id] then songs[cate].both[#songs[cate].both+1]=v else songs[cate].mobile[#songs[cate].mobile+1]=v end end end for i,v in ipairs(songlistNS) do if v.set=='single' or mad.packQueryWrap(v.set,'ns')._parentId_=="single" then if not mobileId[v.id] then -- 硬编码 gengaozo songs[4].ns[#songs[4].ns+1]=v end end end local categoryNames = {'流行/推荐', '搭档', '原创', '综合', '音乐游戏'} local final={ ['曲包']='[[Memory Archive]]', ['曲包封面']='[[文件:Pack single.png|75px]]', name='Memory Archive曲目索引', color='#84daff' } function expand(t) local res='' for i,v in ipairs(t) do if i~=1 then res = res .. dot end res = res .. '[[' .. mad.linkTitle(v) .. ']]' end return res end for i=1,5 do local list='' local first=true if #songs[i].both ~= 0 then if not first then list = list .. dot end list = list .. expand(songs[i].both) first=false end -- 鉴于自动展开 Template:仅 会爆炸这里手动展开 if #songs[i].mobile ~= 0 then if not first then list = list .. dot end list = list .. frame:expandTemplate{title = '仅',args={"移动版",expand(songs[i].mobile)}} first=false end if #songs[i].ns ~= 0 then if not first then list = list .. dot end list = list .. frame:expandTemplate{title = '仅',args={"NS版",expand(songs[i].ns)}} first=false end final['group' .. i] = categoryNames[i] final['list' .. i] = list end return frame:expandTemplate{title = '曲目索引',args=final} end return p
本页使用的模板:
Module:Memory Archive/doc
(
查看源代码
)
返回
Module:Memory Archive
。