(Bon déjà ça ça sert à rien) |
(Oui ?) |
||
Ligne 4 : | Ligne 4 : | ||
local args = f:getParent().args |
local args = f:getParent().args |
||
local dlc = mw.text.split( args[1], '%s' ) |
local dlc = mw.text.split( args[1], '%s' ) |
||
+ | |||
⚫ | |||
+ | if args[2] then |
||
⚫ | |||
+ | end |
||
if bp == 'bp' then --[[ si le 2ème paramètre est bp, le dlc est automatiquement Afterbirth+ ]] |
if bp == 'bp' then --[[ si le 2ème paramètre est bp, le dlc est automatiquement Afterbirth+ ]] |
Version du 4 mai 2017 à 16:10
Fonction
| |
---|---|
Utilisée par le Modèle:Dlc. Cette fonction renvoie un icône de DLC et vérifie sa cohérence avec la page utilisée. | |
Arguments | Renvois |
|
|
Fonction
| |
---|---|
Cette fonction renvoie une icône de DLC et est destinée à être utilisée dans des modules ou modèles. | |
Arguments | Renvois |
|
|
La documentation ci-haut est transcluse de Module:Dlc/doc. (modifier | historique)
local p = {}
function p.main( f )
local args = f:getParent().args
local dlc = mw.text.split( args[1], '%s' )
if args[2] then
local bp = mw.text.split( args[2], '%s' )
end
if bp == 'bp' then --[[ si le 2ème paramètre est bp, le dlc est automatiquement Afterbirth+ ]]
return '<span title="Booster Pack ' .. f:getParent().bp[2] .. '-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Booster_Pack_Indicator.png|lien=]]</span>'
elseif dlc[1] == 'a' then
return '<span title="Afterbirth-contenu exclusif" style="cursor:help">[[Fichier:DLC.png|lien=]]</span>'
elseif dlc[1] == 'no-a' then
return '<span title="Rebirth-contenu exclusif" style="cursor:help">[[Fichier:NoDLC_Indicator.png|lien=]]</span>'
elseif dlc[1] == 'a+' then
return '<span title="Afterbirth †-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Indicator.png|lien=]]</span>'
elseif dlc[1] == 'no-a+' then
return '<span title="Rebirth-contenu exclusif" style="cursor:help">[[Fichier:NoDLC†_Indicator.png|lien=]]</span>'
elseif dlc[1] == 'a-no-a+' then
return '<span title="Afterbirth-contenu exclusif" style="cursor:help">[[Fichier:DLC.png|lien=]]</span><span title="Afterbirth-contenu exclusif" style="cursor:help">[[Fichier:NoDLC†_Indicator.png|lien=]]</span>'
elseif dlc[1] == 'bp' then
return '<span title="Booster Pack ' .. f:getParent().dlc[2] .. '-contenu exclusif" style="cursor:help">[[Fichier:Booster_Pack_Indicator.png|lien=]]</span>'
else
return nil
end
end
function p.icon( f )
local args = mw.text.split( f, '%s' )
if args[1] ~= nil or dlc ~= '' then
if args[1] == 'Afterbirth' then
return '<span title="Afterbirth-contenu exclusif" style="cursor:help">[[Fichier:DLC.png|lien=]]</span>'
elseif args[1] == 'Afterbirth+' then
return '<span title="Afterbirth †-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Indicator.png|lien=]]</span>'
elseif args[1] == 'Booster' then
return '<span title="Booster Pack ' .. args[3] .. '-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Booster_Pack_Indicator.png|lien=]]</span>'
--[[ args[3] car args[1]=="Booster" et args[2]=="Pack" (lié au mw.text.split) ]]
else
return nil
end
end
end
return p