Icon retourne l'icone d'un élément particulier en jeu.
Sur ce Wiki, Icon est utilisé dans :
Utilisation
Modèle
Dans un Modèle : {{#invoke:Icon|function|input1|input2|...}}
Dans des articles : {{Icon|Type|input1|input2|...}}
Module
local p = {}
local Icon = require('Module:Icon')
local function func(iconname, textexist, imagesize)
return Icon._Item(iconname, textexist, imagesize)
end
Documentation
Objets du paquet
Autres objets
Item(iconname, textexist, imagesize)
(function)- Returns the icon for an item.
- Paramètres:
iconname
Item name (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The icon's image in wikitext (string)
_Item(iconname, textexist, imagesize)
(function)- Returns the icon for an item.
- Paramètres:
iconname
Item name (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The icon's image in wikitext (string)
Dis(name, color, size)
(function)- Returns the icon for a weapon's disposition value.
- Paramètres:
name
Disposition value ranging from 0.5 to 1.55 (string)color
Icon color, can be 'White' or 'Black'; defaults to 'Black' (string; optionnel)size
Image size, defaults to '27' (string; optionnel)
- Retours: The icon's image in wikitext (string)
_Dis(name, color, size)
(function)- Returns the icon for a weapon's disposition value.
- Paramètres:
name
Disposition value ranging from 0.5 to 1.55 (string)color
Icon color, can be 'White' or 'Black'; defaults to 'Black' (string; optionnel)size
Image size, defaults to '27' (string; optionnel)
- Retours: The icon's image in wikitext (string)
Affinity(iconname, textexist, imagesize)
(function)- Returns the icon for an affinity type.
- Paramètres:
iconname
Affinity type (e.g. 'Mastery' or 'Clan') (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The icon's image in wikitext (string)
_Affinity(iconname, textexist, imagesize)
(function)- Returns the icon for an affinity type.
- Paramètres:
iconname
Affinity type (e.g. 'Mastery' or 'Clan') (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The icon's image in wikitext (string)
Faction(iconname, textexist, color, imagesize)
(function)- Paramètres:
iconname
Faction type (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)color
Icon color, can be 'White' or 'Black'; defaults to 'Black' (string; optionnel)imagesize
Image size, defaults to 'x20' (string; optionnel)
- Retours: The icon's image in wikitext (string)
Syndicate(iconname, textexist, imagesize)
(function)- Returns the icon for a syndicate.
- Paramètres:
iconname
Syndicate name (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x32' (string; optionnel)
- Retours: The icon's image in wikitext (string)
_Syndicat(syndicName, textexist, imagesize)
(function)- Returns the icon for a Syndicate.
- Paramètres:
syndicName
Syndicate name (string)textexist
If set to 'Text' or 'text', text is added after the Syndicate (string; optionnel)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The Syndicate image in wikitext (string)
HUD(iconname, textexist, color, imagesize)
(function)- Returns the icon for a HUD element.
- Paramètres:
iconname
HUD element name (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)color
Icon color, can be 'White' or 'Black'; defaults to 'Black' (string; optionnel)imagesize
Image size, defaults to 'x20' (string; optionnel)
- Retours: The icon's image in wikitext (string)
Flag(iconname, tooltip, dest, textexist)
(function)- Returns the icon for a real-world country flag.
- Paramètres:
iconname
HUD element name (string)tooltip
If set to 'Text' or 'text', text is added after icon (string)dest
Name of a destination article for linking purposes (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)
- Retours: The icon's image in wikitext (string)
Buff(iconname, textexist, imagesize)
(function)- Returns the icon for a HUD buff or debuff.
- Paramètres:
iconname
Buff name (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x40' (string; optionnel)
- Retours: The icon's image in wikitext (string)
Clan(iconname, imagesize)
(function)- Returns the icon for a Clan tier.
- Paramètres:
iconname
Clan tier name (string)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The icon's image in wikitext (string)
_Clan(iconname, imagesize)
(function)- Returns the icon for a Clan tier.
- Paramètres:
iconname
Clan tier name (string)imagesize
Image size, defaults to 'x26' (string; optionnel)
- Retours: The icon's image in wikitext (string)
KDrive(iconname, textexist, imagesize)
(function)- Returns the icon for a K-Drive.
- Paramètres:
iconname
K-Drive name (string)textexist
If set to 'Text' or 'text', text is added after icon (string; optionnel)imagesize
Image size, defaults to 'x32' (string; optionnel)
- Retours: The icon's image in wikitext (string)
- Documentation automatique créée à l'aide de Docbuntu (-> Modèle automatique)
Voir aussi
Modules and Lua Libraries | ||
---|---|---|
Standard Libraries (STL) | Inclusions | Scribunto (optional bit32 & libraryUtil) |
Extensions | M:Math • M:String • M:Table | |
Base de données | Général | M:Codex (/data) • M:Companions (/data) • M:Conservation (/data) • M:DamageTypes (/data) • M:DojoRoom/data • M:Ennemis (/data) • M:Factions/data • M:FactionScript (/data) • M:GuaranteedRewards/data • M:Icon (/data) • M:Keys/data • M:KeyBindings (/data) • M:Missions (/data) • M:Music/data • M:Upgrades/data • M:Version (/data) |
Warframes | M:Ability (/data) • M:Maximization (/data) • M:Warframes (/data) | |
Armes | M:Modular (/data) • M:Weapons (/data, /ppdata) | |
Améliorations | M:Arcane (/data) • M:Decrets (/data) • M:Focus (/data) • M:Mods (/data) • M:Stances (/data) | |
Tables de Drop | M:Acquisition (/data) • M:DropTables (/data) • M:Void (/data) | |
Marchands | M:Baro (/data) • M:Marchands (/data) | |
Fabrication | M:Blueprints/data • M:Research (/data) • M:Resources (/data) | |
Cosmétiques | M:Decorations (/data) • M:Cosmetics/data • M:Sigils/data • M:TennoGen (/data) | |
Infoboxes | M:Arcane/infobox • M:Conservation/infobox • M:Ennemi/infobox • M:Missions/infobox • M:Mods/infobox • M:Resources/infobox • M:Void/page • M:Warframes/infobox • M:Weapons/infobox | |
Wiki | Dev Wiki Fork | Module:Common (/i18n) • M:Docbunto (/cli, /i18n) • M:Entrypoint • M:I18n • M:Infobox (/i18n) • M:LanguageList • M:Mbox (/i18n) • M:ModuleTest • M:Reference • M:ReleaseStatus (/i18n) • M:TestHarness (/i18n) • M:WDSButton (/data) |
Wikipedia Fork | M:Arguments (/i18n) • M:FallbackList • M:Yesno | |
Third-Party Fork | M:Codec • M:CSV • M:Date • M:Inspect • M:JSON • M:Lexer • M:LuaClassSystem • M:LuaSerializer • M:Navbox • M:Navigation • M:Unindent | |
Wiki-Unique | M:Database • M:DatastoreManifest • M:Delay • M:DependencyGraph • M:InfoboxBuilder • M:Lua • M:Map • M:Placeholder • M:RemoveCategory • M:StatObject • M:Tooltips | |
Autres | M:Cost • M:Enum/data • M:InternalNames • M:MasteryRank • M:Polarity • M:Sandbox • M:WarframeUsageData2020/data | |
Archivés/Dépréciés | M:Avionics (/data) • M:BuildRequire • M:FormatingTool • M:Gallery • M:NightwaveActs • M:Shared • M:Syndicates/data • M:TennoScript • M:TranslationExamples • M:VoidByReward • M:WorldState (/data) | |
Bug Reports • Development Guide • Localization Guide (L10n Message Data Stores) • Programming Standards • Projects & Current Backlog • Updating Databases • Full Module List • Lua Reference Manual |
Code
--- '''Icon''' retourne l'icone d'un élément particulier en jeu.<br/>
--
-- Sur ce Wiki, Icon est utilisé dans :
-- * [[Module:DropTables]]
-- * [[Module:Weapons]]
-- * [[Modèle:Icon]]
--
-- @module icon
-- @alias p
-- @author [[User:ChickenBar|ChickenBar]]
-- @attribution [[User:94Connor949|94Connor949]]
-- @attribution [[User:Hayframe|Hayframe]]
-- @attribution [[User:FINNER|FINNER]]
-- @attribution [[User:Falterfire|Falterfire]]
-- @attribution [[User:Flaicher|Flaicher]]
-- @attribution [[User:Cephalon Scientia|Cephalon Scientia]]
-- @attribution [[User:Rngd444|Rngd444]]
-- @attribution [[User:Gigamicro|Gigamicro]]
-- @image
-- @require [[Module:Icon/data]]
-- @release stable
-- <nowiki>
local p = {}
local IconData = mw.loadData [[Module:Icon/data]]
local DamageTypes = require('Module:DamageTypes/data')
-- TODO: Lots of the functions share similar code when grabbing arguments from the frame and building the icon's wikitext.
-- Refactor this functionality into a single function.
--- Returns the icon for an item.
-- @function Item
-- @param {string} iconname Item name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The icon's image in wikitext
function p.Item(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
return p._Item(iconname, textexist, imagesize)
end
--- Returns the icon for an item.
-- @function _Item
-- @param {string} iconname Item name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The icon's image in wikitext
function p._Item(iconname, textexist, imagesize)
-- iconname = string.gsub(" "..string.lower( iconname ), "%W%l", string.upper):sub(2) --glitched with "é" (FR) character
local link = ''
local name = ''
assert(IconData["Objets"][iconname] ~= nil,
'p._Item(iconname, textexist, imagesize): Invalid icon name "'..(iconname or '')..'" (do you need to update [[Module:Icon/data]]?) [[Category:Icon Module error]]')
link = IconData["Objets"][iconname]["Link"]
name = IconData["Objets"][iconname]["Name"]
iconname = IconData["Objets"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = '26'
end
local imgText = '[[Fichier:'..iconname..'|'..imagesize..'px'
if(link ~= nil) then
imgText = imgText..'|link='..link
end
if(name ~= nil) then
imgText = imgText..'|'..name
end
imgText = imgText..']]'
if (textexist == 'text' or textexist == 'Text') then
if (link ~= nil) then
if (name ~= nil) then
return imgText..' [['..link..'|'..name..']]'
else
return imgText..' [['..link..']]'
end
elseif (name ~= nil) then
return imgText..' '..name
else
return imgText
end
return imgText..'[[Catégorie:icon_debug]]'
end
return imgText
end
--- Returns the icon for a weapon's disposition value.
-- @function Dis
-- @param {string} name Disposition value ranging from 0.5 to 1.55
-- @param[opt] {string} color Icon color, can be 'White' or 'Black'; defaults to 'Black'
-- @param[opt] {string} size Image size, defaults to '27'
-- @return {string} The icon's image in wikitext
function p.Dis(frame)
local name = frame.args[1]
local color = frame.args[2]
local size = frame.args.imgsize
return p._Dis(name, color, size)
end
--- Returns the icon for a weapon's disposition value.
-- @function _Dis
-- @param {string} name Disposition value ranging from 0.5 to 1.55
-- @param[opt] {string} color Icon color, can be 'White' or 'Black'; defaults to 'Black'
-- @param[opt] {string} size Image size, defaults to '27'
-- @return {string} The icon's image in wikitext
function p._Dis(name, color, size)
local link = 'Mod_Riven#Disposition'
if(color == nil or color == '') then color = 'black' end
if(size == nil or size == '') then size = 27 end
assert(name ~= nil,
'p._Dis(name, color, size): Invalid icon name "'..(name or '')..'" [[Category:Icon Module error]]')
local dots = ''
name = tonumber(name)
if (name < 0.7) then dots = '●○○○○'
elseif(name < 0.9) then dots = '●●○○○'
elseif(name < 1.109) then dots = '●●●○○'
elseif(name < 1.309) then dots = '●●●●○'
else dots = '●●●●●' end
return '[['..link..'|<span style="font-size:'..size..'px; display:inline; position:relative; top:2px">'..dots..'</span>]]'
end
--- Returns the icon for an affinity type.
-- @function Affinity
-- @param {string} iconname Affinity type (e.g. 'Mastery' or 'Clan')
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The icon's image in wikitext
function p.Affinity(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
return p._Affinity(iconname, textexist, imagesize)
end
--- Returns the icon for an affinity type.
-- @function _Affinity
-- @param {string} iconname Affinity type (e.g. 'Mastery' or 'Clan')
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The icon's image in wikitext
function p._Affinity(iconname, textexist, imagesize)
local link = ''
assert(IconData["Affinity"][iconname] ~= nil,
'p._Affinity(iconname, textexist, imagesize): Invalid icon name "'..(iconname or '')..'" [[Category:Icon Module error]]')
link = IconData["Affinity"][iconname]["Link"]
local imgname = IconData["Affinity"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x26'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[Fichier:'..imgname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..iconname..']]'
end
return '[[Fichier:'..imgname..'|'..imagesize..'px|link='..link..'|class=icon]]'
end
-- @function Faction
-- @param {string} iconname Faction type
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} color Icon color, can be 'White' or 'Black'; defaults to 'Black'
-- @param[opt] {string} imagesize Image size, defaults to 'x20'
-- @return {string} The icon's image in wikitext
function p.Faction(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
local link = ''
local icon = ''
if IconData["Factions"][iconname] == nil then
return '[['..iconname..']]'
end
link = IconData["Factions"][iconname]["Link"]
icon = IconData["Factions"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[Fichier:'..icon..'|'..imagesize..'px|link='..link..'|class=icon]] [['..link..']]'
end
return '[[Fichier:'..icon..'|'..imagesize..'px|link='..link..'|class=icon]]'
end
--- Returns the icon for a syndicate.
-- @function Syndicate
-- @param {string} iconname Syndicate name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x32'
-- @return {string} The icon's image in wikitext
function p.Syndicat(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Syndicats"][iconname] == nil then
return ""
end
link = IconData["Syndicats"][iconname]["Link"]
iconname = IconData["Syndicats"][iconname]["Image"][1] --first icon
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
if (textexist == 'notext') then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..'|class=icon]]'
else
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..'|class=icon]] [['..link..']]'
end
end
--- Returns the icon for a Syndicate.
-- @function _Syndicat
-- @param {string} syndicName Syndicate name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after the Syndicate
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The Syndicate image in wikitext
function p._Syndicate(syndic, textexist, imagesize)
-- syndic = string.gsub(" "..string.lower( iconname ), "%W%l", string.upper):sub(2) --glitched with "é" (FR) character
local syndicLink = ''
local syndicName = ''
local syndicImage = ''
assert(IconData["Syndicats"][syndic] ~= nil,
'p._Item(syndic, textexist, imagesize): Invalid syndicate name "'..(syndic or '')..'" (do you need to update [[Module:Icon/data]]?) [[Category:Icon Module error]]')
syndicLink = IconData["Syndicats"][syndic]["Link"]
syndicName = IconData["Syndicats"][syndic]["Name"]
syndicImage = IconData["Syndicats"][syndic]["Image"][1]
if (imagesize == nil or imagesize == '') then
imagesize = '26'
end
local imgText = '[[Fichier:'..syndicImage..'|'..imagesize..'px'
if(syndicLink ~= nil) then
imgText = imgText..'|link='..syndicLink
end
if(syndicName ~= nil) then
imgText = imgText..'|'..syndicName
end
imgText = imgText..']]'
if (textexist == 'text' or textexist == 'Text') then
if (syndicLink ~= nil) then
if (syndicName ~= nil) then
return imgText..' [['..syndicLink..'|'..syndicName..']]'
else
return imgText..' [['..syndicLink..']]'
end
elseif (syndicName ~= nil) then
return imgText..' '..syndicName
else
return imgText
end
end
return imgText
end
--- Returns the icon for a HUD element.
-- @function HUD
-- @param {string} iconname HUD element name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} color Icon color, can be 'White' or 'Black'; defaults to 'Black'
-- @param[opt] {string} imagesize Image size, defaults to 'x20'
-- @return {string} The icon's image in wikitext
function p.HUD(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local imagesize = frame.args.imgsize
local link = ''
if IconData["HUD"][iconname] == nil then
return '[['..iconname..']]'
end
link = IconData["HUD"][iconname]["Link"]
if (color == 'white' or color == 'White') then
iconname = IconData["HUD"][iconname]["Image"][2] --white icon
else
iconname = IconData["HUD"][iconname]["Image"][1] --black icon
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link=Affichage Tête Haute|class=icon]] [[Affichage Tête Haute|'..link..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link=Affichage Tête Haute|class=icon]]'
end
--- Returns the icon for a real-world country flag.
-- @function Flag
-- @param {string} iconname HUD element name
-- @param {string} tooltip If set to 'Text' or 'text', text is added after icon
-- @param {string} dest Name of a destination article for linking purposes
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @return {string} The icon's image in wikitext
function p.Flag(frame)
local iconname = frame.args[1]
local tooltip = frame.args[2]
local dest = frame.args[3]
local textexist = frame.args[4]
assert(IconData["Drapeaux"][iconname] ~= nil,
'p.Flag(frame): Invalid icon name "'..(iconname or '')..'" [[Category:Icon Module error]]')
iconname = IconData["Drapeaux"][iconname]
if tooltip == nil then
tooltip = ''
end
if dest == nil then
dest = ''
end
if (textexist == 'text' or textexist == 'Text') then
return '[[Fichier:'..iconname..'|'..tooltip..'|16px|link='..dest..']] [['..dest..'|'..tooltip..']]'
end
return '[[Fichier:'..iconname..'|'..tooltip..'|16px|link='..dest..']]'
end
--- Returns the icon for a HUD buff or debuff.
-- @function Buff
-- @param {string} iconname Buff name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x40'
-- @return {string} The icon's image in wikitext
function p.Buff(frame)
local iconname = frame.args[1]
local imagesize = frame.args.imgsize
local link = IconData["Buff"][iconname]["Link"]
local iconFile = ""
assert(IconData["Buff"][iconname] ~= nil,
'p.Buff(frame): Invalid icon name "'..iconname..'" [[Category:Icon Module error]]')
iconFile = IconData["Buff"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x40'
end
return '[[Fichier:'..iconFile..'|'..imagesize..'px|link='..link..'|class=icon]]'
end
--- Returns the icon for a Clan tier.
-- @function Clan
-- @param {string} iconname Clan tier name
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The icon's image in wikitext
function p.Clan(frame)
local iconname = frame.args[1]
local imagesize = frame.args.imgsize
return p._Clan(iconname, imagesize)
end
--- Returns the icon for a Clan tier.
-- @function _Clan
-- @param {string} iconname Clan tier name
-- @param[opt] {string} imagesize Image size, defaults to 'x26'
-- @return {string} The icon's image in wikitext
function p._Clan(iconname, imagesize)
local link = IconData["Clan"][iconname]["Link"]
local iconFile = ""
assert(IconData["Clan"][iconname] ~= nil,
'p._Clan(iconname, imagesize): Invalid icon name "'..iconname..'" [[Category:Icon Module error]]')
iconFile = IconData["Clan"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x26'
end
return '[[Fichier:'..iconFile..'|'..imagesize..'px|link='..link..'|'..iconname..' Clan|class=icon]]'
end
--- Returns the icon for a K-Drive.
-- @function KDrive
-- @param {string} iconname K-Drive name
-- @param[opt] {string} textexist If set to 'Text' or 'text', text is added after icon
-- @param[opt] {string} imagesize Image size, defaults to 'x32'
-- @return {string} The icon's image in wikitext
function p.KDrive(frame)
local iconname = frame.args[1]
local imagesize = frame.args.imgsize
local link = IconData["K-Drive"][iconname]["Link"]
local iconFile = ""
assert(IconData["K-Drive"][iconname] ~= nil,
'p.KDrive(frame): Invalid icon name "'..iconname..'" [[Category:Icon Module error]]')
iconFile = IconData["K-Drive"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
return '[[Fichier:'..iconFile..'|'..imagesize..'px|link='..link..'|class=icon]]'..'[['..iconname..']]'
end
-- ======================
-- ===== /OLD CODE/ =====
-- ======================
-- Fonction pour les icons de Focus
function p.Focus(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local icontype = frame.args[4]
local imagesize = frame.args.imgsize
if IconData["Focus"][iconname] == nil then
return "<span style=\"color:red;\">Non-Valide</span>"
else
if icontype == 'tour' then
if color == 'black' then
iconname = IconData["Focus"][iconname]["seal"][2]
else
iconname = IconData["Focus"][iconname]["seal"][1]
end
else
if color == 'white' then
iconname = IconData["Focus"][iconname]["Image"][2]
else
iconname = IconData["Focus"][iconname]["Image"][1]
end
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:' .. iconname .. '|' .. imagesize .. 'px|sub|link=Focus]][[Focus|' .. frame.args[1] .. ']]'
end
return '[[File:' .. iconname .. '|' .. imagesize .. 'px|link=Focus]]'
end
end
function p.Personnage(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Personnages"][iconname] == nil then
return ""
else
link = IconData["Personnages"][iconname]["Link"]
iconname = IconData["Personnages"][iconname]["Image"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:' .. iconname .. '|' .. imagesize .. 'px|link=' .. link .. ']] [[' .. link .. '|' ..
frame.args[1] .. ']]'
end
return '[[File:' .. iconname .. '|' .. imagesize .. 'px|link=' .. link .. ']]'
end
end
-- contenu de l'ancien Module à remplacer au plus vite
function p.Manuf(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
return p._Manuf(iconname, textexist, imagesize)
end
function p._Manuf(iconname, textexist, imagesize)
assert(IconData["Fabricants"][iconname] ~= nil,
'p._Manuf(iconname, textexist, imagesize): Invalid icon name "'..(iconname or '')..'" [[Category:Icon Module error]]')
local imgname = IconData["Fabricants"][iconname]["Image"][1]
if (imagesize == nil or imagesize == '') then
imagesize = 'x26'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[Fichier:'..imgname..'|'..imagesize..'px]] '..iconname
end
return '[[Fichier:'..imgname..'|'..imagesize..'px|class=icon]]'..iconname
end
return p