« Module:Infobox/Configs/Plugin » : différence entre les versions
De Nefald
Autres actions
correction type |
Aucun résumé des modifications |
||
| Ligne 19 : | Ligne 19 : | ||
return nil | return nil | ||
end, | end, | ||
sections = { | sections = { | ||
{ | { | ||
champs = { | champs = { | ||
{ cle = 'type', label = 'Type' }, | { cle = 'type', label = 'Type', | ||
process = function(value, args) | |||
local types = { | |||
['économie'] = 'Économie', | |||
['pvp'] = 'PvP', | |||
['roleplay'] = 'Roleplay', | |||
['administration'] = 'Administration', | |||
['protection'] = 'Protection', | |||
['cosmétique'] = 'Cosmétique', | |||
['communication'] = 'Communication', | |||
['utilitaire'] = 'Utilitaire', | |||
['mini-jeu'] = 'Mini-jeu', | |||
['monde'] = 'Monde', | |||
['inventaire'] = 'Inventaire', | |||
['transport'] = 'Transport', | |||
['magie'] = 'Magie', | |||
['mob'] = 'Mob' | |||
} | |||
return types[value] or value | |||
end | |||
}, | |||
{ cle = 'dev', label = 'Développeur' }, | { cle = 'dev', label = 'Développeur' }, | ||
{ cle = 'status', label = 'Statut' }, | { cle = 'status', label = 'Statut' }, | ||
| Ligne 96 : | Ligne 52 : | ||
titre = 'Téléchargements', | titre = 'Téléchargements', | ||
champs = { | champs = { | ||
{ cle = 'bukkit', label = 'Bukkit' }, | { cle = 'bukkit', label = 'Bukkit', | ||
{ cle = 'hangar', label = 'Hangar (PaperMC)' }, | process = function(value) | ||
{ cle = 'modrinth', label = 'Modrinth' }, | return value and '[https://dev.bukkit.org/projects/' .. value .. ' Bukkit]' or nil | ||
{ cle = 'builtbybit', label = 'BuiltByBit' }, | end | ||
{ cle = 'spigot', label = 'Spigot' }, | }, | ||
{ cle = 'hangar', label = 'Hangar (PaperMC)', | |||
process = function(value) | |||
return value and '[https://hangar.papermc.io/projects/' .. value .. ' Hangar]' or nil | |||
end | |||
}, | |||
{ cle = 'modrinth', label = 'Modrinth', | |||
process = function(value) | |||
return value and '[https://modrinth.com/plugin/' .. value .. ' Modrinth]' or nil | |||
end | |||
}, | |||
{ cle = 'builtbybit', label = 'BuiltByBit', | |||
process = function(value) | |||
return value and '[https://builtbybit.com/resources/' .. value .. ' BuiltByBit]' or nil | |||
end | |||
}, | |||
{ cle = 'spigot', label = 'Spigot', | |||
process = function(value) | |||
return value and '[https://www.spigotmc.org/resources/' .. value .. ' Spigot]' or nil | |||
end | |||
}, | |||
{ cle = 'sources', label = 'Code source' } | { cle = 'sources', label = 'Code source' } | ||
} | } | ||
| Ligne 111 : | Ligne 87 : | ||
} | } | ||
} | } | ||
} | }, | ||
-- Ajout des catégories automatiques selon le type | |||
categories = function(args, config, frame) | |||
local cats = {} | |||
-- Catégorie générale | |||
table.insert(cats, 'Plugins Minecraft') | |||
-- Catégorie selon le type | |||
if args.type then | |||
local typeCategories = { | |||
['économie'] = 'Plugins d\'économie', | |||
['pvp'] = 'Plugins de PvP', | |||
['roleplay'] = 'Plugins de roleplay', | |||
['administration'] = 'Plugins d\'administration', | |||
['protection'] = 'Plugins de protection', | |||
['cosmétique'] = 'Plugins cosmétiques', | |||
['communication'] = 'Plugins de communication', | |||
['utilitaire'] = 'Plugins utilitaires', | |||
['mini-jeu'] = 'Plugins de mini-jeux', | |||
['monde'] = 'Plugins de monde', | |||
['inventaire'] = 'Plugins d\'inventaire', | |||
['transport'] = 'Plugins de transport', | |||
['magie'] = 'Plugins de magie', | |||
['mob'] = 'Plugins de mobs' | |||
} | |||
if typeCategories[args.type] then | |||
table.insert(cats, typeCategories[args.type]) | |||
end | |||
end | |||
return cats | |||
end | |||
} | } | ||
return config | return config | ||