Module:UtilsIcons

local p = {} local utilsCode = require("Module:UtilsCode") local ICONS = { -- Item/Spell info {name = "Action Point", file = "File:Action Point Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Diagonal Line", file = "File:Diagonal Line Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Modifiable Range", file = "File:Modifiable Range Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Movement Point", file = "File:Movement Point Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Range", file = "File:Range Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Range (No Line of Sight)", file = "File:Range (No Line of Sight) Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Self Target", file = "File:Self Target Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Single Target", file = "File:Single Target Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Straight Line", file = "File:Straight Line Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Wakfu Point", file = "File:Wakfu Point Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Zone", file = "File:Zone Sprite.png", size = "", link = "false", tooltip = "true"}, -- Item/Spell effects {name = "Ally", file = "File:Ally Textual Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Caster", file = "File:Caster Textual Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Enemy", file = "File:Enemy Textual Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Fighter", file = "File:Fighter Textual Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Follow-Up", file = "File:Follow-Up Textual Sprite.png", size = "", link = "false", tooltip = "true"}, {name = "Fixed", file = "File:Fixed Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Non-Reducible", file = "File:Non-Reducible Sprite.png", size = "", link = "true", tooltip = "true"}, -- Item/Spell zones {name = "Circle", file = "File:Circle Zone Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Circle Ring", file = "File:Circle Ring Zone Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Cross", file = "File:Cross Zone Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Horizontal Line", file = "File:Horizontal Line Zone Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Square Ring", file = "File:Square Ring Zone Sprite.png", size = "", link = "false", tooltip = "false"}, -- Elements {name = "Air", file = "File:Air Element Textual Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Earth", file = "File:Earth Element Textual Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Fire", file = "File:Fire Element Textual Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Light", file = "File:Light Element Textual Sprite.png", size = "", link = "true", tooltip = "true"}, {name = "Water", file = "File:Water Element Textual Sprite.png", size = "", link = "true", tooltip = "true"}, -- Dialogues {name = "Exclamation Yellow", file = "File:Exclamation Yellow Dialogue Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Question", file = "File:Question Dialogue Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Question Green", file = "File:Question Green Dialogue Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "Speech", file = "File:Speech Dialogue Sprite.png", size = "", link = "false", tooltip = "false"}, {name = "XP", file = "File:XP Sprite.png", size = "", link = "true", tooltip = "true"}, }

function p._Display(frame) local args = frame:getParent.args return p.Display(args[1]) end

function p.Display(name) local result = "" for key, icon in ipairs(ICONS) do		if name == icon["name"] then result = "link="			-- Adds a link when link is set to true			if icon["link"] == "true" then				result = result .. icon["name"]			end			if not utilsCode.IsEmpty(icon["size"]) then				result = result .. "|" .. icon["size"]			end			result = result .. "" if icon["tooltip"] == "true" then result = mw.getCurrentFrame:expandTemplate{title = "Tooltip", args = {result, icon["name"]}} end end end return result end return p