Module:沙盒/盐棋/Sandbox2:修订间差异

添加1,360字节 、​ 2022年5月11日 (星期三)
dur
(fix)
(dur)
第8行: 第8行:


local packPrior,packName=(function ()
local packPrior,packName=(function ()
local P,N={single = math.maxinteger},{single = 'Memory Archive'}
local huge=16383
local P,N={single = huge},{single = 'Memory Archive'}
local contest={['base']=true,['observer']=true,['omatsuri']=true}
local contest={['base']=true,['observer']=true,['omatsuri']=true}
local conbine=function(rt,lf)return rt..'#'..rt..' - '..lf..'|'..rt..' - '..lf end
local conbine=function(rt,lf)return rt..'#'..rt..' - '..lf..'|'..rt..' - '..lf end
第28行: 第29行:
end
end
return P,N
return P,N
end)()
local songs=(function ()
local tmp,SS={},{}
local mbIcon,nsIcon='[[文件:Icon Smartphone.png|16px|link=曲目列表 (移动版)]]','[[文件:Icon Nintendo switch.png|16px|link=曲目列表 (Nintendo Switch版)]]'
local NS_byd_set={['tempestissimo']=true}
local display={['ifi']='#1f1e33',['aiueoon']='AI[UE]OON',['quon']='Quon (Feryquitous)',['quonwacca']='Quon (DJ Noriken)'}
for i,v in ipairs(LoadJson("songlist").songs) do
v.__plat={mbIcon}
tmp[v.id]=v
v.__title=v.name_localized.en
end
for i,v in pairs(display) do
tmp[i].__title=v
end
for i,v in ipairs(LoadJson("songlist NS").songs) do
if tmp[v.id] then
tmp[v.id].__plat[2]=nsIcon
else
v.__plat={nsIcon}
tmp[v.id]=v
v.__title=v.name_localized.en
end
end
for i,v in pairs(tmp) do
local plat,artist,rate,bpm='','','',v.bpm
local page=W.getCurrentFrame():expandTemplate{ title = ":"..v.__title }
local dur=page:match("时长=(%d:%d%d)")
if not tonumber(bpm) then
bpm='data-sort-value='..v.bpm_base..bpm
end
for j,d in v.difficulties do
rate=rate..'|'..d.rating
if d.ratingPlus then
rate=rate..'+'
end
end
if v.difficulties[4] then
if not NS_byd_set[v.id] then
rate=rate..'{{仅|移动版||图片角标}}'
end
else
rate=rate..'|/'
end
SS[i]={bpm=bpm,rate=rate,dur=dur}
end
return SS
end)()
end)()


function p.main()
function p.main()
return W.text.jsonEncode({packPrior=packPrior, packName=packName},W.text.JSON_PRETTY)
return W.text.jsonEncode({packPrior=packPrior, packName=packName, songs=songs},W.text.JSON_PRETTY)
end
end


return p
return p
2,525

个编辑