« Module:Infobox/Entreprise de jeux vidéo » : différence entre les versions

De Les Archives de Vault-Tec
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Kharmitch (discussion | contributions)
mAucun résumé des modifications
Ligne 1 : Ligne 1 :
local localdata = require( 'Module:Infobox/Localdata' )
local localdata = require( 'Module:Infobox/Localdata' )
local abb = require( 'Module:Abréviation' )
 
local tools = require( 'Module:Outils' )
local tools = require( 'Module:Outils' )


Ligne 6 : Ligne 6 :
-----        Calcul des champs à afficher        -----
-----        Calcul des champs à afficher        -----
--------------------------------------------------------
--------------------------------------------------------
-- Développeur et Éditeur
local developer = localdata['développeur']
local editor = localdata['éditeur']
if developer or editor then
local abb = require( 'Module:Abréviation' )
if developer then
developer = abb.links({ developer, ['séparateur'] = '<br/>' })
end
if editor then
editor = abb.links({ editor, ['séparateur'] = '<br/>' })
end
end


-- MobyGames
-- MobyGames
Ligne 33 : Ligne 47 :
}},
}},
{ type = 'table', title = "Série ''Fallout''", rows = {
{ type = 'table', title = "Série ''Fallout''", rows = {
{ type = 'row', label = 'Développeur', value = function(localdata) return abb.links({ localdata['développeur'] }) end  },
{ type = 'row', label = 'Développeur', value = function() return developer end  },
{ type = 'row', label = 'Éditeur', value = function(localdata) return abb.links({ localdata['éditeur'] }) end }
{ type = 'row', label = 'Éditeur', value = function() return editor end }
}},
}},
{ type = 'table', title = 'Autres jeux', rows = {
{ type = 'table', title = 'Autres jeux', rows = {
Ligne 43 : Ligne 57 :
{ type = 'row', label = 'Site officiel', value = 'site officiel' },
{ type = 'row', label = 'Site officiel', value = 'site officiel' },
{ type = 'row', label = 'Wikipédia', value = 'wikipédia' },
{ type = 'row', label = 'Wikipédia', value = 'wikipédia' },
{ type = 'row', label = 'MobyGames', value = function(localdata) return mobygames end }
{ type = 'row', label = 'MobyGames', value = function() return mobygames end }
}},
}},
{ type = 'text', value = 'pied' }
{ type = 'text', value = 'pied' }
}
}
}
}

Version du 1 août 2021 à 19:22

Documentation du module

Ce module contient le paramétrage de l'infobox {{Infobox entreprise de jeux vidéo}}.

local localdata = require( 'Module:Infobox/Localdata' )

local tools = require( 'Module:Outils' )

--------------------------------------------------------
-----         Calcul des champs à afficher         -----
--------------------------------------------------------

-- Développeur et Éditeur
local developer = localdata['développeur']
local editor = localdata['éditeur']
if developer or editor then
	local abb = require( 'Module:Abréviation' )
	
	if developer then
		developer = abb.links({ developer, ['séparateur'] = '<br/>' })
	end
	if editor then
		editor = abb.links({ editor, ['séparateur'] = '<br/>' })
	end
end

-- MobyGames
local mobygames = localdata['mobygames']
if mobygames then
	mobygames = '[' .. mobygames .. ' ' .. tools.simpletitle(mw.getCurrentFrame()) .. ']'
end

--------------------------------------------------------
-----          Construction de l'infobox           -----
--------------------------------------------------------

return {
	parts = {
		{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { subject = 'Entreprise de jeux vidéo' }},
		{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
		{ type = 'table', title = 'Informations', rows = {
			{ type = 'row', label = 'Fondateur', value = 'fondateur' },
			{ type = 'row', label = 'Date de fondation', value = 'date fondation' },
			{ type = 'row', label = 'Date de fermeture', value = 'date fermeture' },
			{ type = 'row', label = 'Siège social', value = 'siège social' },
			{ type = 'row', label = 'Personnalités', value = 'personnalités' }
		}},
		{ type = 'table', title = 'Entreprises connexes', rows = {
			{ type = 'row', label = 'Société mère', value = 'société mère' },
			{ type = 'row', label = 'Filiales', value = 'filiales' }
		}},
		{ type = 'table', title = "Série ''Fallout''", rows = {
			{ type = 'row', label = 'Développeur', value = function() return developer end  },
			{ type = 'row', label = 'Éditeur', value = function() return editor end }
		}},
		{ type = 'table', title = 'Autres jeux', rows = {
			{ type = 'row', label = 'Développeur', value = 'autre développeur' },
			{ type = 'row', label = 'Éditeur', value = 'autre éditeur' }
		}},
		{ type = 'table', title = 'Liens externes', rows = {
			{ type = 'row', label = 'Site officiel', value = 'site officiel' },
			{ type = 'row', label = 'Wikipédia', value = 'wikipédia' },
			{ type = 'row', label = 'MobyGames', value = function() return mobygames end }
		}},
		{ type = 'text', value = 'pied' }
	}
}