跳转到内容
主菜单
主菜单
移至侧栏
隐藏
主菜单
首页
曲目列表
曲包列表
人物与装扮
列表
定数表
曲目列表
曲包列表
曲师列表
谱师列表
角色设定
玩法系统
新手入门
玩法机制
游戏界面
闪音会员卡
版本
版本与赛季
赛季通行证
盒蛋
Bleap战书
剧情模式
社区
待办项
讨论
更新日志
编辑规范
官方资讯
联系方式 / Contact
Bleap Wiki
搜索
搜索
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁Module:曲目列表”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
上传文件
文件列表
特殊页面
最近更改
外观
移至侧栏
隐藏
←
Module:曲目列表
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} -- 数据页: 存 JSON 原文 (json 内容模型) local DATA_TITLE = '模板:曲目列表.json' local function esc(s) -- 防御 wikitext 特殊字符 (当前数据无, 以防未来出现) return (s:gsub('|', '|')) end local function norm(s) -- 曲绘文件名规范: 空格 -> 下划线 return (s:gsub(' ', '_')) end local function langWrap(song) local lang = song['lang'] if lang == 'ja' then return '{{lang|ja|' .. esc(song['曲名']) .. '}}' elseif lang == 'zh-Hant' then return '{{lang|zh-Hant|' .. esc(song['曲名']) .. '}}' end return esc(song['曲名']) end local DIFF_CLASS = { CASUAL = 'cas', TOUGH = 'tou', INSANE = 'ins', PRO = 'pro' } local function diffsCell(diffs) if #diffs == 1 and diffs[1] == '?' then return '? ? ?' end local out = {} for _, d in ipairs(diffs) do table.insert(out, '{{难度|' .. d .. '}}') end return table.concat(out, '<br>') end local function songRow(song, suffix) local art = song['曲绘'] or '' if suffix then art = art:gsub('(' .. suffix .. ')$', '') .. '_' .. suffix end local link = esc(song['曲名']) .. (suffix and ('(' .. suffix .. ')') or '') local artist = esc(song['曲师'] or '') return '|-\n| [[File:曲绘-' .. norm(art) .. '.png|96px|link=曲目:' .. link .. ']] || [[' .. '曲目:' .. link .. '|' .. langWrap(song) .. ']] || ' .. artist .. ' || style="text-align:center" | ' .. diffsCell(song['难度']) end local function tableOpen() return '{| class="wikitable sortable" style="width:100%"\n! 曲绘 !! 曲名 !! 曲师 !! style="text-align:center" | 难度' end local function loadData() local t = mw.title.new(DATA_TITLE) if not t or not t.exists then return nil, '数据页不存在: [[' .. DATA_TITLE .. ']]' end local ok, data = pcall(mw.text.jsonDecode, t:getContent()) if not ok or type(data) ~= 'table' then return nil, '数据页 JSON 解析失败: [[' .. DATA_TITLE .. ']]' end return data end function p.render(frame) local demomode = frame and frame.args['demo'] local data, err = loadData() if not data then return '<span class="error">' .. tostring(err) .. '</span>' end local out = { tableOpen() } for _, song in ipairs(data.songs) do table.insert(out, songRow(song)) end table.insert(out, '|}') table.insert(out, '\n== 石墩子模式 ==') table.insert(out, '愚人节限定的特殊谱面,正常游玩时不会出现。石墩子模式中,会将游戏角色强行锁定为石墩子:\n') table.insert(out, tableOpen()) for _, song in ipairs(data.special) do table.insert(out, songRow(song, '石墩子模式')) end table.insert(out, '|}') if not demomode then table.insert(out, '\n[[Category:曲目]]') end -- Scribunto 返回文本中的 {{模板}} 不会被自动展开, 必须显式 preprocess return frame:preprocess(table.concat(out, '\n')) end return p
此页面嵌入的页面:
Module:曲目列表/doc
(
查看源代码
)
返回
Module:曲目列表
。
搜索
搜索
查看“︁Module:曲目列表”︁的源代码
添加话题