1,386
个编辑
小 (copy Module:Partnertable) |
小 (试添加旧图片机制(我不会写lua SOS)) |
||
第41行: | 第41行: | ||
end | end | ||
function getImage( | function getImage(args, hasawaken, hasold, type) | ||
local container = mw.html.create 'div':addClass 'container' | local container = mw.html.create 'div':addClass 'container' | ||
local | local imageNormal = args['图片'] | ||
local jacketNormal = args['画师'] | |||
if hasawaken or hasold then | |||
-- tab | |||
container | |||
:tag 'div':addClass 'img-tab':attr('id', 'tab-' .. type) | :tag 'div':addClass 'img-tab':attr('id', 'tab-' .. type) | ||
:tag 'div':wikitext 'Normal':addClass 'img-tab-part normal active':done() | :tag 'div':wikitext 'Normal':addClass 'img-tab-part normal active':done() | ||
:tag 'div':wikitext 'Awaken':addClass 'img-tab-part awaken':done() | if hasold then | ||
local imageOld = args['旧图片'] or args['图片'] | |||
local jacketOld = args['旧画师'] or args['画师'] | |||
container:tag 'div':wikitext 'Old':addClass 'img-tab-part old':done() | |||
end | |||
if hasawaken then | |||
local imageAwaken = args['觉醒图片'] or args['图片'] | |||
local jacketAwaken = args['觉醒画师'] or args['画师'] | |||
container:tag 'div':wikitext 'Awaken':addClass 'img-tab-part awaken':done() | |||
end | |||
-- part | |||
container:tag 'div':wikitext('[[文件:', imageNormal, '|300px|none]]'):node(labelText '画师'):wikitext(tostring(jacketNormal)):addClass('active tab-text-' .. type):done() | |||
if hasold then container:tag 'div':wikitext('[[文件:', imageOld, '|300px|none]]'):node(labelText '画师'):wikitext(tostring(jacketOld)):addClass('tab-text-' .. type):done() end | |||
if hasawaken then container:tag 'div':wikitext('[[文件:', imageAwaken, '|300px|none]]'):node(labelText '画师'):wikitext(tostring(jacketAwaken)):addClass('tab-text-' .. type):done() end | |||
else | else | ||
container | container | ||
:tag 'div':wikitext('[[文件:', | :tag 'div':wikitext('[[文件:', imageNormal, '|300px]]'):done() | ||
:tag 'div':node(labelText '画师'):wikitext( | :tag 'div':node(labelText '画师'):wikitext(jacketNormal):done() | ||
end | end | ||
return container | return container | ||
第67行: | 第78行: | ||
function p._main(args) | function p._main(args) | ||
local awaken | local old --旧图片判定 | ||
local size | local awaken --觉醒判定 | ||
local belongs | local size --图片大小 | ||
local belongs --所属单位 | |||
local skillawaken --觉醒技能 | local skillawaken --觉醒技能 | ||
local skillsec --第二技能 | local skillsec --第二技能 | ||
if args['旧图片'] then old = true else old = false end | |||
if args['觉醒形态'] == '有' then awaken = true else awaken = false end | if args['觉醒形态'] == '有' then awaken = true else awaken = false end | ||
if awaken and args['技能'] ~= args['觉醒技能'] and args['觉醒技能'] ~= nil then skillawaken = true else skillawaken = false end | if awaken and args['技能'] ~= args['觉醒技能'] and args['觉醒技能'] ~= nil then skillawaken = true else skillawaken = false end | ||
第82行: | 第95行: | ||
belongs = '所属单曲/曲包' | belongs = '所属单曲/曲包' | ||
end | end | ||
local imageA = getImage(args | local imageA = getImage(args, awaken, old, 'a') | ||
local | local imageA = getImage(args, awaken, old, 'b') | ||
local infoList = { | local infoList = { | ||
[1] = {title(args['名称'], args['第二名称']), {id = 'title'}}, | [1] = {title(args['名称'], args['第二名称']), {id = 'title'}}, | ||
第165行: | 第178行: | ||
end | end | ||
--分类添加 | --手动关闭 | ||
if args['nocat'] then | |||
category = '' | |||
else | |||
--分类添加 | |||
local category = mw.html.create() | |||
--平台 | |||
local plat | |||
if args['更新时间NS'] then | |||
if args['更新时间'] then | |||
plat = '双平台' | |||
else | |||
plat = 'NS版' | |||
end | |||
else | else | ||
plat = ' | plat = ' 移动 版' | ||
end | end | ||
category:wikitext('[[分类:', plat, '搭档]]') | |||
--觉醒 | |||
category:wikitext('[[分类:', awaken and '有' or '没有', '觉醒形态的', '搭档]]') | |||
--类型 | |||
local type = args['类型'] or '平衡型' | |||
local typeSet = {['支援型'] = true, ['平衡型'] = true, ['挑战型'] = true,} | |||
category:wikitext('[[分类:', typeSet[type] and type or '特殊类型', '搭档]]') | |||
-- ???/创世型; ???/探索者; ??? | |||
--种类 | |||
local cMap = {['限时'] = '限时活动', ['特殊'] = '获取方式特殊的', ['专辑'] = 'Arcaea原声专辑特典',} | |||
for c in mw.text.gsplit(args['种类'], '/', true) do | |||
if c ~= '原创' then | |||
category:wikitext('[[分类:', cMap[c] or c, '搭档]]') | |||
end | |||
end | end | ||
--版本 | |||
if args['更新时间'] then | |||
category:wikitext('[[分类:', lang:ucfirst(version(args['更新时间'])), '添加的', '搭档]]') | category:wikitext('[[分类:', lang:ucfirst(version(args['更新时间'])), '添加的', '搭档]]') | ||
end | |||
if awaken then | |||
category:wikitext('[[分类:', lang:ucfirst(version(args[' 觉醒 更新时间'] or args['更新时间'])), '添加觉醒形态的', '搭档]]') | |||
end | |||
if args['更新时间NS'] then | |||
category:wikitext('[[分类:', 'NS ', lang:ucfirst(version(args['更新时间NS'])), '添加的', '搭档]]') | |||
end | |||
end | end | ||
return tostring(box) .. tostring(category) | return tostring(box) .. tostring(category) |
个编辑