Module:FellowCostumeUpgradeTable: Difference between revisions
Jump to navigation
Jump to search
FaeriMagic (talk | contribs) mNo edit summary |
FaeriMagic (talk | contribs) mNo edit summary |
||
| (12 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
function p.main(frame) | function p.main(frame) | ||
local args = frame | local args = frame.args | ||
local skill = args.skill or "Unnamed Skill" | local skill = args.skill or "Unnamed Skill" | ||
local img = args.img or "Placeholder.png" | local img = args.img or "Placeholder.png" | ||
local typeName = args.type or " | local typeName = args.type or "" | ||
local levels = args.levels or "" | local levels = args.levels or "" | ||
| Line 12: | Line 12: | ||
local parts = mw.text.split(mw.text.trim(line), ",") | local parts = mw.text.split(mw.text.trim(line), ",") | ||
local level = parts[1] or "" | local level = parts[1] or "" | ||
local | local skillMax = parts[2] or "" | ||
local apt = parts[3] or "" | local apt = parts[3] or "" | ||
table.insert(rows, string.format( | table.insert(rows, string.format( | ||
'|-\n| style="text-align: center;" | %s || %s || %s', | '|-\n| style="text-align: center;" | %s || %s || %s', | ||
level, | level, skillMax, apt | ||
)) | )) | ||
end | end | ||
local header = string.format([=[ | local header = string.format([=[ | ||
{| class="wikitable" style="text-align: center;" | {| class="wikitable" style="text-align: center; display: inline-block;" | ||
| | |- | ||
| colspan="3" | [[File:%s|25px]] %s | |||
|- | |- | ||
! Lv. | ! Lv. | ||
! Level | ! <abbr title="Excludes manual skill improvements.">Skill Level/Max</abbr> | ||
! <abbr title="The Aptitude | ! <abbr title="The total Aptitude granted by this costume.">%s Aptitude</abbr> | ||
]=], img, skill, typeName) | ]=], img, skill, typeName) | ||
Latest revision as of 04:52, 31 July 2025
Documentation for this module may be created at Module:FellowCostumeUpgradeTable/doc
local p = {}
function p.main(frame)
local args = frame.args
local skill = args.skill or "Unnamed Skill"
local img = args.img or "Placeholder.png"
local typeName = args.type or ""
local levels = args.levels or ""
local rows = {}
for line in mw.text.gsplit(levels, ";", true) do
local parts = mw.text.split(mw.text.trim(line), ",")
local level = parts[1] or ""
local skillMax = parts[2] or ""
local apt = parts[3] or ""
table.insert(rows, string.format(
'|-\n| style="text-align: center;" | %s || %s || %s',
level, skillMax, apt
))
end
local header = string.format([=[
{| class="wikitable" style="text-align: center; display: inline-block;"
|-
| colspan="3" | [[File:%s|25px]] %s
|-
! Lv.
! <abbr title="Excludes manual skill improvements.">Skill Level/Max</abbr>
! <abbr title="The total Aptitude granted by this costume.">%s Aptitude</abbr>
]=], img, skill, typeName)
return header .. "\n" .. table.concat(rows, "\n") .. "\n|}"
end
return p