Module:InfoboxNPC: Difference between revisions
From Elwiki
m (Ritsu moved page Module:NPCbox to Module:InfoboxNPC without leaving a redirect) |
No edit summary |
||
Line 6: | Line 6: | ||
function p.main(frame) | function p.main(frame) | ||
local args = getArgs(frame); | local args = getArgs(frame); | ||
local clearfix = mw.html.create('div'):addClass('clearfix'); | |||
local title = ''; | local title = ''; | ||
Line 32: | Line 33: | ||
addField('VA', 'Voice Actors', true); | addField('VA', 'Voice Actors', true); | ||
return | return mw.allToString(infobox, clearfix); | ||
end | end | ||
return p | return p |
Revision as of 20:46, 10 May 2022
Documentation for this module may be created at Module:InfoboxNPC/doc
require('Module:CommonFunctions')
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Main process
function p.main(frame)
local args = getArgs(frame);
local clearfix = mw.html.create('div'):addClass('clearfix');
local title = '';
if args.roleset then
title = args.role1 .. '&' .. args.role2;
else
title = args.role;
end
local infobox = require('Module:InfoboxProto').main(frame, title);
infobox:addClass('infobox-npc');
if (args.name1 == nil and args.name2 == nil) then
addField('name', 'Full Name');
end
addField2('name', 'Full Name');
addField('class');
addField('weapon', nil, true);
addField('age', nil, true);
addField('race', nil, true);
addField('role', nil, true);
addField('village', 'Location', true);
addField('Height', nil, true);
addField('Weight', nil, true);
addField('Blood', 'Blood Type', true);
addField('VA', 'Voice Actors', true);
return mw.allToString(infobox, clearfix);
end
return p