打开主菜单
首页
随机
登录
设置
关于Rotaeno中文维基
免责声明
搜索
查看“Module:ChartConstantDetail”的源代码
←
Module:ChartConstantDetail
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} local songlist = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Songlist.json' }) local songlistAppend = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Songlist append.json' }) local trans = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Template:Transition.json' }) function getInfList() -- 返回一个数据表。 local songlistE = {} local appendList = {} -- 记录在songlistAppend中存在的曲目,避免重复列举 local ratingClass for _,songInf in ipairs(songlistAppend["songs"]) do table.insert(songlistE,{ songInf["id"], songInf["title_localized"]["default"], songInf["difficulties"][1]["ratingReal"], songInf["difficulties"][2]["ratingReal"], songInf["difficulties"][3]["ratingReal"], songInf["difficulties"][4]["ratingReal"] }) appendList[songInf["id"]] = true end for _,songInf in ipairs(songlist["songs"]) do if songInf["difficulties"] and not(appendList[songInf["id"]]) then table.insert(songlistE,{ songInf["id"], songInf["title_localized"]["default"], songInf["difficulties"][1]["ratingReal"], songInf["difficulties"][2]["ratingReal"], songInf["difficulties"][3]["ratingReal"], songInf["difficulties"][4]["ratingReal"] }) end end return songlistE end function p.main(frame) local inf = getInfList() table.sort(inf, function(a, b) return a[6] > b[6] end) local outputTable = mw.html.create("table"):addClass("rotable"):addClass("sortable") outputTable:tag("tr"):tag("th"):wikitext("曲绘"):tag("th"):wikitext("曲目") :tag("th"):wikitext(frame:expandTemplate{ title = "Color", args = { "难度I", "难度I"} }) :tag("th"):wikitext(frame:expandTemplate{ title = "Color", args = { "难度II", "难度II"} }) :tag("th"):wikitext(frame:expandTemplate{ title = "Color", args = { "难度III", "难度III"} }) :tag("th"):wikitext(frame:expandTemplate{ title = "Color", args = { "难度IV", "难度IV"} }) for _,inf in ipairs(inf) do outputTable:tag("tr"):tag("td"):wikitext("[[File:Songs "..inf[1]..".png|40px]]") :tag("td"):wikitext("[["..inf[2].."]]") :tag("td"):wikitext(inf[3]):tag("td"):wikitext(inf[4]) :tag("td"):wikitext(inf[5]):tag("td"):wikitext(inf[6]) end return outputTable end return p
本页使用的模板:
Module:ChartConstantDetail/doc
(
查看源代码
)
返回
Module:ChartConstantDetail
。