Module:FellowCostumeUpgradeTable: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
local p = {}
local p = {}


local function makeSkillTable(skillName, img, levelData, typeName)
function p.main(frame)
local args = frame:getParent().args
local skill = args.skill or "Unnamed Skill"
local img = args.img or "Placeholder.png"
local typeName = args.type or "Fellow"
local levels = args.levels or ""
 
local rows = {}
local rows = {}
for line in mw.text.gsplit(levelData or "", ";", true) do
for line in mw.text.gsplit(levels, ";", true) do
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 ""
Line 21: Line 27:
! Level Cap
! Level Cap
! <abbr title="The Aptitude multiplier granted by this costume.">%s Aptitude</abbr>
! <abbr title="The Aptitude multiplier granted by this costume.">%s Aptitude</abbr>
]=], img or "Placeholder.png", skillName, typeName)
]=], img, skill, typeName)


return header .. "\n" .. table.concat(rows, "\n") .. "\n|}"
return header .. "\n" .. table.concat(rows, "\n") .. "\n|}"
end
function p.main(frame)
local args = frame:getParent().args
local typeName = args.type or "Fellow"
local skill1 = args.skill1 or "Skill A"
local skill2 = args.skill2 or "Skill B"
local levels1 = args.skill1levels or ""
local levels2 = args.skill2levels or ""
local img1 = args.img1 or "Placeholder.png"
local img2 = args.img2 or "Placeholder.png"
local output = makeSkillTable(skill1, img1, levels1, typeName)
.. "\n\n" ..
makeSkillTable(skill2, img2, levels2, typeName)
return output
end
end


return p
return p
contributors, delete_pages, Interface administrators
4,701

edits

Navigation menu