Content added Content deleted
(add song id field) |
(converted to using new infobox builder) |
||
Line 1: | Line 1: | ||
-------------------------- |
-------------------------- |
||
-- Module for [[Template:Infobox |
-- Module for [[Template:Infobox song]] |
||
------------------------ |
------------------------ |
||
local getArgs = require('Module:Arguments').getArgs |
local getArgs = require('Module:Arguments').getArgs |
||
local yesno = require('Module:Yesno') |
local yesno = require('Module:Yesno') |
||
local builder = require('Module:InfoboxBuilder') |
local builder = require('Module:InfoboxBuilder new') |
||
local constants = require('Module:Constants') |
local constants = require('Module:Constants') |
||
local utils = require('Module:Utilities') |
local utils = require('Module:Utilities') |
||
local VariablesLua = mw.ext.VariablesLua |
|||
local p = {} |
local p = {} |
||
local categories = "" |
|||
local function |
local function convertToBoolOrNil(val) |
||
return |
return yesno(val, nil) |
||
end |
end |
||
local function formatUnit(unit_name) |
|||
local function formatJacket(jacket) |
|||
local unit = constants.get_unit(unit_name) |
|||
return string.format("[[File:%s|220px]]", jacket) |
|||
local unit_image = constants.get_unit_image(unit) |
|||
if unit and unit_image then |
|||
return string.format( |
|||
"[[File:%s|150px|link=%s]]", |
|||
unit_image, |
|||
unit |
|||
) |
|||
end |
|||
return nil |
|||
end |
end |
||
local function |
local function formatList(list) |
||
if |
if #list < 2 then |
||
return list[1] |
|||
local split_units = mw.text.split(units, ',') |
|||
for i,v in ipairs(split_units) do |
|||
split_units[i] = constants.get_unit(mw.text.trim(v)) |
|||
end |
|||
return table.concat(split_units, "<br>") |
|||
end |
end |
||
local ul = mw.html.create('ul') |
|||
return nil |
|||
for i=1,#list do |
|||
ul:tag('li') |
|||
:wikitext(list[i]) |
|||
end |
|||
return tostring(ul) |
|||
end |
end |
||
local function |
local function formatCommissioned(comm) |
||
-- probably should not use == with bool, but this is more explicit |
|||
if names then |
|||
if comm == true then |
|||
local split_names = utils.split(names, ",") |
|||
return 'Yes' |
|||
for i,v in ipairs(split_names) do |
|||
elseif comm == false then |
|||
split_names[i] = v:match( "^%s*(.-)%s*$" ) |
|||
return 'No' |
|||
end |
|||
return table.concat(split_names, "<br>") |
|||
end |
end |
||
Line 57: | Line 47: | ||
local function formatMv(mv) |
local function formatMv(mv) |
||
local val = yesno(mv, nil) |
|||
-- probably should not use == with bool, but this is more explicit |
-- probably should not use == with bool, but this is more explicit |
||
if |
if mv == true then |
||
return '✓' |
return '✓' |
||
elseif |
elseif mv == false then |
||
return '✗' |
return '✗' |
||
end |
end |
||
Line 68: | Line 57: | ||
end |
end |
||
local function |
local function getMvClass(mv) |
||
local val = yesno(mv, nil) |
|||
-- probably should not use == with bool, but this is more explicit |
-- probably should not use == with bool, but this is more explicit |
||
if |
if mv == true then |
||
return { |
|||
['background-color'] = 'lightgreen', |
|||
['font-weight'] = 'bold' |
|||
} |
|||
elseif val == false then |
|||
return { |
|||
['background-color'] = 'pink', |
|||
['font-weight'] = 'bold' |
|||
} |
|||
end |
|||
return nil |
|||
end |
|||
local function getMvClass(mv) |
|||
local val = yesno(mv, nil) |
|||
if val == true then |
|||
return 'true-cell' |
return 'true-cell' |
||
elseif |
elseif mv == false then |
||
return 'false-cell' |
return 'false-cell' |
||
end |
|||
return nil |
|||
end |
|||
local function formatCommissioned(comm) |
|||
local val = yesno(comm, nil) |
|||
if val == true then |
|||
return 'Yes' |
|||
elseif val == false then |
|||
return 'No' |
|||
end |
end |
||
Line 128: | Line 88: | ||
function p.main(frame) |
function p.main(frame) |
||
local args = getArgs(frame |
local args = getArgs(frame) |
||
local infobox = builder.new(); |
local infobox = builder.new(); |
||
infobox:setName('Infobox song') |
infobox:setName('Infobox song') |
||
:setWidth("330px") |
|||
:setParams{ |
:setParams{ |
||
{ name = 'song id' }, |
{ name = 'song id' }, |
||
{ name = 'song name', default = mw.title.getCurrentTitle().text }, |
{ name = 'song name', default = mw.title.getCurrentTitle().text }, |
||
{ name = ' |
{ name = 'jacket', dFunc = formatJacket, default = 'Dummyalbumart.png' }, |
||
{ name = ' |
{ name = 'jacket alt', dFunc = formatJacket }, |
||
{ name = 'japanese' }, |
{ name = 'japanese' }, |
||
{ name = 'romaji' }, |
{ name = 'romaji' }, |
||
{ name = 'english' }, |
{ name = 'english' }, |
||
{ name = ' |
{ name = 'singers', pFunc = utils.splitWithDelim(','), dFunc = formatList }, |
||
{ name = ' |
{ name = 'producers', pFunc = utils.splitWithDelim(','), dFunc = formatList }, |
||
{ name = 'unit', func = formatUnits }, |
|||
{ name = 'arranger', func = formatNames }, |
|||
{ name = 'composer', func = formatNames }, |
|||
{ name = 'lyricist', func = formatNames }, |
|||
{ name = 'commissioned', func = formatCommissioned }, |
|||
{ name = 'bpm' }, |
|||
{ name = 'duration' }, |
{ name = 'duration' }, |
||
{ name = 'units', pFunc = utils.splitWithDelim(';'), dFunc = formatList }, |
|||
{ name = 'unlock' }, |
|||
{ name = 'arrangers', pFunc = utils.splitWithDelim(','), dFunc = formatList }, |
|||
{ name = 'composers', pFunc = utils.splitWithDelim(','), dFunc = formatList }, |
|||
{ name = 'lyricists', pFunc = utils.splitWithDelim(','), dFunc = formatList }, |
|||
{ name = 'commissioned', pFunc = convertToBoolOrNil, dFunc = formatCommissioned }, |
|||
{ name = 'contest winner', pFunc = convertToBoolOrNil, default = false }, |
|||
{ name = 'bpm' }, |
|||
{ name = 'game duration' }, |
|||
{ name = 'date' }, |
{ name = 'date' }, |
||
{ name = '3d mv', |
{ name = '3d mv', pFunc = convertToBoolOrNil, dFunc = formatMv }, |
||
{ name = '2d mv', |
{ name = '2d mv', pFunc = convertToBoolOrNil, dFunc = formatMv }, |
||
{ name = 'original mv', |
{ name = 'original mv', pFunc = convertToBoolOrNil, dFunc = formatMv }, |
||
{ name = 'easy difficulty' }, |
{ name = 'easy difficulty' }, |
||
{ name = 'normal difficulty' }, |
{ name = 'normal difficulty' }, |
||
Line 166: | Line 128: | ||
} |
} |
||
:setArgs(args) |
:setArgs(args) |
||
:processArgs() |
|||
:setCategoryMap({ |
|||
['units'] = { |
|||
['VIRTUAL SINGER'] = 'VIRTUAL SINGER songs', |
|||
['Leo/need'] = 'Leo/need songs', |
|||
['MORE MORE JUMP!'] = 'MORE MORE JUMP! songs', |
|||
['Vivid BAD SQUAD'] = 'Vivid BAD SQUAD songs', |
|||
['Wonderlands×Showtime'] = 'Wonderlands×Showtime songs', |
|||
['25-ji, Nightcord de.'] = '25-ji, Nightcord de. songs', |
|||
['Other'] = 'Other songs' |
|||
}, |
|||
['unlock'] = { |
|||
['Automatic'] = 'Songs unlocked automatically', |
|||
['Music Shop'] = 'Songs unlocked from the Music Shop', |
|||
['Present Box'] = 'Songs unlocked from the Present Box', |
|||
}, |
|||
['commissioned'] = { |
|||
[true] = 'Commissioned songs', |
|||
}, |
|||
['contest winner'] = { |
|||
[true] = 'Contest winning songs' |
|||
}, |
|||
['3d mv'] = { |
|||
[true] = 'Songs with 3D MV' |
|||
}, |
|||
['2d mv'] = { |
|||
[true] = 'Songs with 2D MV' |
|||
}, |
|||
['original mv'] = { |
|||
[true] = 'Songs with Original MV' |
|||
}, |
|||
}) |
|||
infobox |
infobox |
||
Line 171: | Line 165: | ||
:addImage( |
:addImage( |
||
{ |
{ |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'jacket', tabName = 'Original' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'jacket alt', tabName = 'Alternate' } |
||
} |
} |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Japanese' |
{ tag = 'th', content = 'Japanese' }, |
||
{ tag = 'argtd', content = 'japanese' |
{ tag = 'argtd', content = 'japanese' } |
||
}, |
}, |
||
{ hideIfEmpty = { 'japanese' } } |
{ hideIfEmpty = { 'japanese' } } |
||
Line 184: | Line 178: | ||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Romaji' |
{ tag = 'th', content = 'Romaji' }, |
||
{ tag = 'argtd', content = 'romaji' |
{ tag = 'argtd', content = 'romaji' } |
||
}, |
}, |
||
{ hideIfEmpty = { 'romaji' } } |
{ hideIfEmpty = { 'romaji' } } |
||
Line 191: | Line 185: | ||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'English' |
{ tag = 'th', content = 'English' }, |
||
{ tag = 'argtd', content = 'english' |
{ tag = 'argtd', content = 'english' } |
||
}, |
}, |
||
{ hideIfEmpty = { 'english' } } |
{ hideIfEmpty = { 'english' } } |
||
Line 199: | Line 193: | ||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Original singer(s)' |
{ tag = 'th', content = 'Original singer(s)' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'singers' } |
||
}, |
}, |
||
{ hideIfEmpty = { ' |
{ hideIfEmpty = { 'singers' } } |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Producer(s)' |
{ tag = 'th', content = 'Producer(s)' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'producers' } |
||
} |
} |
||
) |
|||
:addRow( |
|||
{ |
|||
{ tag = 'th', content = 'Duration' }, |
|||
{ tag = 'argtd', content = 'duration' } |
|||
}, |
|||
{ hideIfEmpty = { 'duration' } } |
|||
) |
) |
||
:addHeader({ tag = 'th', content = 'In-game Information' }, { subheader = true }) |
:addHeader({ tag = 'th', content = 'In-game Information' }, { subheader = true }) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Song ID' |
{ tag = 'th', content = 'Song ID' }, |
||
{ tag = 'argtd', content = 'song id' |
{ tag = 'argtd', content = 'song id' } |
||
} |
} |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Unit(s)' |
{ tag = 'th', content = 'Unit(s)' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'units' } |
||
} |
} |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = ' |
{ tag = 'th', content = 'How to unlock' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'unlock' } |
||
} |
|||
) |
|||
:addRow( |
|||
{ |
|||
{ tag = 'th', content = 'Arranger(s)' }, |
|||
{ tag = 'argtd', content = 'arrangers' } |
|||
}, |
}, |
||
{ hideIfEmpty = { ' |
{ hideIfEmpty = { 'arrangers' } } |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Composer(s)' |
{ tag = 'th', content = 'Composer(s)' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'composers' } |
||
}, |
}, |
||
{ hideIfEmpty = { ' |
{ hideIfEmpty = { 'composers' } } |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Lyricist(s)' |
{ tag = 'th', content = 'Lyricist(s)' }, |
||
{ tag = 'argtd', content = ' |
{ tag = 'argtd', content = 'lyricists' } |
||
}, |
}, |
||
{ hideIfEmpty = { ' |
{ hideIfEmpty = { 'lyricists' } } |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Commissioned' |
{ tag = 'th', content = 'Commissioned?' }, |
||
{ tag = 'argtd', content = 'commissioned' |
{ tag = 'argtd', content = 'commissioned' } |
||
} |
} |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'BPM' |
{ tag = 'th', content = 'BPM' }, |
||
{ tag = 'argtd', content = 'bpm' |
{ tag = 'argtd', content = 'bpm' } |
||
} |
} |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Duration' |
{ tag = 'th', content = 'Duration (game)' }, |
||
{ tag = 'argtd', content = 'duration' |
{ tag = 'argtd', content = 'game duration' } |
||
} |
} |
||
) |
) |
||
:addRow( |
:addRow( |
||
{ |
{ |
||
{ tag = 'th', content = 'Release date' |
{ tag = 'th', content = 'Release date' }, |
||
{ tag = 'argtd', content = 'date' |
{ tag = 'argtd', content = 'date' } |
||
} |
} |
||
) |
) |
||
Line 275: | Line 282: | ||
{ tag = 'th', content = 'Original' } |
{ tag = 'th', content = 'Original' } |
||
}, |
}, |
||
{ |
{ defaultCss = { ['text-align'] = 'center' } } |
||
) |
) |
||
:addRow( |
:addRow( |
||
Line 283: | Line 290: | ||
{ tag = 'argtd', content = 'original mv', classFunc = getMvClass }, |
{ tag = 'argtd', content = 'original mv', classFunc = getMvClass }, |
||
}, |
}, |
||
{ |
{ defaultCss = { ['text-align'] = 'center' } } |
||
) |
) |
||
:addHeader({ tag = 'th', content = 'Difficulties' }, { subheader = true }) |
:addHeader({ tag = 'th', content = 'Difficulties' }, { subheader = true }) |
||
Line 289: | Line 296: | ||
difficultiesRow(), |
difficultiesRow(), |
||
{ |
{ |
||
defaultCss = { |
|||
['text-align'] = 'center', |
['text-align'] = 'center', |
||
['border-bottom-style'] = 'solid' |
['border-bottom-style'] = 'solid' |
||
Line 303: | Line 310: | ||
{ tag = 'argtd', content = 'master difficulty' } |
{ tag = 'argtd', content = 'master difficulty' } |
||
}, |
}, |
||
{ |
{ defaultCss = { ['text-align'] = 'center' } } |
||
) |
) |
||
:addHeader({ tag = 'th', content = 'Notes' }, { subheader = true }) |
:addHeader({ tag = 'th', content = 'Notes' }, { subheader = true }) |
||
Line 309: | Line 316: | ||
difficultiesRow(), |
difficultiesRow(), |
||
{ |
{ |
||
defaultCss = { |
|||
['text-align'] = 'center', |
['text-align'] = 'center', |
||
['border-bottom-style'] = 'solid' |
['border-bottom-style'] = 'solid' |
||
Line 323: | Line 330: | ||
{ tag = 'argtd', content = 'master notes' } |
{ tag = 'argtd', content = 'master notes' } |
||
}, |
}, |
||
{ |
{ defaultCss = { ['text-align'] = 'center' } } |
||
) |
) |
||
local categories = "" |
|||
if mw.title.getCurrentTitle().namespace == 0 then |
if mw.title.getCurrentTitle().namespace == 0 then |
||
categories = "[[Category:Songs]]" .. |
categories = "[[Category:Songs]]" .. infobox:getCategories() |
||
local procArgs = infobox:getArgs('processed') |
|||
local rawArgs = infobox:getArgs('raw') |
|||
if rawArgs['unit'] then |
|||
local units = mw.text.split(rawArgs['unit'], ',') |
|||
for i,v in ipairs(units) do |
|||
local unit = constants.get_unit(mw.text.trim(v)) |
|||
if unit then |
|||
categories = categories .. "[[Category:" .. unit .. " songs]]" |
|||
elseif v == 'other' then |
|||
categories = categories .. "[[Category:Other songs]]" |
|||
end |
|||
end |
|||
end |
|||
if yesno(rawArgs['commissioned'], nil) then |
|||
categories = categories .. "[[Category:Commissioned songs]]" |
|||
end |
|||
local rawArgs = infobox:getRawArgs() |
|||
VariablesLua.vardefine( 'song id', rawArgs['song id'] ) |
|||
categories = categories .. "[[Category:Songs with 3D MV]]" |
|||
end |
|||
if yesno(rawArgs['2d mv'], nil) then |
|||
categories = categories .. "[[Category:Songs with 2D MV]]" |
|||
end |
|||
if yesno(rawArgs['original mv'], nil) then |
|||
categories = categories .. "[[Category:Songs with Original MV]]" |
|||
end |
|||
end |
end |
||
Revision as of 22:58, 5 August 2022
This module depends on the following other modules: |
To generate {{Infobox song}}, invoke using the main function.
--------------------------
-- Module for [[Template:Infobox song]]
------------------------
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local builder = require('Module:InfoboxBuilder new')
local constants = require('Module:Constants')
local utils = require('Module:Utilities')
local VariablesLua = mw.ext.VariablesLua
local p = {}
local function convertToBoolOrNil(val)
return yesno(val, nil)
end
local function formatJacket(jacket)
return string.format("[[File:%s|220px]]", jacket)
end
local function formatList(list)
if #list < 2 then
return list[1]
end
local ul = mw.html.create('ul')
for i=1,#list do
ul:tag('li')
:wikitext(list[i])
end
return tostring(ul)
end
local function formatCommissioned(comm)
-- probably should not use == with bool, but this is more explicit
if comm == true then
return 'Yes'
elseif comm == false then
return 'No'
end
return nil
end
local function formatMv(mv)
-- probably should not use == with bool, but this is more explicit
if mv == true then
return '✓'
elseif mv == false then
return '✗'
end
return nil
end
local function getMvClass(mv)
-- probably should not use == with bool, but this is more explicit
if mv == true then
return 'true-cell'
elseif mv == false then
return 'false-cell'
end
return nil
end
local function difficultiesRow()
local difficulties = { 'Easy', 'Normal', 'Hard', 'Expert', 'Master' }
local row = {}
for _,v in ipairs(difficulties) do
table.insert(row,
{
content = v,
tag = 'th',
css = { ['border-bottom-color'] = constants.get_difficulty_color(v) }
}
)
end
return row
end
function p.main(frame)
local args = getArgs(frame)
local infobox = builder.new();
infobox:setName('Infobox song')
:setParams{
{ name = 'song id' },
{ name = 'song name', default = mw.title.getCurrentTitle().text },
{ name = 'jacket', dFunc = formatJacket, default = 'Dummyalbumart.png' },
{ name = 'jacket alt', dFunc = formatJacket },
{ name = 'japanese' },
{ name = 'romaji' },
{ name = 'english' },
{ name = 'singers', pFunc = utils.splitWithDelim(','), dFunc = formatList },
{ name = 'producers', pFunc = utils.splitWithDelim(','), dFunc = formatList },
{ name = 'duration' },
{ name = 'units', pFunc = utils.splitWithDelim(';'), dFunc = formatList },
{ name = 'unlock' },
{ name = 'arrangers', pFunc = utils.splitWithDelim(','), dFunc = formatList },
{ name = 'composers', pFunc = utils.splitWithDelim(','), dFunc = formatList },
{ name = 'lyricists', pFunc = utils.splitWithDelim(','), dFunc = formatList },
{ name = 'commissioned', pFunc = convertToBoolOrNil, dFunc = formatCommissioned },
{ name = 'contest winner', pFunc = convertToBoolOrNil, default = false },
{ name = 'bpm' },
{ name = 'game duration' },
{ name = 'date' },
{ name = '3d mv', pFunc = convertToBoolOrNil, dFunc = formatMv },
{ name = '2d mv', pFunc = convertToBoolOrNil, dFunc = formatMv },
{ name = 'original mv', pFunc = convertToBoolOrNil, dFunc = formatMv },
{ name = 'easy difficulty' },
{ name = 'normal difficulty' },
{ name = 'hard difficulty' },
{ name = 'expert difficulty' },
{ name = 'master difficulty' },
{ name = 'easy notes' },
{ name = 'normal notes' },
{ name = 'hard notes' },
{ name = 'expert notes' },
{ name = 'master notes' },
}
:setArgs(args)
:processArgs()
:setCategoryMap({
['units'] = {
['VIRTUAL SINGER'] = 'VIRTUAL SINGER songs',
['Leo/need'] = 'Leo/need songs',
['MORE MORE JUMP!'] = 'MORE MORE JUMP! songs',
['Vivid BAD SQUAD'] = 'Vivid BAD SQUAD songs',
['Wonderlands×Showtime'] = 'Wonderlands×Showtime songs',
['25-ji, Nightcord de.'] = '25-ji, Nightcord de. songs',
['Other'] = 'Other songs'
},
['unlock'] = {
['Automatic'] = 'Songs unlocked automatically',
['Music Shop'] = 'Songs unlocked from the Music Shop',
['Present Box'] = 'Songs unlocked from the Present Box',
},
['commissioned'] = {
[true] = 'Commissioned songs',
},
['contest winner'] = {
[true] = 'Contest winning songs'
},
['3d mv'] = {
[true] = 'Songs with 3D MV'
},
['2d mv'] = {
[true] = 'Songs with 2D MV'
},
['original mv'] = {
[true] = 'Songs with Original MV'
},
})
infobox
:addHeader({ tag = 'argth', content = 'song name' })
:addImage(
{
{ tag = 'argtd', content = 'jacket', tabName = 'Original' },
{ tag = 'argtd', content = 'jacket alt', tabName = 'Alternate' }
}
)
:addRow(
{
{ tag = 'th', content = 'Japanese' },
{ tag = 'argtd', content = 'japanese' }
},
{ hideIfEmpty = { 'japanese' } }
)
:addRow(
{
{ tag = 'th', content = 'Romaji' },
{ tag = 'argtd', content = 'romaji' }
},
{ hideIfEmpty = { 'romaji' } }
)
:addRow(
{
{ tag = 'th', content = 'English' },
{ tag = 'argtd', content = 'english' }
},
{ hideIfEmpty = { 'english' } }
)
:addHeader({ tag = 'th', content = 'Song Information' }, { subheader = true })
:addRow(
{
{ tag = 'th', content = 'Original singer(s)' },
{ tag = 'argtd', content = 'singers' }
},
{ hideIfEmpty = { 'singers' } }
)
:addRow(
{
{ tag = 'th', content = 'Producer(s)' },
{ tag = 'argtd', content = 'producers' }
}
)
:addRow(
{
{ tag = 'th', content = 'Duration' },
{ tag = 'argtd', content = 'duration' }
},
{ hideIfEmpty = { 'duration' } }
)
:addHeader({ tag = 'th', content = 'In-game Information' }, { subheader = true })
:addRow(
{
{ tag = 'th', content = 'Song ID' },
{ tag = 'argtd', content = 'song id' }
}
)
:addRow(
{
{ tag = 'th', content = 'Unit(s)' },
{ tag = 'argtd', content = 'units' }
}
)
:addRow(
{
{ tag = 'th', content = 'How to unlock' },
{ tag = 'argtd', content = 'unlock' }
}
)
:addRow(
{
{ tag = 'th', content = 'Arranger(s)' },
{ tag = 'argtd', content = 'arrangers' }
},
{ hideIfEmpty = { 'arrangers' } }
)
:addRow(
{
{ tag = 'th', content = 'Composer(s)' },
{ tag = 'argtd', content = 'composers' }
},
{ hideIfEmpty = { 'composers' } }
)
:addRow(
{
{ tag = 'th', content = 'Lyricist(s)' },
{ tag = 'argtd', content = 'lyricists' }
},
{ hideIfEmpty = { 'lyricists' } }
)
:addRow(
{
{ tag = 'th', content = 'Commissioned?' },
{ tag = 'argtd', content = 'commissioned' }
}
)
:addRow(
{
{ tag = 'th', content = 'BPM' },
{ tag = 'argtd', content = 'bpm' }
}
)
:addRow(
{
{ tag = 'th', content = 'Duration (game)' },
{ tag = 'argtd', content = 'game duration' }
}
)
:addRow(
{
{ tag = 'th', content = 'Release date' },
{ tag = 'argtd', content = 'date' }
}
)
:addHeader({ tag = 'th', content = 'Music Video' }, { subheader = true })
:addRow(
{
{ tag = 'th', content = '3D' },
{ tag = 'th', content = '2D' },
{ tag = 'th', content = 'Original' }
},
{ defaultCss = { ['text-align'] = 'center' } }
)
:addRow(
{
{ tag = 'argtd', content = '3d mv', classFunc = getMvClass },
{ tag = 'argtd', content = '2d mv', classFunc = getMvClass },
{ tag = 'argtd', content = 'original mv', classFunc = getMvClass },
},
{ defaultCss = { ['text-align'] = 'center' } }
)
:addHeader({ tag = 'th', content = 'Difficulties' }, { subheader = true })
:addRow(
difficultiesRow(),
{
defaultCss = {
['text-align'] = 'center',
['border-bottom-style'] = 'solid'
}
}
)
:addRow(
{
{ tag = 'argtd', content = 'easy difficulty' },
{ tag = 'argtd', content = 'normal difficulty' },
{ tag = 'argtd', content = 'hard difficulty' },
{ tag = 'argtd', content = 'expert difficulty' },
{ tag = 'argtd', content = 'master difficulty' }
},
{ defaultCss = { ['text-align'] = 'center' } }
)
:addHeader({ tag = 'th', content = 'Notes' }, { subheader = true })
:addRow(
difficultiesRow(),
{
defaultCss = {
['text-align'] = 'center',
['border-bottom-style'] = 'solid'
}
}
)
:addRow(
{
{ tag = 'argtd', content = 'easy notes' },
{ tag = 'argtd', content = 'normal notes' },
{ tag = 'argtd', content = 'hard notes' },
{ tag = 'argtd', content = 'expert notes' },
{ tag = 'argtd', content = 'master notes' }
},
{ defaultCss = { ['text-align'] = 'center' } }
)
local categories = ""
if mw.title.getCurrentTitle().namespace == 0 then
categories = "[[Category:Songs]]" .. infobox:getCategories()
local rawArgs = infobox:getRawArgs()
VariablesLua.vardefine( 'song id', rawArgs['song id'] )
end
return infobox:tostring() .. categories
end
return p