Module:InfoboxNPC: Difference between revisions
From Elwiki
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
addField('name', 'Full Name'); | addField('name', 'Full Name'); | ||
end | end | ||
local fields = { | |||
{ | |||
id = 'name', | |||
localize = 'Full Name', | |||
special = 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); | return tostring(infobox); |
Revision as of 13:14, 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');
if (args.name1 == nil and args.name2 == nil) then
addField('name', 'Full Name');
end
local fields = {
{
id = 'name',
localize = 'Full Name',
special = 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