2,544
次編輯
(TODO: 难度不同曲绘不同) |
小無編輯摘要 |
||
第12行: | 第12行: | ||
local function itData(datas, cc) | local function itData(datas, cc) | ||
cc = cc or | cc = cc or maxCut | ||
cc = cc - .1 | |||
local id = ('%.1f'):format(cc) | local id = ('%.1f'):format(cc) | ||
local data = datas[id] | local data = datas[id] | ||
第26行: | 第25行: | ||
local divide_str = ('%.1f'):format(divide) | local divide_str = ('%.1f'):format(divide) | ||
for _, song in ipairs(mad.listOf 'songs') do | for _, song in ipairs(mad.listOf 'songs') do | ||
if not song.deleted then | if not song.deleted then | ||
local id, titleBase, dateBase = song.id, song.title_localized, song.date | |||
local songCc = songCcs[id] or {} | |||
local link = mad.linkName(song) or titleBase.en | |||
for _, chart in ipairs {}, song.difficulties, 1 do | for _, chart in ipairs {}, song.difficulties, 1 do | ||
local rc = chart.ratingClass + 1 | local rc = chart.ratingClass + 1 | ||
第37行: | 第36行: | ||
if not chartCc or chartCc.old ~= false then break end | if not chartCc or chartCc.old ~= false then break end | ||
local nCc = chartCc.constant | local nCc = chartCc.constant | ||
if nCc < 8 then break end | if nCc < 8 or nCc >= maxCut then break end | ||
local title, date = | local title, date = chart.title_localized or titleBase, chart.date or dateBase | ||
local | local rowId = ('%.1f'):format(nCc) | ||
local rowData = datas[rowId] | local rowData = datas[rowId] | ||
if not rowData then | if not rowData then | ||
第53行: | 第46行: | ||
end | end | ||
if | if true then | ||
table.insert(rowData, { | table.insert(rowData, { | ||
-- TODO: 难度不同曲绘不同 | -- TODO: 难度不同曲绘不同 | ||
data = { title, id, ({'pst', 'prs', 'ftr', 'byd', 'etr'})[rc], link = link, | data = { title.en, id, ({ 'pst', 'prs', 'ftr', 'byd', 'etr' })[rc], link = link, override = chart.jacketOverride }, | ||
sort = {nCc, rc, date} | sort = { nCc, rc, date } | ||
}) | }) | ||
end | end | ||
第69行: | 第62行: | ||
for _, rowId, rowData in itData, datas do | for _, rowId, rowData in itData, datas do | ||
-- 不显示最高位 | -- 不显示最高位 | ||
if rowId ~= divide_str | if rowId ~= divide_str | ||
then | then | ||
-- if rowId==divide_str then rowId=('%s+'):format(divide_str) end | -- if rowId==divide_str then rowId=('%s+'):format(divide_str) end | ||
text = text | text = text | ||
-- :tag 'div':addClass 'ds':wikitext(rowId):done() | -- :tag 'div':addClass 'ds':wikitext(rowId):done() | ||
-- :tag 'div':addClass 'number' | -- :tag 'div':addClass 'number' | ||
:wikitext(frame:expandTemplate {title = '定数表组排列', | :wikitext(frame:expandTemplate { title = '定数表组排列', args = { math.floor(rowId) } }) | ||
:wikitext(frame:expandTemplate {title = '定数表组排-first', args = { math.floor(rowId), (rowId - math.floor(rowId))*10 }}) | :wikitext(frame:expandTemplate { title = '定数表组排-first', args = { math.floor(rowId), (rowId - math.floor(rowId)) * 10 } }) | ||
table.sort(rowData, function(a, b) | table.sort(rowData, function(a, b) | ||
a, b = a.sort, b.sort | a, b = a.sort, b.sort | ||
第84行: | 第77行: | ||
end) | end) | ||
for _, rowItem in ipairs(rowData) do | for _, rowItem in ipairs(rowData) do | ||
text:wikitext(frame:expandTemplate {title = '定数表组排单元', args = rowItem.data}) | text:wikitext(frame:expandTemplate { title = '定数表组排单元', args = rowItem.data }) | ||
end | end | ||
text = text:wikitext(frame:expandTemplate {title = '定数表组排列-end'}):done() | text = text:wikitext(frame:expandTemplate { title = '定数表组排列-end' }):done() | ||
end | end | ||
end | end | ||
第102行: | 第94行: | ||
local songCc = songCcs[id] or {} | local songCc = songCcs[id] or {} | ||
-- | -- | ||
local data = {mad.linkTitle(song)} | local data = { mad.linkTitle(song) } | ||
local sort = {0, song.date} | local sort = { 0, song.date } | ||
table.insert(datas, {data = data, sort = sort}) | table.insert(datas, { data = data, sort = sort }) | ||
for _, chart in ipairs(song.difficulties) do | for _, chart in ipairs(song.difficulties) do | ||
local rc = chart.ratingClass + 1 | local rc = chart.ratingClass + 1 | ||
第113行: | 第105行: | ||
if not chart.date then sort[1] = nCc end | if not chart.date then sort[1] = nCc end | ||
local sCc = ('%.1f'):format(nCc) | local sCc = ('%.1f'):format(nCc) | ||
data[rc + 1] = chartCc.old ~= false and tostring(mw.html.create 'span':addClass 'old-constant':wikitext(sCc)) or sCc | data[rc + 1] = chartCc.old ~= false and | ||
tostring(mw.html.create 'span':addClass 'old-constant':wikitext(sCc)) or sCc | |||
until (true) | until (true) | ||
end | end |
次編輯