
local function PaintMenu(menu)
	
	if (menu.fade == "out") then
		menu.Alpha = math.Approach(menu.Alpha, 0, (FrameTime() * 325));
	else
		menu.Alpha = math.Approach(menu.Alpha, 250, (FrameTime() * 200));
	end
	
	local w, h = menu:GetSize();
	local a = menu.Alpha;
	
	if (a <= 0) then
		menu:Close();
		gui.EnableScreenClicker(false);
	end
	
	draw.RoundedBox(0, 0, 0, w, h, Color(0, 0, 0, a));
	draw.RoundedBox(0, 1, 1, (w - 2), (h - 2), Color(30, 10, 50, a));
	draw.RoundedBox(0, 4, 4, (w - 8), (h - 8), Color(0, 0, 0, a));
	draw.RoundedBox(0, 5, 5, (w - 10), (h - 10), Color(20, 5, 40, a));
	
end

local function PaintButton(btn, menu)

	local w, h = btn:GetSize();
	local a = menu.Alpha;

	draw.SimpleText("X", "ScoreboardText", (w * .5), (h * .5), Color(200, 200, 200, a), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER);

end

function GM:CreateSplash()

	local sw, sh = ScrW(), ScrH();
	
	local menu = vgui.Create("DFrame");
	local btn = menu.btnClose;
	
	menu.fade = "in";
	menu.Alpha = 0;
	menu:SetSize((sh * .375), (sh * .375));
	
	local mw, mh = (sw * .5), (sh * .5);
	menu:SetPos((mw - (menu:GetWide() * .5)), (mh - (menu:GetTall() * .5)));
	
	menu:SetTitle("");
	menu:SetDraggable(false);
	
	function menu:Paint()
		PaintMenu(self);
		return true;
	end
	
	function btn:Paint()
		PaintButton(self, menu);
		return true;
	end
	function btn:DoClick()
		menu.fade = "out";
	end
	
	gui.EnableScreenClicker(true);

end
