Module:Infobox/Objet/Note

De Starfield Wiki
Révision datée du 10 septembre 2023 à 12:54 par Kharmitch (discussion | contributions) (Correction sur le nom d'une variable)
Documentation[voir] [modifier] [purger]
local general = require("Module:Infobox/Fonctions")
local localdata = require("Module:Infobox/Localdata")

-- Support de la note (par défaut : tablette)
medium = function(localdata)
	local medium = localdata["support"] or "tablette"
	local MEDIUMS = {
		tablette = {"Tablette", "SF Tablette.png"},
	}
	local medium_config = MEDIUMS[medium:lower()]
	if medium_config == nil then
		error(string.format(
			"Valeur inconnue du paramètre « support » : « %s »",
			medium
		))
	end
	return string.format(
		"[[Fichier:%s|x25px|alt=|link=|class=notpageimage]] %s",
		medium_config[1],
		medium_config[2]
	)
end

return {
    parts = {
        general.title(),
        general.image(),
        {
            type = "table",
            separator = true,
            rows = {
                {type = "row", label = "Support", value = medium},
                {type = "row", label = "Emplacement", value = "emplacement"},
            },
        },
        general.creation_kit(),
    }
}