Module:Infobox/Créature

De Les Archives de Vault-Tec
Révision datée du 15 juin 2021 à 14:23 par 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é… »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
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' }
	}
}