Module:Infobox/Matériau

De Starfield Wiki
Révision datée du 18 janvier 2023 à 09:01 par Kims (discussion | contributions) (Page créée avec « local localdata = require('Module:Infobox/Localdata') local keyWords = { ['minerai'] = { subject = 'Minerai', link = 'Minerais' }, } function buildSubHead(localdata, keyWordType, default) local subhead = default if localdata['type'] and keyWords[localdata['type']:lower()] then local keyWord = keyWords[localdata['type']:lower()] if keyWord then subhead = keyWord[keyWordType] end end return subhead end return { parts = { { type = 'title', val... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Documentation[voir] [modifier] [purger]
local localdata = require('Module:Infobox/Localdata')

local keyWords = {
	['minerai']    = { subject = 'Minerai', link = 'Minerais' },
}

function buildSubHead(localdata, keyWordType, default)
	local subhead = default
	if localdata['type'] and keyWords[localdata['type']:lower()] then
		local keyWord = keyWords[localdata['type']:lower()]
		if keyWord then
			subhead = keyWord[keyWordType]
		end
	end
	return subhead
end

return {
	parts = {
		{ type = 'title', value = 'nom', subtitle = 'sous-titre', icon = 'icône', subhead = { games = 'jeux', subject = buildSubHead(localdata, 'subject', 'Objet'), link = buildSubHead(localdata, 'link', 'Objets') }},
		{ type = 'images', imageparameters = { 'image', 'image2', 'image3', 'image4', 'image5' }, captionparameter = { 'légende', 'image desc' }},
		{ type = 'table', title = 'Propriétés', rows = {
			{ type = 'row', label = 'Utilisations', value = 'utilisations' },
			{ type = 'row', label = 'Poids', value = { 'poids', 'masse' }},
			{ type = 'row', label = 'Valeur', value = 'valeur' },
			{ type = 'row', label = 'Effets', value = 'effets' }
		}},
		{ type = 'table', title = 'Artisanat', rows = {
			{ type = 'row', label = 'Plan', value = 'plan' },
			{ type = 'row', label = 'Composant de', value = 'composant de' },
			{ type = 'row', label = 'Débloque', value = 'débloque' },
			{ type = 'row', label = 'Modifie', value = 'modifie' }
		}},
		{ type = 'table', title = 'Quêtes', 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 = 'Editor ID', value = 'editorid' },
			{ type = 'row', label = '[[Form ID|Base ID]]', value = 'baseid' },
		}},
		{ type = 'row', label = 'Variante', value = 'variante' },
		{ type = 'images', imageparameters = 'emplacement', captionparameter = 'emplacement desc', defaultcaption = 'Emplacement' },
		{ type = 'text', value = 'pied' }
	}
}