Module:Icons

local p = {} local iconList = { epic = { icon = "Epic games icon.png", text = "Epic Games" },

ps4  = { icon = "PS4 icon.png", text = "Play Station 4" },

quest = { icon = "Question mark.png", text = "Unknown" },

steam = { icon = "Steam icon.png", text = "Steam" },

windows = { icon = "Windows games icon.png", text = "Windows games" },

xbox = { icon = "Xbox icon.png", text = "XboxOne" } } local iconSize = { ["small"]          = "x10px", ["medium"]         = "x14px", ["normal"]         = "x14px", ["big"]            = "x20px", } function p.Icons(frame) local iconReq = mw.text.split(frame.args['icons'], ",") local parserError = "" local iconSetting if frame.args['size'] ~= nil and string.len(frame.args['size']) > 0 then iconSetting = tostring(frame.args['size']) if iconSize[iconSetting] ~= nil then iconSetting = iconSize[iconSetting] end else iconSetting = iconSize["medium"] end local iconLinks if frame.args['links'] ~= nil then iconLinks = mw.text.split(frame.args['links'], ",") end local tipOverride if frame.args['tips'] ~= nil then tipOverride = mw.text.split(frame.args['tips'], ",") end local n = 1 local result = ""

while n <= table.getn(iconReq) do       newIcon = iconReq[n] if iconList[newIcon] ~= nil then currentIcon = iconList[newIcon]['icon'] if tipOverride ~= nil and tipOverride[n] ~= nil and string.len(tipOverride[n]) > 0 then currentTip = tipOverride[n] else if iconLinks ~= nil and iconLinks[n] ~= nil and string.len(iconLinks[n]) > 0 then currentTip = iconLinks[n] else currentTip = iconList[newIcon]['text'] end end else currentIcon = "Question mark.png" currentTip = "Unrecognized icon name" result = result .. "[" .."[Category:Modules with invalid parameters]]" end

result = result .. ' '       result = result .. '[' .. '[File:' .. currentIcon .. '|' .. iconSetting if iconLinks ~= nil and iconLinks[n] ~= nil and iconLinks[n] ~= "" then result = result .. '|link=' .. iconLinks[n] else result = result .. '|link=' end if currentTip ~= nil then result = result .. '|' .. currentTip end

result = result .. ']] '       if n < table.getn(iconList) then result = result .. " "       end n = n + 1 end return result .. parserError end

return p