« Module:Infobox/Créature » : différence entre les versions
Le paramètre variantes devient déprécié au profit de individus et modèles |
mAucun résumé des modifications |
||
(Une version intermédiaire par le même utilisateur non affichée) | |||
Ligne 1 : | Ligne 1 : | ||
local localdata = require( | local localdata = require("Module:Infobox/Localdata") | ||
local SUBJECTS = { | |||
["créature"] = {"Créature", "Créatures"}, | |||
["ordinateur"] = {"Ordinateur", "Robots et ordinateurs"}, | |||
["robot"] = {"Robot", "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 | end | ||
return { | 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 = "Identification", | |||
rows = { | |||
{type = "row", label = "Nom original", value = "nom original"}, | |||
{type = "row", label = "Individus", value = "individus"}, | |||
{type = "row", label = "Modèles", value = "modèles"}, | |||
{type = "row", label = "Variantes", value = "variantes"}, | |||
}, | |||
}, | |||
{ | |||
type = "table", | |||
title = "Répartition et relations", | |||
rows = { | |||
{type = "row", label = "Localisation", value = "localisation"}, | |||
{type = "row", label = "Affiliation", value = "affiliation"}, | |||
{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 = "text", value = "pied"}, | |||
} | |||
} | } |
Dernière version du 28 janvier 2023 à 12:33
Ce module contient le paramétrage de l'infobox {{Infobox créature}}.
local localdata = require("Module:Infobox/Localdata")
local SUBJECTS = {
["créature"] = {"Créature", "Créatures"},
["ordinateur"] = {"Ordinateur", "Robots et ordinateurs"},
["robot"] = {"Robot", "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 = "Identification",
rows = {
{type = "row", label = "Nom original", value = "nom original"},
{type = "row", label = "Individus", value = "individus"},
{type = "row", label = "Modèles", value = "modèles"},
{type = "row", label = "Variantes", value = "variantes"},
},
},
{
type = "table",
title = "Répartition et relations",
rows = {
{type = "row", label = "Localisation", value = "localisation"},
{type = "row", label = "Affiliation", value = "affiliation"},
{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 = "text", value = "pied"},
}
}