2,509
个编辑
小 (songtable) |
小 (songtable) |
||
第47行: | 第47行: | ||
end | end | ||
local function getImage(args, song) | local function getImage(args, song) | ||
local id = song | local id = song and song.id | ||
local argPic = args['图片'] or args['曲绘'] | local argPic = args['图片'] or args['曲绘'] | ||
local argArtist = args['图片'] or args['曲绘'] | local argArtist = args['图片'] or args['曲绘'] | ||
第57行: | 第57行: | ||
end | end | ||
return mw.html.create 'div' | return mw.html.create 'div' | ||
:wikitext('[[文件:', id and 'Songs ' .. id .. '.jpg' or | :wikitext('[[文件:', id and ('Songs ' .. id .. '.jpg') or argPic, '|', 256, 'px|none]]') | ||
:node(labelText '画师') | :node(labelText '画师') | ||
:wikitext(argArtist) | :wikitext(argArtist) | ||
第182行: | 第182行: | ||
local class = ({[0] = 'PST', 'PRS', 'FTR', 'BYD', 'ETR'})[diff.ratingClass] | local class = ({[0] = 'PST', 'PRS', 'FTR', 'BYD', 'ETR'})[diff.ratingClass] | ||
local function chartBasic(df, vd, s) | local function chartBasic(df, vd, s) | ||
chart['rating' .. s] = args[tag .. '等级' .. s] or (df.rating .. (df.ratingPlus and '+' or '')) | chart['rating' .. s] = args[tag .. '等级' .. s] or (df.rating .. (df.ratingPlus and '+' or '')) | ||
第195行: | 第193行: | ||
if not chart.note then notice.note = true end | if not chart.note then notice.note = true end | ||
chart.display = ('<span class="text-%s">[%s]</span>'):format(lang:lc(class), tag) | |||
addCategory(class .. chart.rating .. '级曲目') | |||
chart.designer = args[tag .. 'Note编写'] or args['note编写'] or diff.chartDesigner | chart.designer = args[tag .. 'Note编写'] or args['note编写'] or diff.chartDesigner | ||
chart.bgOverride = args[tag .. '背景'] or diff.bg | chart.bgOverride = args[tag .. '背景'] or diff.bg | ||
第244行: | 第244行: | ||
for _, tp in ipairs(merge(charts, 'bgOverride')) do | for _, tp in ipairs(merge(charts, 'bgOverride')) do | ||
local data, len = unpack(tp) | local data, len = unpack(tp) | ||
main:tag 'div':addClass(span(len)):wikitext(data and bgLinkF:format(data)) | main:tag 'div':addClass(span(len)):wikitext(data and bgLinkF:format(data, data)) | ||
end | end | ||
第279行: | 第279行: | ||
category:add '缺少参数的曲目信息模板' | category:add '缺少参数的曲目信息模板' | ||
end | end | ||
return tostring(box) .. | return tostring(box) .. noticeText .. (args['nocat'] and '' or table.concat(category)) | ||
end | end | ||
个编辑