local function Sonic_HUD(v, p)
	if not (p and p.valid and gamestate == GS_LEVEL) return end
	
	if mapheaderinfo[gamemap].lvlttl == "Vs Super Sonic"
		v.drawFill(0,0,v.width(),v.height(), skincolors[SKINCOLOR_PURPLE].ramp[10]|V_SNAPTOLEFT|V_SNAPTOTOP)
		v.drawScaled(160*FU, 100*FU, FU*9/10, v.cachePatch("US_HEADSUP"))
		
		local Lower = V_ALLOWLOWERCASE
		v.drawString(160, 35, "\x82"+"Hey there!", 0, "center", Lower)
		v.drawString(160, 55, "That's about it for now. But I really hope you \nenjoyed it as much as I did making it at my peak!", Lower, "thin-center")
		v.drawString(160, 77, "And If I'm still up to it, we might get a "+"\x82"+"Phase 2"+"\x80"+"!", Lower, "thin-center")
		v.drawString(160, 89, "So that's about all I have to say. But thank you \na ton for playing! It really does mean alot. ^^", Lower, "thin-center")
		v.drawString(260, 150, "\x83"+"-SpeedyM", Lower, "right")
		if (server==p) or IsPlayerAdmin(p)
			v.drawString(50, 150, "\x82"+"JUMP: "+"\x80"+"Return to Title Screen", Lower, "thin")
		end
		return
	end
	
	if USonic_CutScene
		local Scene = USonic_CutScene
		
		if Scene.BlackBarScale
			v.drawStretched(0, 0, FU*3/2, Scene.BlackBarScale, v.cachePatch("US_FLASH1"), V_SNAPTOLEFT|V_SNAPTOTOP|FF_TRANS10)
		--	v.drawStretched(0, 172*FU, FU*3/2,
		--	Scene.DestBlackBarScale or Scene.BlackBarScale,
		--	v.cachePatch("US_FLASH1"), V_SNAPTOLEFT|V_SNAPTOBOTTOM|FF_TRANS10)
			local PATCH = v.cachePatch("US_FLASH1")
			local FILL = PATCH.height*FU-(FixedMul(FixedDiv(Scene.BlackBarScale, FU), PATCH.height*FU))
			v.drawCropped(0, FILL,
				FU*3/2, FU,
				PATCH,
				V_SNAPTOBOTTOM|V_SNAPTOLEFT|FF_TRANS10,
				nil,
				0, max(FILL, 0),
				PATCH.width*FU, PATCH.height*FU
			)
		end
		
		if Scene.BlackTrans != nil and Scene.BlackTrans < 10*FU
			v.drawFill(0,0,v.width(),v.height(), skincolors[SKINCOLOR_BLACK].ramp[15]|V_SNAPTOLEFT|V_SNAPTOTOP|Scene.BlackTrans)
		--	v.draw(0, 0, v.cachePatch("US_FLASH1"), V_SNAPTOLEFT|V_SNAPTOTOP|(Scene.BlackTrans or 0))
		end
		
		if (server==p) or IsPlayerAdmin(p)
			v.drawString(10, 10, "\x82"+"SPIN: "+"\x80"+"SKIP", V_SNAPTOLEFT|V_SNAPTOTOP)
		end
		if Scene.Skipping
			local COLOR = (server and server.mo and server.mo.valid) and server.color or SKINCOLOR_COBALT
			local PATCH = v.cachePatch("US_FLASH3")
			local SKIP = Scene.Skipping
			local FILL = (FixedMul(SKIP, PATCH.width*FU))-PATCH.width*FU
			local FILL2 = FixedInt(SKIP*(v.width()/5))
		--	v.drawCropped(FILL, 200*(Scene.BlackBarScale or 0), v.width()*FU/2, FU/50, PATCH, V_SNAPTOTOP|V_SNAPTOLEFT|FF_TRANS10,
		--	v.getColormap(nil, COLOR), max(FILL, 0), 0, PATCH.width*FU, PATCH.height*FU)
		
			v.drawStretched(0, 200*(Scene.BlackBarScale or 0), SKIP, FU/50, PATCH, V_SNAPTOTOP|V_SNAPTOLEFT|FF_TRANS10,
			v.getColormap(nil, COLOR))
		end
	end
	
	if p.US_WhiteFlash != nil
		v.drawFill(0,0,v.width(),v.height(), skincolors[SKINCOLOR_WHITE].ramp[0]|V_SNAPTOLEFT|V_SNAPTOTOP|p.US_WhiteFlash)
	end
end
hud.add(Sonic_HUD, "game")