Basculer le menu
Changer de menu des préférences
Basculer le menu personnel
Non connecté(e)
Votre adresse IP sera visible au public si vous faites des modifications.

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

De Nefald
Hiob (discussion | contributions)
Aucun résumé des modifications
Hiob (discussion | contributions)
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
local configs = {
local configs = {
     monde = {
     monde = {
         titre = function(args) return args.nom or 'Monde sans nom' end,
         titre = function(args) return args.nom or '{{PAGENAME}}' end,
         image = function(args)  
         image = function(args)  
             if args.image then
             if args.image then
Ligne 10 : Ligne 10 :
         sections = {
         sections = {
             {
             {
                titre = 'Spécificités',
                 champs = {
                 champs = {
                     { cle = 'seed', label = 'Seed' },
                     { cle = 'seed', label = 'Seed' },
                     { cle = 'monde', label = 'Type de monde' },
                     { cle = 'monde', label = 'Type de monde' },
                    { cle = 'spawn', label = 'Spawn' }, -- Champ spécial pour les coordonnées
                     { cle = 'x', label = 'Coordonnée X' },
                     { cle = 'x', label = 'Coordonnée X' },
                     { cle = 'y', label = 'Coordonnée Y' },
                     { cle = 'y', label = 'Coordonnée Y' },
Ligne 21 : Ligne 23 :
                 titre = 'Informations',
                 titre = 'Informations',
                 champs = {
                 champs = {
                     { cle = 'status', label = 'Statut' },
                     { cle = 'status', label = 'Status' },
                     { cle = 'difficulte', label = 'Difficulté' }
                     { cle = 'difficulte', label = 'Difficulté' }
                 }
                 }

Version du 24 septembre 2025 à 12:42

La documentation pour ce module peut être créée à Module:Infobox/Configs/doc

local configs = {
    monde = {
        titre = function(args) return args.nom or '{{PAGENAME}}' end,
        image = function(args) 
            if args.image then
                return '[[Fichier:' .. args.image .. '|300px]]'
            end
            return nil
        end,
        sections = {
            {
                titre = 'Spécificités',
                champs = {
                    { cle = 'seed', label = 'Seed' },
                    { cle = 'monde', label = 'Type de monde' },
                    { cle = 'spawn', label = 'Spawn' }, -- Champ spécial pour les coordonnées
                    { cle = 'x', label = 'Coordonnée X' },
                    { cle = 'y', label = 'Coordonnée Y' },
                    { cle = 'z', label = 'Coordonnée Z' }
                }
            },
            {
                titre = 'Informations',
                champs = {
                    { cle = 'status', label = 'Status' },
                    { cle = 'difficulte', label = 'Difficulté' }
                }
            }
        }
    }
}

return configs