« Module:Infobox/Créature » : différence entre les versions

De Les Archives de Vault-Tec
Kharmitch (discussion | contributions)
Page créée avec « local localdata = require('Module:Infobox/Localdata') function buildSubject(arg) local subject = 'créature' if arg then local types = { ['créature'] = 'Cré… »
 
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Ligne 2 : Ligne 2 :


function buildSubject(arg)
function buildSubject(arg)
local subject = 'créature'
local subject = 'Créature'
if arg then
if arg then

Version du 15 juin 2021 à 15:58

Documentation du module

Ce module contient le paramétrage de l'infobox {{Infobox créature}}.

Documentation transclues de Module:Infobox/Créature/doc.
local localdata = require('Module:Infobox/Localdata')

function buildSubject(arg)
	local subject = 'Créature'
	
	if arg then
		local types = {
			['créature']    = 'Créature',
			['ordinateur']  = 'Ordinateur',
			['robot']       = 'Robot'
		}
		subject = types[arg:lower()] or subject
	end
	
	return subject
end

function buildLink(arg)
	local subject = 'Créatures'
	
	if arg then
		local types = {
			['créature']    = 'Créatures',
			['ordinateur']  = 'Robots et ordinateurs',
			['robot']       = 'Robots et ordinateurs'
		}
		subject = types[arg:lower()] or subject
	end
	
	return subject
end

return {
	parts = {
		{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = buildSubject(localdata['type']), link = buildLink(localdata['type']) }},
		{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
		{ type = 'row', label = 'Nom original', value = 'nom original' },
		{ type = 'row', label = 'Variantes', value = 'variantes' },
		{ type = 'row', label = 'Localisation', value = 'localisation' },
		{ type = 'row', label = 'Affiliation', value = 'affiliation' },
		{ type = 'row', label = 'Fichier dialogue', value = 'dialogue' },
		{ type = 'text', value = 'pied' }
	}
}