Module:Cg

local p = {}

p.cg = function(f) local args = f.args or f	if f == mw.getCurrentFrame and args[1] == nil then args = f:getParent.args else f = mw.getCurrentFrame end local type = args[1] or args["type"] if type == "cell" then local grids = args[2] if grids ~= nil then return "" .. grids .. " "		else return " " end elseif type == "tank" then local width = args["width"] local ret = "" .. (args[2]) if args["nooverlay"] == nil then ret = ret .. "[[File:GUI tank"			if width ~= nil then				ret = ret .. "_" .. width			end			ret = ret .. "_" .. (args["height"] or "120") .. ".png|link=]] " end return ret .. " "	elseif type == "text" then return "" .. args[2] .. args[3] .. args[4] .. " "	elseif type == "shapeless" then return " " elseif type == "end" then return " " elseif type == "image" then return "" .. args[2] .. " "	elseif type == "bg-image" then local ret = " " elseif type == "progress" then local ret = "<div style=\"position:absolute;\" class=\""		if args["reverse"] ~= nil then			ret = ret .. "progress-reverse"		else			ret = ret .. "progress"		end		local dir = args[5] or args["dir"]		ret = ret .. "\" style=\"animation-name:progress-" .. dir .. "; left:" .. (args[3] or args["x"]) .. "px; top:" .. (args[4] or args["y"]) .. "px; position:absolute; display:inline-block; clip: rect("		if dir == "up" then			ret = ret .. (args[6] or args["size"] or "0") .. "px auto auto auto"		elseif dir == "right" then			ret = ret .. "auto " + (args[6] or args["size"] or "0") .. "px auto auto"		elseif dir == "down" then			ret = ret .. "auto auto " + (args[6] or args["size"] or "0") .. "px auto"		elseif dir == "left" then			ret = ret .. "auto auto auto " + (args[6] or args["size"] or "0") .. "px"		end		return ret .. ");\"> " else -- (the default) local float = args["float"] local ret = "" if float ~= nil then ret = ret .. ""		end return ret end end

return p