打开主菜单

少前百科GFwiki β

更改

模块:VoiceTable

添加1,306字节2022年1月27日 (四) 02:13
无编辑摘要
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;\"|")
if playable and piece_jp ~= "" and piece_cn ~= "" then table.insert(res_table, "<p class=\"voiceTextJP\" lang=\"ja\" style=\"margin:5px;margin-bottom:10px;\">" .. piece_jp .. "</p>") end if piece_cn ~= "" then table.insert(res_table, "<p class=\"voiceTextCN\" lang=\"zh\" style=\"margin:5px;\">" .. piece_cn.. "</p>") elseif piece_cn end if piece_tc ~= "" then table.insert(res_table, "<p class=\"voiceTextTC\" lang=\"zh\" style=\"margin:5px; display:none;\">" .. piece_cnpiece_tc .. "</p>") end if piece_en ~= "" then table.insert(res_table, "<p class=\"voiceTextEN\" lang=\"en\" style=\"margin:5px; display:none;\">" .. piece_en .. "</p>") else end if piece_kr ~= "" then table.insert(res_table, "<p class=\"voiceTextKR\" lang=\"jako\" style=\"margin:5px; display:none;\">" .. piece_jppiece_kr .. "</p>")
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))
table.insert(res_table, string.format("\n|style=\"width:%dpx;\"|", playable and 80 or 40)) if piece_file ~= "" and playable then if piece_file == "-" then table.insert(res_table, "—") else local piece_file_url = (path == "") and frame:callParserFunction{name = 'filepath:' .. piece_file} or (path .. piece_file) local player_args = {icon_width = '36px', src = piece_file_url} if piece_file_url == "" then player_args["download_style"] = "display:none;" player_args["play_style"] = "display:none;" end if not playable then player_args["play_styledownload_style"] = "display:none;"end table.insert(res_table, frame:callParserFunction{name = '#Widget:MiniAudioPlayer', args = player_args})
end
if not playable then player_args["download_style"] = "display:none;" end
table.insert(res_table, frame:callParserFunction{name = '#Widget:MiniAudioPlayer', args = player_args})
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
24,691
个编辑