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

Kharmitch (discussion | contributions)
Aucun résumé des modifications
ref id inutile
 
(14 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
local localdata = require('Module:Infobox/Localdata')
local localdata = require("Module:Infobox/Localdata")


function buildSubject(arg)
local SUBJECTS = {
local subject = 'Créature'
["créature"]  = {"Créature", "Créatures"},
["humain"]     = {"Humain", "Créatures"},
if arg then
["ordinateur"] = {"Ordinateur", "Robots et ordinateurs"},
local types = {
["robot"]     = {"Robot", "Robots et ordinateurs"},
['créature']   = 'Créature',
["tourelle"]   = {"Tourelle", "Robots et ordinateurs"},
['ordinateur'] = 'Ordinateur',
}
['robot']       = 'Robot'
}
subject = types[arg:lower()] or subject
end
return subject
end


function buildLink(arg)
-- Lien d'en-tête en fonction du sujet choisi
local subject = 'Créatures'
-- "créature" par défaut
local subject = SUBJECTS[(localdata["type"] or "créature"):lower()]
if arg then
if subject == nil then
local types = {
error(string.format(
['créature']   = 'Créatures',
"Valeur inconnue pour le paramètre type : « %s »",
['ordinateur']  = 'Robots et ordinateurs',
localdata["type"]
['robot']      = 'Robots et ordinateurs'
))
}
subject = types[arg:lower()] or subject
end
return subject
end
end


return {
return {
parts = {
    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 = "title",
{ type = 'table', title = 'Informations', rows = {
            value = "nom",
{ type = 'row', label = 'Nom original', value = 'nom original' },
            subtitle = "sous-titre",
{ type = 'row', label = 'Variantes', value = 'variantes' },
            icon = "icône",
{ type = 'row', label = 'Localisation', value = 'localisation' },
            subhead = {games = "jeux", subject = subject[1], link = subject[2]},
{ type = 'row', label = 'Affiliation', value = 'affiliation' },
        },
{ type = 'row', label = 'Fichier dialogue', value = 'dialogue' }
        {
}},
            type = "images",
{ type = 'text', value = 'pied' }
            imageparameters = {"image", "image2", "image3", "image4", "image5"},
}
            captionparameter = {"légende", "image desc"},
        },
        {
            type = "table",
            title = "Répartition et relations",
        rows = {
                {type = "row", label = "Localisation", value = "localisation"},
                {type = "row", label = "Affiliation", value = "affiliation"},
                {type = "row", label = "Variantes", value = "variantes"},
                {type = "row", label = "Quêtes", value = "quêtes"},
                {type = "row", label = "Événements", value = "événements"},
            },
        },
        {
            type = "table",
            title = "Technique",
            rows = {
                {type = "row", label = "Fichier dialogue", value = "dialogue"},
                {type = "row", label = "Doubleur anglais", value = "acteur vo"},
                {type = "row", label = "Doubleur français", value = "acteur vf"},
                {type = "row", label = "Editor ID", value = "editorid"},
                {type = "row", label = "Form ID", value = "formid"},
                {type = "row", label = "Prototype ID", value = "proto"},
            }
        },
        {type = "text", value = "pied"},
    }
}
}

Dernière version du 18 septembre 2025 à 21:13

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")

local SUBJECTS = {
	["créature"]   = {"Créature", "Créatures"},
	["humain"]     = {"Humain", "Créatures"},
	["ordinateur"] = {"Ordinateur", "Robots et ordinateurs"},
	["robot"]      = {"Robot", "Robots et ordinateurs"},
	["tourelle"]   = {"Tourelle", "Robots et ordinateurs"},
}

-- Lien d'en-tête en fonction du sujet choisi
-- "créature" par défaut
local subject = SUBJECTS[(localdata["type"] or "créature"):lower()]
if subject == nil then
	error(string.format(
		"Valeur inconnue pour le paramètre type : « %s »",
		localdata["type"]
	))
end

return {
    parts = {
        {
            type = "title",
            value = "nom",
            subtitle = "sous-titre",
            icon = "icône",
            subhead = {games = "jeux", subject = subject[1], link = subject[2]},
        },
        {
            type = "images",
            imageparameters = {"image", "image2", "image3", "image4", "image5"},
            captionparameter = {"légende", "image desc"},
        },
        {
            type = "table",
            title = "Répartition et relations",
        	rows = {
                {type = "row", label = "Localisation", value = "localisation"},
                {type = "row", label = "Affiliation", value = "affiliation"},
                {type = "row", label = "Variantes", value = "variantes"},
                {type = "row", label = "Quêtes", value = "quêtes"},
                {type = "row", label = "Événements", value = "événements"},
            },
        },
        {
            type = "table",
            title = "Technique",
            rows = {
                {type = "row", label = "Fichier dialogue", value = "dialogue"},
                {type = "row", label = "Doubleur anglais", value = "acteur vo"},
                {type = "row", label = "Doubleur français", value = "acteur vf"},
                {type = "row", label = "Editor ID", value = "editorid"},
                {type = "row", label = "Form ID", value = "formid"},
                {type = "row", label = "Prototype ID", value = "proto"},
            }
        },
        {type = "text", value = "pied"},
    }
}