|
|
第1行: |
第1行: |
| local getArgs = require('Module:Arguments').getArgs | | local getArgs = require('Module:Arguments').getArgs |
| local link = require('Module:Link')._link | | local getData = require("Module: 沙盒/盐棋/Sandbox1") |
| local p = {} | | local p = {} |
|
| |
| function GetImage(type,argv)
| |
| local container,text=mw.html.create('div'),mw.html.create('div')
| |
| local tab,part={},{}
| |
| container:addClass( 'container' )
| |
| text:attr( 'id','tab-'..type ) text:addClass( 'img-tab' )
| |
| for _,tLp in ipairs(argv) do
| |
| if tLp[2]=="" or tLp[2]==nil then
| |
| tLp[2]='未知'
| |
| else
| |
| tLp[2]=link({'画师',tostring(tLp[2])})
| |
| end
| |
| end
| |
| if argv[2]==nil then
| |
| return '<div>[[文件:'..argv[1][1]..'|256px|none]]画师:'..argv[1][2]..'</div>'
| |
| end
| |
| for iLp,tLp in ipairs(argv) do
| |
| tab[iLp]=mw.html.create('div')
| |
| tab[iLp]:wikitext(tLp[3])
| |
| tab[iLp]:addClass('img-tab-part normal')
| |
| text:wikitext(tostring(tab[iLp]))
| |
| end
| |
| container:wikitext(tostring(text))
| |
| for iLp,tLp in ipairs(argv) do
| |
| part[iLp]=mw.html.create('div')
| |
| part[iLp]:wikitext('[[文件:'..tLp[1]..'|256px|none]]画师:'..tLp[2])
| |
| part[iLp]:addClass('tab-text-'..type)
| |
| container:wikitext(tostring(part[iLp]))
| |
| end
| |
| return tostring(container)
| |
| end
| |
|
| |
|
| function p.main(frame) | | function p.main(frame) |
| local args = getArgs(frame) | | local args = getArgs(frame) |
| return p._main(args) | | return getData.GetSong(args) |
| end
| |
| | |
| function p._main(argv)
| |
| local jacket={}
| |
| for iLp=1,5 do
| |
| if argv["曲绘"..tostring(iLp)] then
| |
| jacket[iLp]={argv["曲绘"..tostring(iLp)],argv["画师"..tostring(iLp)],argv["标签"..tostring(iLp)]}
| |
| else
| |
| break
| |
| end
| |
| end
| |
| local imageTop=GetImage('a',jacket)
| |
| local imageRight=GetImage('b',jacket)
| |
| local tInfo={
| |
| [1]={
| |
| argv['曲名'],{ ['id']='title' }
| |
| },
| |
| [2]={
| |
| imageTop,{ ['id']='top-image' }
| |
| },
| |
| [3]={
| |
| imageRight,{ ['id']='right-image' }
| |
| },
| |
| [4]={
| |
| '曲目信息',{ ['class']='header' }
| |
| },
| |
| [5]={
| |
| '曲师',{ ['class']='label' }
| |
| },
| |
| [6]={
| |
| argv['曲师'],{ ['class']='data' }
| |
| },
| |
| [7]={
| |
| '曲包',{ ['class']='label' }
| |
| },
| |
| [8]={
| |
| argv['曲包'],{ ['class']='data' }
| |
| },
| |
| [9]={
| |
| '时长',{ ['class']='label' }
| |
| },
| |
| [10]={
| |
| argv['时长'],{ ['class']='data' }
| |
| },
| |
| [11]={
| |
| 'BPM',{ ['class']='label' }
| |
| },
| |
| [12]={
| |
| argv['BPM'],{ ['class']='data' }
| |
| },
| |
| [13]={
| |
| '谱面信息',{ ['id']='all-play-header' , ['class']='header' }
| |
| },
| |
| [14]={
| |
| '难度',{ ['class']='label' }
| |
| },
| |
| [15]={
| |
| '等级',{ ['class']='label' }
| |
| },
| |
| [16]={
| |
| '物量',{ ['class']='label' }
| |
| },
| |
| [17]={
| |
| '谱师',{ ['class']='label' }
| |
| },
| |
| [18]={
| |
| '定数',{ ['class']='label' }
| |
| },
| |
| [19]={
| |
| '[Past]',{ ['class']='pst-label' }
| |
| },
| |
| [20]={
| |
| argv['Past等级'],{ ['class']='pst-data' }
| |
| },
| |
| [21]={
| |
| argv['Past物量'],{ ['class']='pst-data' }
| |
| },
| |
| [22]={
| |
| argv['Past谱师'],{ ['class']='pst-data' }
| |
| },
| |
| [23]={
| |
| argv['Past定数'],{ ['class']='pst-data' }
| |
| },
| |
| [24]={
| |
| '[Present]',{ ['class']='prs-label' }
| |
| },
| |
| [25]={
| |
| argv['Present等级'],{ ['class']='prs-data' }
| |
| },
| |
| [26]={
| |
| argv['Present物量'],{ ['class']='prs-data' }
| |
| },
| |
| [27]={
| |
| argv['Present谱师'],{ ['class']='prs-data' }
| |
| },
| |
| [28]={
| |
| argv['Present定数'],{ ['class']='prs-data' }
| |
| },
| |
| [29]={
| |
| '[Future]',{ ['class']='ftr-label' }
| |
| },
| |
| [30]={
| |
| argv['Future等级'],{ ['class']='ftr-data' }
| |
| },
| |
| [31]={
| |
| argv['Future物量'],{ ['class']='ftr-data' }
| |
| },
| |
| [32]={
| |
| argv['Future谱师'],{ ['class']='ftr-data' }
| |
| },
| |
| [33]={
| |
| argv['Future定数'],{ ['class']='ftr-data' }
| |
| },
| |
| [34]={
| |
| '[Beyond]',{ ['class']='byd-label' }
| |
| },
| |
| [35]={
| |
| argv['Beyond等级'],{ ['class']='byd-data' }
| |
| },
| |
| [36]={
| |
| argv['Beyond物量'],{ ['class']='byd-data' }
| |
| },
| |
| [37]={
| |
| argv['Beyond谱师'],{ ['class']='byd-data' }
| |
| },
| |
| [38]={
| |
| argv['Beyond定数'],{ ['class']='byd-data' }
| |
| },
| |
| [39]={
| |
| '背景',{ ['class']='label' }
| |
| },
| |
| [40]={
| |
| '[[:分类:采用'..argv['背景']..'背景的曲目|'..argv['背景']..']]',{ ['class']='data' }
| |
| }
| |
| }
| |
|
| |
| local box = mw.html.create( 'div' )
| |
| box:addClass( "songbox" )
| |
| if argv['Beyond等级'] then box:addClass( "byd" ) end
| |
| box:addClass( argv['曲目侧'] )
| |
| | |
| local boxList={}
| |
| for i,_ in ipairs(tInfo) do
| |
| boxList[i] = mw.html.create( 'div' )
| |
| boxList[i]:attr( tInfo[i][2] )
| |
| boxList[i]:wikitext( tInfo[i][1] )
| |
| box:wikitext(tostring(boxList[i]))
| |
| end
| |
| end | | end |
|
| |
|
| return p | | return p |