跳至內容

「Module:ChartConstant」:修訂間差異

增加 68 位元組 、​ 2022年8月27日 (星期六)
無編輯摘要
無編輯摘要
無編輯摘要
第15行: 第15行:
for _,diffInf in ipairs(songInf["difficulties"])
for _,diffInf in ipairs(songInf["difficulties"])
do
do
if diffInf["ratingClass"] ~= 0 or diffInf["ratingClass"] ~= 1
if diffInf["ratingClass"] ~= 0 and diffInf["ratingClass"] ~= 1
then
then
if diffInf["ratingReal"] == 2 then ratingClass = "难度III" else ratingClass = "难度IV" end
if diffInf["ratingReal"] == 2 then ratingClass = "难度III" else ratingClass = "难度IV" end
第71行: 第71行:
local listReplyB = {}
local listReplyB = {}


 
local tableC
    for s, k in pairs(listReplyA) do
    for s, k in pairs(listReplyA) do
   mw.log(s)
tableC = {}
if listReplyB[s*10] == nil then listReplyB[s*10]={} end
for _, m in pairs(k) do
for _, m in pairs(k) do
table.insert(listReplyB[s*10],mw.getCurrentFrame():expandTemplate { title = '组排单元', args = { m[2], m[1], m[3]} } )
table.insert(tableC, mw.getCurrentFrame():expandTemplate { title = '组排单元', args = { m[2], m[1], m[3]} } )
end
end
table.insert(listReplyB, {s, tableC} )
    end
    end
tableC = nil
table.sort(listReplyB, function(a, b) return a[1] > b[1] end)


local finText = "<div class='notaninfobox dstable'>\n"
local finText = "<div class='notaninfobox dstable'>\n"


for i,k in pairs(listReplyB)
for _,k in pairs(listReplyB)
do
do
finText = finText .. "<div class='ds'>"..string.format("%.1f", i/10).."</div>\n"
finText = finText .. "<div class='ds'>"..string.format("%.1f", k[1]).."</div>\n"
finText = finText .. "<div class='number'>"..mw.getCurrentFrame():expandTemplate { title = '组排列' }
finText = finText .. "<div class='number'>"..mw.getCurrentFrame():expandTemplate { title = '组排列' }
..table.concat(k)..mw.getCurrentFrame():expandTemplate { title = '组排列-end' }.."</div>\n"
..table.concat(k[2])..mw.getCurrentFrame():expandTemplate { title = '组排列-end' }.."</div>\n"
end
end