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[]
<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}})
(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.
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.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 | FO4chaine01 | FO4chaine02 | |||
FO4chaine03 | FO4clé01 | FO4clé02 | |||
FO4clé03 | FO4clégen | FO4holo | |||
FO4note | FO4vaultid | acide | |||
action | adore | agi | |||
aime | aimepas | alcool | |||
aléatoire | ambre | android | |||
apparition | apple | aptlégendaire | |||
ar | armelourde | armorwb | |||
artisanat | asservissable | atelier | |||
atelierpublic | atome | attaque | |||
aucunéchange | bf | bigger gun | |||
boisson | bouclierargent | bouclierbronze | |||
bouclieror | boîteàsandwich | bricolage | |||
bugged unav | ca | cadence régénération | |||
cadencedetir | cal12 | camp | |||
capachargeur | capacité | caps | |||
caravan | cartes | cerveau | |||
chance | chef | chems | |||
chimie | chr | compagnon | |||
confiance | contondant | corps à corps | |||
coupé | crit | croix | |||
cryo | crédit | cœur | |||
d20 | Fichier:Gammetitle-D20.png | dial | dialogue | ||
dispersion | distance | docteur | |||
dpa | dps | dur | |||
défense | dégâts | détect | |||
détection | déteste | effet | |||
effet bonus | effet crit | end | |||
essentiel | explosion | expérience | |||
fbgcritter | fbgdieablhits | ||||
fbgendurance | fbghit | fbghuman | |||
fbgintelligence | fbgloot | fbgluck | |||
fbgmonster | fbgperception | fbgquest | |||
fbgradiation | fbgranged | fbgretreat | |||
fbgrobot | fbgsecurity | fbgsettlement | |||
fbgstrength | fbgsupermutant | fbgvault109 | |||
fbgvault84 | fbgwasteland | fbgweapon | |||
feu | film | fjp | |||
fjpagenda | fjpagilité | fjpagressif | |||
fjparmure | fjpasset | fjpcharisme | |||
fjpcompagnon | fjpdangereux | fjpliberté | |||
fjpmortel | fjpnc | fjptenue | |||
fjpww | fnv | fnvcs | |||
fnvdm | fnvgra | fnvhh | |||
fnvlr | fnvowb | fo | |||
fo1 | fo1st | fo2 | |||
fo3 | fo3bs | fo3mz | |||
fo3oa | fo3pl | fo3tp | |||
fo4 | fo4aut | fo4cc | |||
fo4cw | fo4fh | fo4nw | |||
fo4vr | fo4vw | fo4ww | |||
fo76 | fo76fw | fo76ll | |||
fo76lr | fo76nw | fo76ow | |||
fo76sd | fo76sr | fo76tp | |||
fo76ts | fo76wa | fo76wl | |||
fobos | fobos2 | foodpr | |||
fool | for | fos | |||
foso | fot | fot2 | |||
fow | foww | fox | |||
fpb | fusil | fww | |||
fwwrpg | féminin | gamerscore | |||
gaz | gelé | gratuit | |||
grenade | groupe | haché | |||
iem | image | indifférent | |||
info | int | ||||
inutilisé | ios | jce | |||
jcj | jes | jeu | |||
jeupb | lame | laser | |||
lh | lieu | limité | |||
lingot | lingot d'or | ||||
légendaire | mac | macclassic | |||
mains nues | maladie | marchand | |||
masculin | mentionné | mine | |||
mitraille | mitraillette | mod | |||
mort | moulinexpl | munitions | |||
munitions2 | mutation | muter | |||
myspace | neutre | niveau | |||
non | note | nourriture | |||
nouveau | nukamix | nw | |||
opposums | opposums sombre | opquotidiennes | |||
optionnel | oui | oui1 | |||
ouibrun | pa | pc | |||
pe | per | pistolet | |||
plasma | platine | poids | |||
poing | poison | poison2 | |||
portée | posarmass | poscuis | |||
pourcent | prochainement | présent | |||
ps3 | ps4 | pv | |||
pv13 | question | quête | |||
radiations | raidabri | rareté | |||
ratio | rd | requis | |||
rouge | régénération | réparable | |||
répéter | réticule | saison | |||
saisonnier | sang | santé | |||
score | scout | sd | |||
seau | semi | semirequis | |||
sic | soda | son | |||
spooky | stimpak | survie | |||
switch | séquence | tar | |||
temporaire | tempslimité | texte | |||
thé | torn | trophéeargent | |||
trophéebronze | trophéeor | tumblr | |||
twitch | têtard | ||||
têtard sombre | v76 | vaulttec | |||
vb | vert | vt | |||
wiki | wild wasteland | windows | |||
ww | xbox360 | xboxone | |||
électrique | énergie | établiarmes | |||
établirobot | étoile | évènement | |||
évènementpublic | œil |
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