2,525
次編輯
小 (调整) |
小 (ulk测试) |
||
第52行: | 第52行: | ||
end) | end) | ||
return res | return res | ||
end | |||
local names = {'frag', 'prev', 'ptt'} | |||
local function judgeCond(type) | |||
if type == 0 then | |||
return 'frag' | |||
elseif type == 5 then | |||
return 'ptt' | |||
elseif type <= 100 and type ~= 5 then | |||
return 'prev' | |||
end | |||
end | |||
local function createRow() | |||
local res = {} | |||
for _, k in ipairs(names) do res[k] = 0 end | |||
return res | |||
end | |||
local function judgeRow(row) | |||
local res = {} | |||
for _, k in ipairs(names) do if row[k] > 0 then table.insert(res, 'ulk-' .. k) end end | |||
return #res > 0 and ('class="%s"'):format(table.concat(res, ' ')) or '' | |||
end | end | ||
第59行: | 第80行: | ||
local id, rc = chartUlk.songId, chartUlk.ratingClass + 1 | local id, rc = chartUlk.songId, chartUlk.ratingClass + 1 | ||
for _, cond in ipairs(chartUlk.conditions) do | for _, cond in ipairs(chartUlk.conditions) do | ||
local | local className = judgeCond(cond.type) | ||
if className then | if className then | ||
local row = view[id] | local row = view[id] | ||
if not row then | if not row then | ||
row = | row = createRow() | ||
view[id] = row | view[id] = row | ||
end | end | ||
第94行: | 第110行: | ||
rowText[i] = ' ' | rowText[i] = ' ' | ||
else | else | ||
rowText[i] = table.concat(cell, '<br | rowText[i] = table.concat(cell, '<br>') | ||
end | end | ||
end | end | ||
local className = judgeRow(row) | |||
local className | if id == 'lasteternity' then className = '' end | ||
if id == 'lasteternity' then className = ' | |||
table.insert(texts, { | table.insert(texts, { | ||
data = rowFormat:format(className, mLink[id], unpack(rowText)), | data = rowFormat:format(className, mLink[id], unpack(rowText)), |
次編輯