Module:InfoboxNPC: Difference between revisions
From Elwiki
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
local infobox = require('Module:InfoboxProto').main(frame, title); | local infobox = require('Module:InfoboxProto').main(frame, title); | ||
infobox:addClass('infobox-npc'); | infobox:addClass('infobox-npc'); | ||
local fields = { | local fields = { | ||
Line 25: | Line 21: | ||
id = 'name', | id = 'name', | ||
localize = 'Full Name', | localize = 'Full Name', | ||
dual = true | |||
}, | }, | ||
{ | { |
Revision as of 15:21, 8 September 2023
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 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');
local fields = {
{
id = 'name',
localize = 'Full Name',
dual = true
},
{
id = 'class'
},
{
id = 'weapon',
dual = true
},
{
id = 'age',
dual = true
},
{
id = 'race',
dual = true
},
{
id = 'role',
dual = true
},
{
id = 'village',
localize = 'Location',
dual = true
},
{
id = 'Height',
dual = true
},
{
id = 'Weight',
dual = true
},
{
id = 'Blood',
localize = 'Blood Type',
dual = true
},
{
id = 'groups',
localize = 'Affiliations',
collapsed = true
},
{
id = 'VA',
localize = 'Voice Actors',
dual = true,
collapsed = true
}
}
addFields(fields);
return tostring(infobox);
end
return p