941
个编辑
Economy666(讨论 | 贡献) 小无编辑摘要 |
Economy666(讨论 | 贡献) 小无编辑摘要 |
||
第255行: | 第255行: | ||
end | end | ||
function p.main(frame) | function p.main(frame) | ||
第353行: | 第334行: | ||
local function cateText(cate, titelStr) | local function cateText(cate, titelStr) | ||
local theText = '' | local theText = '' | ||
local sectionCode = {unknown = 100, free = 1, archive = 2, mainstory = 3, sidestory = 4, collab = 5, single = 6} | |||
function sort_fun(a, b) | |||
a, b = a.sort, b.sort | |||
for i = 1, 3 do | |||
local d = a[i] - b[i] | |||
if d ~= 0 then return d < 0 end | |||
end | |||
return a[4]<b[4] | |||
end | |||
local function getSongSort(songs) | |||
local songSort = {} | |||
for songid, diff in pairs(songs) do | |||
local packItem = mad.packQueryWrap(queryMO(songid, 'set'), 'mobile') | |||
local sortLevel = ratingSort(queryMO(songid, 'ftrRating') or 0) | |||
table.insert(songSort, { | |||
id=songid, | |||
sort={ | |||
sectionCode[packItem['section']], | |||
packItem['numero'] or Args[songid..'.sortNum'] or 0, | |||
sortLevel, | |||
songid | |||
}}) | |||
end | |||
table.sort(songSort, sort_fun) | |||
return songSort | |||
end | |||
local function writeText(designer, songs) | local function writeText(designer, songs) | ||
local songSort = getSongSort(songs) | local songSort = getSongSort(songs) |
个编辑