Module:Infobox/Créature

De Les Archives de Vault-Tec
Révision datée du 22 décembre 2021 à 18:33 par Kharmitch (discussion | contributions) (Le paramètre variantes devient déprécié au profit de individus et modèles)
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 = 'table', title = 'Informations', rows = {
			{ type = 'row', label = 'Nom original', value = 'nom original' },
			{ type = 'row', label = 'Localisation', value = 'localisation' },
			{ type = 'row', label = 'Variantes', value = 'variantes' },
			{ type = 'row', label = 'Individus', value = 'individus' },
			{ type = 'row', label = 'Modèles', value = 'modèles' },
			{ type = 'row', label = 'Affiliation', value = 'affiliation' },
			{ type = 'row', label = 'Fichier dialogue', value = 'dialogue' }
		}},
		{ type = 'text', value = 'pied' }
	}
}