模块:Db:修订间差异
MJ Hamster(留言 | 贡献) 小无编辑摘要 标签:已被回退 |
MJ Hamster(留言 | 贡献) 小无编辑摘要 标签:手工回退 |
||
| 第80行: | 第80行: | ||
end | end | ||
-- 格式化单个值的私有函数 ( | -- 格式化单个值的私有函数 (不包含难度样式) | ||
local function formatSingleValue(value, fieldType) | local function formatSingleValue(value, fieldType) | ||
if value == nil then | if value == nil then | ||
| 第89行: | 第89行: | ||
return p.valueMappingMethod[fieldType](value) | return p.valueMappingMethod[fieldType](value) | ||
else | else | ||
local strValue = tostring(value) | |||
-- BPM 颜色逻辑 | |||
if fieldType == 'bpm' and string.find(strValue, '-') then | |||
return '<span style="color:red;">' .. strValue .. '</span>' | |||
end | |||
return strValue | |||
end | end | ||
end | end | ||
-- 获取难度模式 (使用哈希表检查,使用 sub 提取模式) | -- 获取难度模式 (使用哈希表检查,使用 sub 提取模式) | ||
| 第216行: | 第213行: | ||
local value = ValueFromValuesByKey(songEntry, argType) | local value = ValueFromValuesByKey(songEntry, argType) | ||
-- | -- FIX: p.value 中只进行基本的格式化,不应用难度样式 | ||
local formattedValue = formatSingleValue(value, argType) | local formattedValue = formatSingleValue(value, argType) | ||
| 第321行: | 第318行: | ||
for _, songId in ipairs(matchingKeys) do | for _, songId in ipairs(matchingKeys) do | ||
local songEntry = songData[songId] | local songEntry = songData[songId] | ||
table.insert(output, ' | table.insert(output, '|-') | ||
local rowCells = {} | local rowCells = {} | ||
| 第331行: | 第328行: | ||
local formattedValue = formatSingleValue(rawValue, field) | local formattedValue = formatSingleValue(rawValue, field) | ||
-- | -- 在 p.generateListTable 中应用自定义样式 | ||
local btn, mode = getDifficultyDetails(field) | local btn, mode = getDifficultyDetails(field) | ||
if btn and mode then | if btn and mode then | ||
| 第354行: | 第346行: | ||
end | end | ||
table.insert(output, ' | table.insert(output, '|}') | ||
return table.concat(output, '') | return table.concat(output, '\n') | ||
end | end | ||
return p | return p | ||