24,691
个编辑
更改
无编辑摘要
table.insert(res_table, "style=\"width:835px;max-width:100%;line-height:18px;text-align:center;display:table;white-space:normal;\"\n")
local col_span = playable and "3" or "2" if not playable then table.insert(res_table, string.format("|-\n! colspan=\"3%s\" |'''%s'''", col_span, title)) end
for i = 1, max_pieces do
local sort_title = mw.text.trim(args["分类标题" .. i] or "")
if sort_title ~= "" then
table.insert(res_table, string.format("\n|-\n!colspan=\"3%s\" style=\"height:30px; color:black;\"|'''%s'''\n", col_span, sort_title))
end
if piece_title ~= "" then
local piece_jp = mw.text.trim(args["日文" .. i] or "")
local piece_cn = mw.text.trim(args["中文" .. i] or "")
local piece_cond piece_tc = mw.text.trim(args["条件繁中" .. i] or "") local piece_en = mw.text.trim(args["英文" .. i] or "") local piece_kr = mw.text.trim(args["韩文" .. i] or "")
local piece_file = mw.text.trim(args["语音" .. i] or "")
table.insert(res_table, string.format("\n|-\n!style=\"width:120px;%s\"|'''%s'''\n", (piece_lack_info and "color:#3F3F3F;" or ""), piece_title))
table.insert(res_table, "|style=\"text-align:left;\"|")
end
if playable then table.insert(res_table, ((piece_cond ~= "") and string.format("'''(\n|style=\"width:%s)'''</p>dpx;\"|", piece_cond) playable and 80 or "</p>"40))
end
end
end
table.insert(res_table, string.format("\n!style=\"width:%dpx;\"|", playable and 60 or 30))
if piece_file ~= "" and playable then
local piece_file_url = frame:callParserFunction{name = 'filepath:' .. piece_file}
local player_args = {icon_width = '27px', src = piece_file_url}
if playable then
local set_args = {VoiceFileLost = ""}
for i = 1, max_pieces do
local piece_file = mw.text.trim(args["语音" .. i] or "")
if piece_file ~= "" then
local piece_file_url = (path == "") and frame:callParserFunction{name = 'filepath:' .. piece_file} or (path .. piece_file)
if piece_file_url == "" then set_args["VoiceFileLost"] = set_args["VoiceFileLost"] .. piece_file .. ", " end
end
end
table.insert(res_table, frame:callParserFunction{name = '#set:', args = set_args})
local category = (string.find(frame:getParent():getTitle(), "用户:") == 1) and "用户自定义语音" or "人形语音"
category = mw.text.trim(args["类别"] or category)
table.insert(res_table, string.format("[[分类:%s]]", category))
if set_args["VoiceFileLost"] ~= "" then table.insert(res_table, string.format("[[分类:缺少语音文件的%s]]", category)) end
if lack_file then table.insert(res_table, string.format("[[分类:语音不全的%s]]", category)) end
if lack_text then table.insert(res_table, string.format("[[分类:文本不全的%s]]", category)) end