Module:Icons

local p = {} local Tip = { ["TheRobloxianTeam"] = "The Robloxian Team", ["TheUndeadBrigade"] = "The Undead Brigade", ["TheDemonicUnion"] = "The Demonic Union", ["TheUberianNation"] = "The Uberian Nation" } local Icon = {

["TheRobloxianTeam"] = "The Robloxian Team.png", ["TheUndeadBrigade"] = "The Undead Brigade.png", ["TheDemonicUnion"] = "The Demonic Union.png", ["TheUberianNation"] = "The Uberian Nation.png", } local Size = { ["small"] = "x10px", ["medium"] = "x14px", ["normal"] = "x14px", ["big"] = "x20px", } function p.Icons(frame) local iconList = mw.text.split(frame.args[1], ",") local parserError = "" local iconSetting if frame.args[2] ~= nil and string.len(frame.args[2]) > 0 then iconSetting = tostring(frame.args[2]) if Size[iconSetting] ~= nil then iconSetting = Size[iconSetting] end else iconSetting = Size["medium"] end local iconLinks if frame.args[3] ~= nil then iconLinks = mw.text.split(frame.args[3], ",") end local tipOverride if frame.args[4] ~= nil then tipOverride = mw.text.split(frame.args[4], ",") end local n = 1 local result = ""

while n <= table.getn(iconList) do       newIcon = iconList[n] if Icon[newIcon] ~= nil then currentIcon = Icon[newIcon] 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 splitTip = mw.text.split(Tip[newIcon], "|") currentTip = splitTip[1] end end else currentIcon = "Icon question.png" currentTip = "Unrecognized icon name" result = result .. ""       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

function p.platforms(frame) local icons = mw.text.split(frame.args[1], ",") local iconCount = 1 local platformCheck = "" local result = "" while iconCount <= table.getn(icons) do       currentIcon = Tip[string.lower(icons[iconCount])] platformCheck = mw.text.split(currentIcon, "|") if platformCheck[2] ~= nil then result = result .. ' ' .. "Has platform::"           result = result .. platformCheck[1] .. ' ' result = result .. '' result = result .. ""           result = result .. ' '           if iconCount < table.getn(icons) then result = result .. " "           end end iconCount = iconCount + 1 end if result == "" then result = '[Platforms needed]' end return result end

function p.Test(frame) local iconList = mw.text.split(frame.args[1], ",") local parserError = "" local iconSetting if frame.args[2] ~= nil and string.len(frame.args[2]) > 0 then iconSetting = tostring(frame.args[2]) if Size[iconSetting] ~= nil then iconSetting = Size[iconSetting] end else iconSetting = Size["medium"] end local iconLinks if frame.args[3] ~= nil then iconLinks = mw.text.split(frame.args[3], ",") end local tipOverride if frame.args[4] ~= nil then tipOverride = mw.text.split(frame.args[4], ",") end local n = 1 local result = ""

while n <= table.getn(iconList) do       newIcon = string.lower(iconList[n]) if Icon[newIcon] ~= nil then currentIcon = Icon[newIcon] 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 splitTip = mw.text.split(Tip[newIcon], "|") currentTip = splitTip[1] end end else currentIcon = "Icon question.png" currentTip = "Unrecognized icon name" result = result .. ""       end

result = result .. 'Current tip: ' .. currentTip .. " : " .. string.len(currentTip) .. '\n'

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

return p