Binding of Isaac: Rebirth Wiki
Advertisement
Template-info Documentation

Fonction main( f )

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.
ArgumentsRenvois
f (frame)
  • Frame de la page utilisée.
  • Nécessite un paramètre non nommé :
    • Type : (string)
    • Abréviation du DLC demandé :
      • a pour Afterbirth
      • a+ pour Afterbirth†
      • bp 1 pour le Booster Pack 1.
  • Type : (string)
  • Icône de DLC correspondant à celle demandée et catégories supplémentaires.

Fonction icone( f )

Cette fonction renvoie une icône de DLC et est destinée à être utilisée dans des modules ou modèles.
ArgumentsRenvois
f (string)
  • Nom du DLC demandé.
  • Type : (string)
  • Icône du DLC correspondant ou catégorie d'erreur.
  • Renvoie une valeur nulle s'il ne possède aucun argument.

local p = {}

function p.main( f )
	local dlc = f:getParent().args[1]
	local n = f:getParent().args[2]
	
	if n ~= nil then
		n = ''
	end
	if dlc == 'a' then
		return '<span title="Afterbirth-contenu exclusif" style="cursor:help">[[Fichier:DLC.png|lien=]]</span>'
	elseif dlc == 'no-a' then
		return '<span title="Rebirth-contenu exclusif" style="cursor:help">[[Fichier:NoDLC_Indicator.png|lien=]]</span>'
	elseif dlc == 'a+' then
		return '<span title="Afterbirth †-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Indicator.png|lien=]]</span>'
	elseif dlc == 'no-a+' then
		return '<span title="Rebirth-contenu exclusif" style="cursor:help">[[Fichier:NoDLC†_Indicator.png|lien=]]</span>'
	elseif dlc == '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 == 'a+ bp' then
		return '<span title="Booster Pack ' .. n .. '-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Booster_Pack_Indicator.png|lien=]]</span>'
	elseif dlc == 'bp' then
		return '<span title="Booster Pack ' .. n .. '-contenu exclusif" style="cursor:help">[[Fichier:Booster_Pack_Indicator.png|lien=]]</span>'
	else
		return nil
	end
	
	return dlc
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 -- args[3] car args[1]=="Booster" et args[2]=="Pack" (lié au mw.text.split)
			return '<span title="Booster Pack ' .. args[3] .. '-contenu exclusif" style="cursor:help">[[Fichier:Afterbirth†_Booster_Pack_Indicator.png|lien=]]</span>'
		else
			return nil
		end
	end
end

return p
Advertisement