Balises : Modification par mobile Modification par le web mobile |
|
| (20 versions intermédiaires par 2 utilisateurs non affichées) |
| Ligne 1 : |
Ligne 1 : |
| return {
| | local configs = {} |
| edifice = {
| |
| title = "Edifice",
| |
| headerColor = "#D2691E", -- Couleur construction
| |
| headerClass = "edifice",
| |
| fields = {
| |
| {key = "auteur", label = "Auteur"},
| |
| {key = "fonction", label = "Fonction", optional = true},
| |
| {key = "monde", label = "Monde", format = "link", optional = true},
| |
| {key = "ville", label = "Ville", format = "link", optional = true},
| |
| {key = "guilde", label = "Guilde", format = "link", optional = true},
| |
| {key = "x", label = "X", optional = true},
| |
| {key = "y", label = "Y", optional = true},
| |
| {key = "z", label = "Z", optional = true}
| |
| },
| |
| sections = {
| |
| {title = "Définition", fields = {"auteur", "fonction"}},
| |
| {title = "Géographie", fields = {"monde", "ville", "guilde", "coordonnees"}}
| |
| }
| |
| },
| |
|
| |
|
| monde = { | | -- Charge dynamiquement les configurations depuis les sous-pages |
| title = "Monde",
| | local function loadConfig(configName) |
| headerColor = "#86C705",
| | local success, config = pcall(require, 'Module:Infobox/Configs/' .. configName) |
| headerClass = "monde",
| | if success then |
| fields = { | | return config |
| {key = "seed", label = "Seed", format = "seed"},
| | else |
| {key = "type", label = "Type"},
| | -- Fallback en cas d'erreur |
| {key = "status", label = "Status", optional = true},
| | mw.log('Erreur lors du chargement de la configuration: ' .. configName) |
| {key = "difficulte", label = "Difficulté", optional = true},
| | return nil |
| {key = "x", label = "X", optional = true},
| | end |
| {key = "y", label = "Y", optional = true},
| | end |
| {key = "z", label = "Z", optional = true},
| |
| {key = "monde", label = "Monde", optional = true}
| |
| }, | |
| sections = { | |
| {title = "Spécificités", fields = {"seed", "type", "spawn"}},
| |
| {title = "Autres infos", fields = {"status", "difficulte"}}
| |
| } | |
| }, | |
|
| |
|
| ville = {
| | -- Charge toutes les configurations disponibles (manuellement) |
| title = "Ville",
| | configs.localite = loadConfig('Localite') |
| headerColor = "#20B2AA", -- Couleur ville (à définir selon votre CSS)
| | configs.monde = loadConfig('Monde') |
| headerClass = "ville",
| | configs.plugin = loadConfig('Plugin') |
| fields = {
| | |
| {key = "fondation", label = "Fondation"},
| | -- Fonction pour ajouter dynamiquement d'autres configurations (automatiquement) |
| {key = "bourgmestre", label = "Bourgmestre"},
| | function configs.load(configName) |
| {key = "guilde", label = "Guilde(s)", optional = true},
| | if not configs[configName:lower()] then |
| {key = "spec", label = "Spécificité(s)"},
| | configs[configName:lower()] = loadConfig(configName) |
| {key = "projet", label = "Projet", optional = true},
| | end |
| {key = "production", label = "Production", optional = true},
| | return configs[configName:lower()] |
| {key = "commerce", label = "Liens commerciaux", optional = true},
| | end |
| {key = "monde", label = "Monde", format = "link", optional = true},
| | |
| {key = "region", label = "Région(s)", optional = true},
| | return configs |
| {key = "biome", label = "Biome(s)", optional = true},
| |
| {key = "x", label = "X", optional = true},
| |
| {key = "y", label = "Y", optional = true},
| |
| {key = "z", label = "Z", optional = true},
| |
| {key = "carte", label = "Carte", optional = true},
| |
| {key = "taillecarte", label = "Taille carte", optional = true}
| |
| }, | |
| sections = {
| |
| {title = "Informations générales", fields = {"fondation", "bourgmestre", "guilde", "spec", "projet"}},
| |
| {title = "Économie", fields = {"production", "commerce"}},
| |
| {title = "Géographie", fields = {"carte", "monde", "region", "coordonnees", "biome"}}
| |
| }
| |
| }
| |
| }
| |