Module:Infobox/Lieu
Ce module contient le paramétrage de l'infobox {{Infobox lieu}}.
local localdata = require('Module:Infobox/Localdata')
function buildSubject(localdata)
local subject = 'Lieu'
if localdata['type'] then
local types = {
['aéroport'] = 'Aéroport',
['bâtiment'] = 'Bâtiment',
['bunker'] = 'Bunker',
['colonie'] = 'Colonie',
['grande colonie'] = 'Colonie',
['colonie moyenne'] = 'Colonie',
['petite colonie'] = 'Colonie',
['non marqué'] = 'Lieu non marqué',
['égout'] = 'Égout',
['abri'] = 'Abri',
['gare'] = 'Gare',
['métro'] = 'Métro',
['usine'] = 'Usine',
['monument'] = 'Monument',
['dirigeable'] = 'Dirigeable',
['grotte'] = 'Grotte',
['région'] = 'Région',
['état'] = 'État',
['pays'] = 'Pays'
}
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 = {
['aéroport'] = 'Icone_avion.png',
['bâtiment'] = 'Icon building.png',
['bunker'] = 'FO76 Icone bunker.png',
['grotte'] = 'Icon cave.png',
['observation'] = 'Icon_lookout_tower.png',
['district'] = 'Icon district.png',
['grandes ruines'] = 'Icon district.png',
['usine'] = 'Icon factory.png',
['gare'] = 'Icon_train.png',
['métro'] = 'Icon metro.png',
['militaire'] = 'Icon military.png',
['monument'] = 'Icon monument.png',
['ruines'] = 'Icon ruins.png',
['section'] = 'Icon section.png',
['colonie'] = 'Icon settlement medium.png',
['grande colonie'] = 'Icon settlement large.png',
['colonie moyenne'] = 'Icon settlement medium.png',
['petite colonie'] = 'Icon settlement small.png',
['égout'] = 'Icon sewer.png',
['tunnel'] = 'Icon sewer.png',
['non marqué'] = 'Icon unmarked.png',
['abri'] = 'Icon vault.png',
['repère'] = 'Icon landmark.png',
['pillards'] = 'FO76 icone pillards.png'
}
icon = types[localdata['type']:lower()] or icon
end
return icon
end
return {
parts = {
{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = function(localdata) return buildIcon(localdata) end, subhead = { games = 'jeux', subject = buildSubject(localdata), link = 'Lieux' }},
{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
{ type = 'table', title = 'Emplacement', rows = {
{ type = 'row', label = 'Marqueur', value = 'marqueur' },
{ type = 'row', label = 'Partie de', value = 'partie de' },
{ type = 'images', imageparameters = 'image marqueur', captionparameter = 'image marqueur desc' }
}},
{ type = 'table', title = 'Segments', rows = {
{ type = 'row', label = 'Sections', value = 'sections' },
{ type = 'row', label = 'Bâtiments', value = 'bâtiments' }
}},
{ type = 'table', title = 'Population', rows = {
{ type = 'row', label = 'Factions', value = 'factions' },
{ type = 'row', label = 'Propriétaires', value = 'propriétaires' },
{ type = 'row', label = 'Chefs', value = { 'leaders', 'chefs' }},
{ type = 'row', label = 'Médecins', value = { 'docteurs', 'médecins' }},
{ type = 'row', label = 'Marchands', value = 'marchands' },
{ type = 'row', label = 'Habitants', value = 'habitants' },
{ type = 'row', label = 'Établis', value = 'établis' }
}},
{ type = 'table', title = 'Autres acteurs', rows = {
{ type = 'row', label = 'Créatures', value = 'créatures' },
{ type = 'row', label = 'Robots', value = 'robots' }
}},
{ type = 'table', title = 'Connexions', rows = {
{ type = 'row', label = 'Connecté à', value = 'connecté à' },
{ type = 'row', label = 'Sorties de métro', value = 'sorties métro' },
{ type = 'row', label = 'Sorties monde', value = { 'sorties world map', 'sorties monde' } },
{ type = 'row', label = 'Autres sorties', value = 'autres sorties' }
}},
{ type = 'table', title = 'Autre', rows = {
{ type = 'row', label = 'Quêtes', value = 'quêtes' },
{ type = 'row', label = 'Événements', value = 'événements' }
}},
{ type = 'table', title = 'Technique', collapseparameters = { collapsible = true, collapsed = true }, rows = {
{ type = 'row', label = 'Nom .map', value = 'nom map' },
{ type = 'row', label = 'Cellule', value = 'nom cellule' },
{ type = 'row', label = '[[Form ID|Ref ID]]', value = 'refid' },
{ type = 'row', label = 'Terminaux', value = 'terminaux' }
}},
{ type = 'images', imageparameters = 'carte locale', captionparameter = 'carte locale desc' },
{ type = 'images', imageparameters = 'carte locale2', captionparameter = 'carte locale2 desc' },
{ type = 'images', imageparameters = 'carte locale3', captionparameter = 'carte locale3 desc' },
{ type = 'images', imageparameters = 'carte locale4', captionparameter = 'carte locale4 desc' },
{ type = 'images', imageparameters = 'carte locale5', captionparameter = 'carte locale5 desc' },
{ type = 'row', label = 'Mentions', value = function(localdata) return require('Module:Abréviation').links({ localdata['mentions'], sep = '<br/>' }) end },
{ type = 'text', value = 'pied' }
}
}