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

De Starfield Wiki
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 2 : Ligne 2 :


-- sujet
-- sujet
local subject = localdata['type'] or 'lieu'
function buildSubject(localdata)
subjects = {
local subject = 'Lieu'
["ville"] = "Ville",
if localdata['type'] then
}
local types = {
subject = subjects[subject] or 'lieu'
['ville']         = 'Ville',
}
subject = types[localdata['type']:lower()] or subject
end
return subject
end
 
function buildIcon(localdata)
local icon = 'Icon landmark.png'
if localdata['icône'] then
icon = localdata['icône']
elseif localdata['type'] then
local types = {
['ville']         = 'Icon ville.png',
}
icon = types[localdata['type']:lower()] or icon
end
return icon
end


return {
return {

Version du 19 juillet 2022 à 08:37

Documentation[voir] [modifier] [purger]
localdata = require( "Module:Infobox/Localdata" )

-- sujet
function buildSubject(localdata)
	local subject = 'Lieu'
	if localdata['type'] then
		local types = {
			['ville']         = 'Ville',
		}
		subject = types[localdata['type']:lower()] or subject
	end
	return subject
end

function buildIcon(localdata)
	local icon = 'Icon landmark.png'
	if localdata['icône'] then
		icon = localdata['icône']
	elseif localdata['type'] then
		local types = {
			['ville']         = 'Icon ville.png',
		}
		icon = types[localdata['type']:lower()] or icon
	end
	return icon
end

return {
	parts = {
		{ type = "title", value = "nom", subtitle = "sous-titre", icon = "icône", subhead = { subject = subject, link = "Starfield" }},
		{ type = "images", imageparameters = { "image", "image2", "image3", "image4", "image5" }, captionparameter = { "légende", "image desc" }},
		{ type = "table", separator = true, rows = {
			{ type = "row", label = "Corporation", value = "corporation" },
		}},
		{ type = "text", value = "pied" }
	}
}