L'Abri
S'inscrire
Advertisement

Modèle pour afficher de petites icônes.

Utilisation[]

{{Icône|nom de l'icône}}

Afin de mettre à jour les icônes disponibles, le module Icon nécessite un nouveau paramètre dans les listes iconTip (default tooltip) et gameIcon (icon filename).

Paramètres[]

Oui
<unnamed 1>
Quelle icône devrait être affichée. Les icônes multiples peuvent être listées en les séparant par une virgule. ({{Icône|FO1,FO2,FO3}})
Neutre
(défaut: "x14px")
<unnamed 2>
Spécifie la taille de l'icône. Celle-ci peut être paramétrée par un préréglage, ou donnée directement sous forme de valeur en pixels (même syntaxe que pour spécifier la taille d'une image).

Les préréglages sont :

  • petit: Les icônes seront affichées à 10px de hauteur.
  • medium/normal: Les icônes seront affichées à 14px de hauteur.
  • gros: Les icônes seront affichées à 20px de hauteur.
Neutre
lien
La page vers laquelle le lien doit pointer (sans clôturer avec "[[]]"). Si l'infobulle n'est pas spécifiée, c'est également utilisé en tant que texte d'infobulle.
Neutre
infobulle
Le texte d'infobulle affiché lors d'un survol de l'icône. Surcharge le texte par défaut de l'icône.

Icônes disponibles[]

prefix Icon prefix Icon prefix Icon
FNVTD Icon wildwasteland FO4chaine01 Icon Fo4 chain01 FO4chaine02 Icon Fo4 chain02
FO4chaine03 Icon Fo4 chain03 FO4clé01 Icon Fo4 key01 FO4clé02 Icon Fo4 key02
FO4clé03 Icon Fo4 key03 FO4clégen Icon Fo4 gen keycard FO4holo Icon Fo4 holotape
FO4note Icon Fo4 note FO4vaultid Icon Fo4 vaultid acide Icon acid
action Icon action adore Love agi FO76 A
aime Like aimepas Dislike alcool FO76 Alcohol Icon
aléatoire FO76 ui roleplay team ambre Icon amber android Icon android
apparition Icon spawn apple Icon appleios aptlégendaire FO76 Perk coin
ar Gametitle-AR armelourde Icon heavy weapon armorwb Fo4 Armor Work Icon
artisanat Icon crafting asservissable Icon cage atelier Icon workshop
atelierpublic Icon Public Workshop atome FO76 Atom Currency 2 attaque Icon attack
aucunéchange Icon NoTrade bf Gametitle-FB bigger gun Icon big gun
boisson FO76 Drink Icon bouclierargent Icon shield silver bouclierbronze Icon shield bronze
bouclieror Icon shield gold boîteàsandwich FO76 Lunchbox Icon bricolage FO76 vaultboy licensedplumber 01
bugged unav Radroach ca Icon shield bronze cadence régénération Icon healing
cadencedetir FO76 UI icon Ammo custom cal12 Icon shotgun camp FO76 ui extra team
capachargeur Icon mag capacité Icon ability caps Caps
caravan Icon cards cartes Icon cards cerveau Brain icon
chance FO76 L chef FoS Boss chems FO76 Chems Icon
chimie Fo4 Chem Work Icon chr FO76 C compagnon NW icon ally
confiance Icon confidence contondant Icon blunt corps à corps Icon melee
coupé Icon cut crit Icon critical damage croix Icon cross
cryo Icon cryo crédit Credits icon cœur Icon heart
d20 Fichier:Gammetitle-D20.png dial Icon dialogue dialogue Icon dialogue
dispersion Icon spread distance Icon range docteur Icon doctor
dpa Icon dap dps Icon dps dur Icon limitedtime
défense Icon shield silver dégâts Icon damage détect Icon eye
détection Icon eye déteste Hate effet Icon effect
effet bonus Icon bonus effect effet crit Icon crit effect end FO76 E
essentiel Icon essential explosion Icon explosion expérience Icon XP
facebook FacebookIcon fbgcritter FBG Critter icon fbgdieablhits FBG Die ABL Hits
fbgendurance FBG E icon fbghit FBG Hit icon fbghuman FBG Human icon
fbgintelligence FBG I icon fbgloot FBG Loot icon fbgluck FBG L icon
fbgmonster FBG Monster icon fbgperception FBG P icon fbgquest FBG Quest objective
fbgradiation FBG Radiation icon fbgranged FBG Ranged icon fbgretreat FBG Retreat icon
fbgrobot FBG Robot icon fbgsecurity FBG Defender icon fbgsettlement FBG Settlement icon
fbgstrength FBG S icon fbgsupermutant FBG Super Mutant icon fbgvault109 FBG Vault 109 icon
fbgvault84 FBG Vault 84 icon fbgwasteland FBG Wasteland icon fbgweapon FBG Weapon icon
feu Icon fire film Film fjp Gametitle-FBG
fjpagenda FBG Agenda icon fjpagilité FBG A icon fjpagressif FBG Aggressive icon
fjparmure FBG Armor icon fjpasset FBG Asset icon fjpcharisme FBG C icon
fjpcompagnon FBG Companion icon fjpdangereux FBG Dangerous icon fjpliberté FBG Freedom icon
fjpmortel FBG Deadly icon fjpnc Gametitle-FBGNC fjptenue FBG Apparel icon
fjpww Gametitle-FBGWW fnv Gametitle-FNV fnvcs Gametitle-FNV CS
fnvdm Gametitle-FNV DM fnvgra Gametitle-FNV GRA fnvhh Gametitle-FNV HH
fnvlr Gametitle-FNV LR fnvowb Gametitle-FNV OWB fo Gametitle-FO1
fo1 Gametitle-FO1 fo1st FO1st fo2 Gametitle-FO2
fo3 Gametitle-FO3 fo3bs Gametitle-FO3 BS fo3mz Gametitle-FO3 MZ
fo3oa Gametitle-FO3 OA fo3pl Gametitle-FO3 PL fo3tp Gametitle-FO3 TP
fo4 Gametitle-FO4 fo4aut Gametitle-FO4 AUT fo4cc Gametitle-FO4 CC
fo4cw Gametitle-FO4 CW fo4fh Gametitle-FO4 FH fo4nw Gametitle-FO4 NW
fo4vr Gametitle-FO4VR fo4vw Gametitle-FO4 VW fo4ww Gametitle-FO4 WW
fo76 Gametitle-FO76 fo76fw Gametitle-FO76 FW fo76ll Gametitle-FO76 Locked n Loaded
fo76lr Gametitle-FO76 LR fo76nw Gametitle-FO76 NW fo76ow Gametitle-FO76 One Wasteland
fo76sd Gametitle-FO76 Steel Dawn fo76sr Gametitle-FO76 Steel Reign fo76tp Gametitle-FO76 TP
fo76ts Gametitle-FO76 TS fo76wa Gametitle-FO76 WA fo76wl Gametitle-FO76 WL
fobos Gametitle-FOBOS fobos2 Gametitle-FOBOS2 foodpr Icon fo4cw builder
fool PV13 for FO76 S fos Gametitle-FOS
foso Gametitle-FOSO fot Gametitle-FOT fot2 Gametitle-FOT2
fow Gametitle-FOW foww Gametitle-FWW fox Gametitle-FOX
fpb Gametitle-FPB fusil Icon rifle fww Gametitle-FWW
fwwrpg Gametitle-FWWRPG féminin Female-gender-sign gamerscore Gamerscore
gaz Icon gas gelé Icon effect gratuit ATX FREE
grenade FO76 iconwheel grenade groupe Icon group haché Fire axe icon color
iem Icon EMP image Icon image indifférent Neutral
info Icon info instagram Instagram icon int FO76 I
inutilisé Icon unused ios Icon appleios jce FO76 ui casual team
jcj FO76 ui workshopraid team jes Gametitle-JES jeu FO76 ui roleplay team
jeupb Fo4 Pip-Boy game lame Icon blade laser Icon laser
lh Gametitle-LH lieu FO76 ui exploration team limité YOU SHOULD BUY THIS
lingot Fo76 Icon Gold Bullion lingot d'or Fo76 Icon Gold Bullion linkedin Linkedin icon
légendaire Icon legendary mac Icon mac macclassic Icon mac
mains nues Icon unarmed maladie Icon disease marchand FO76 ui trading team
masculin Male-gender-sign mentionné Icon mentioned mine FO76 iconwheel minefrag
mitraille FO76 Scrip mitraillette Icon smg mod Icon plus
mort Icon dead moulinexpl Icon fo4cw builder munitions Icon ammo
munitions2 Icon ammo01 mutation FO76 Mutation Icon muter FO76 vaultboy dna
myspace Myspace icon neutre Icon neutral niveau Icon level
non Icon cross note Icon Fo4 note nourriture Fallout 76 Food Icon
nouveau ATX NEW nukamix Icon Nuka-mixer station nw FO76NW Vault 51 icon
opposums FO76 Possum badge blue opposums sombre FO76 Possum badge opquotidiennes FO76 ui dailyops team
optionnel Icon optional oui Icon check oui1 Icon CheckYellowShadowed
ouibrun Icon check temp pa Icon ap pc Icon pc
pe Icon XP per FO76 P pistolet FO76 iconwheel pistol
plasma Icon plasma platine Plat poids FO76 icon weight
poing Icon fist poison Icon poison poison2 Poison Icon
portée Icon range posarmass Fo4 Power Work Icon poscuis Fo4 Cook Work Icon
pourcent FO76 ui roleplay team prochainement Mbox upcoming présent FO76 Present Icon
ps3 Icon ps3 ps4 Icon ps4 pv Icon heart
pv13 PV13 question Icon question quête FO76 ui icon quest
radiations Icon radiation raidabri Vault Raids rareté Icon rarity
ratio Icon ratio rd Icon shield silver requis Icon required
rouge Icon red régénération Icon healing réparable FO76 ui workshop team
répéter Icon repeat réticule Icon attack saison FO76 scoresprite seasons
saisonnier FO76 Quest Old Man Winter sang Icon bleed santé Icon heart
score FO76 scoresprite seasons scout FO76 Pioneer Scouts sd Icon shield gold
seau Icon FO76 mole miner pail semi Icon semi-required semirequis Icon semi-required
sic Icon sic soda FO76 Soda Icon son Icon sound
spooky FO76 candyBowl MapIcon stimpak FO76 Stimpak Icon survie FO76 icon roadmap survival
switch Nintendo Switch icon séquence Icon sequence tar Gametitle-TAR
temporaire Icon check temp tempslimité Icon limitedtime texte Icon text
thé FO76 Drink Tea Icon torn Gametitle-TORN trophéeargent Silver
trophéebronze Bronze trophéeor Gold tumblr Tumblr Icon
twitch Twitch icon twitter Twitter icon têtard FO76 Tadpole badge blue
têtard sombre FO76 Tadpole badge v76 FO76 Vault 76 icon vaulttec Icon vaulttec
vb Gametitle-VB vert Icon green vt Icon vaulttec
wiki Gametitle-Wiki wild wasteland Icon wildwasteland windows Icon windows
ww Icon wildwasteland xbox360 Icon xbox360 xboxone Icon xboxone
électrique Icon electrical énergie Icon electrical établiarmes Fo4 Weapon Work Icon
établirobot Icon robot workbench étoile Icon legendary évènement FO76 icon map event
évènementpublic FO76 icon map public event œil Icon eye

De plus, toutes les abréviations gérées par {{Abr}} peuvent être utilisée pour afficher une icône correspondante à un jeu.


local p = {}
local util = require( 'Module:Util' )
--[[
	Icon data is now stored on the sub page /data to seperate functional code
	for the dataset users will often need to update. This reduces the risk of
	breaking the code by entering data in the wrong place and makes it easier to
	manage the code itself by not having to pass through the large dataset at 
	the top.
]]

require( 'Module:Icons/data' ) 

local iconSize = {
    --[[
        All sizes are controlled on the height to ensure a string of icons maintain 
        a consistent line height
    ]]
    ["petit"]           = "x10px",
    ["medium"]          = "x14px",
    ["normal"]          = "x14px",
    ["gros"]             = "x20px",
}

--[[ 28/Oct/2021 Added class control table to array as to handle light/dark 
	themes. This was originally put into the frontend template, when class
	handling should be back end. Adding the ['class'] = 'light' or 
	['class'] = 'dark' parameter to a icon's dataset on /data will enable it to
	access a class if needed.
	]]

--[[ 08/Nov/2021 Remove the class definition as to be able to just pass straight through
local class = {
	['light'] = 'lighticon',
	['dark'] = 'darkicon',
	['general'] = 'generalicon'
}
]]

function _generate(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize)
	local parserError = ''
    if util.exists(iconSetting)  then 
    	iconSetting = util.trim(iconSetting)
        if util.exists(iconSize[iconSetting]) then
            iconSetting = iconSize[iconSetting]
        end
    else
        iconSetting = iconSize["moyen"]
    end
    
    if util.exists(iconLinks) then
        iconLinks = mw.text.split(iconLinks, ",")
    end
        
    if util.exists(tipOverride) then
        tipOverride = mw.text.split(tipOverride, ",")
    end
    
    if util.exists(iconClass)then
    	iconClass = "|classe=" .. tostring(iconClass);
    else
    	iconClass = ""
    end

    local result = ""

    for k, v in ipairs(iconList) do
        newIcon = iconData[util.trim(v)]
        if util.exists(newIcon) then
            currentIcon = newIcon.icon
            if util.exists(tipOverride, k) then
                currentTip = tipOverride[k]
            else
                if util.exists(iconLinks, k) then
                    currentTip = iconLinks[k]
                else
                    currentTip = newIcon.tip
                end
            end
        else
            currentIcon = "Icon question.png"
            currentTip = "Unrecognized icon name"
            result = result .. "[[Catégorie:Modules avec des paramètres invalides]]"
        end
        
        --Create wikitext icon
		dataLine = '[[File:' .. currentIcon .. '|' .. iconSetting
        if util.exists(iconLinks, k) then
            dataLine = dataLine .. '|lien=' .. iconLinks[k]
        else
            dataLine = dataLine .. '|lien='
        end
        if currentTip ~= nil then
            dataLine = dataLine .. '|' .. currentTip
        end

        dataLine = dataLine .. iconClass .. ']]'

		createTip = mw.html.create('span')
        	createTip:addClass( 'va-icon' )
        	:attr('title', currentTip)
        	:wikitext(dataLine)
        result = result .. tostring(createTip)
        
        if k < table.getn(iconList) then
        	result = result .. " "
        end
    end
    
    return result .. parserError
end

function p.Icons(frame) 
	--[[All icons are now lower case to reduce script errors from 
	incorrectly entering the icon code in a different case to the list]]
    local iconList = mw.text.split(string.lower(frame.args[1]), ",")
    local iconSetting = frame.args[2]
    local iconLinks = frame.args[3]
    local tipOverride = frame.args[4]
    local iconClass = frame.args[5]	
	local iconSize = {
    	--[[
    	    All sizes are controlled on the height to ensure a string of icons maintain 
	        a consistent line height
    	]]
    	["petit"]           = "x10px",
    	["moyen"]          = "x14px",
    	["normal"]          = "x14px",
    	["gros"]             = "x20px"
	}
    return _generate(iconList, iconSetting, iconLinks, tipOverride, iconClass, iconSize)    
end

function p.plateformes(frame)
	--[[All icons are now lower case to reduce script errors from 
	incorrectly entering the icon code in a different case to the list]]
    local icons = mw.text.split(string.lower(frame.args[1]), ",")
    local result = ""
    
    for k, v in ipairs(icons) do
        currentIcon = iconData[util.trim(v)]
        
        if util.exists(currentIcon, 'platform') == true then
        	
            createSM = mw.html.create('span')
            	createSM:css('display', 'none')
            	:wikitext('[[Has platform::' .. currentIcon.tip .. ']]')
            	:allDone()
            createPlatform = mw.html.create('span')
            	createPlatform:addClass('va-icon')
            		:attr('title', currentIcon.tip)
            		:wikitext('[[File:' 
            			.. currentIcon.icon 
            			.. '|x14px|link=]]')
            		:allDone()
            	--[[ Uncommenting tostring(createSM) below will enable 
            	Semantic Mediawiki data tracking]]
            	result = result .. tostring(createSM) 
            			.. tostring(createPlatform)
            if k < table.getn(icons) then
                result = result .. " "
            end
        end
    end
    if result == '' then
        result = '<sup>[Plateformes nécessaires]</sup>[[Catégorie:Plateformes nécessaires]]'
    end
    
    return result
end    

function p.documentation()
    keys = {}
    for k in pairs(iconData) do
        table.insert(keys, k)
    end
 
    table.sort(keys)
    result = '{| class="va-table va-table-full"\n|-\n !prefix!!Icon!!prefix!!Icon!!prefix!!Icon\n|-\n'
    set = 1
    for k,v in ipairs(keys) do
		i = iconData[v]
        result = result .. "||'''" .. v .. "'''"
        if util.exists(i) == true and i.class ~= nil then
        	newFile = mw.html.create(span)
        		--:addClass(class[i.class])
        		:wikitext('[[File:' .. iconData[v].icon .. '|25px]]')
        else
        	newFile = mw.html.create(span)
        		:wikitext('[[File:' .. iconData[v].icon .. '|25px]]')
        end
        result = result .. '||' .. tostring(newFile)
 
        if set == 3 then
            result = result .. '\n|-\n'
        end
 
        if set < 3 then
            set = set + 1
        else
            set = 1
        end
    end
 
    result = result .. '\n|}'
 
    return result
end

function p.Test(frame) 
	--Please empty when done debugging so other users know it is free to use

end

return p
Advertisement