include("shared.lua")

surface.CreateFont("Fuel_GasText", {font = "Arial", size = 24, weight = 500, antialias = true})

local color = Color(255, 0, 0)
local local_ply, distance
function ENT:Draw()
	self:SetColor(color)
	self:DrawModel()
	local_ply = local_ply or LocalPlayer()
	distance = local_ply:EyePos():DistToSqr(self:GetPos())
	if distance < 360000 then
		local pos = self:GetPos()
		local ang = self:GetAngles()
		ang:RotateAroundAxis(ang:Forward(), 90)
		ang:RotateAroundAxis(ang:Right(), 90)
		cam.Start3D2D(pos + ang:Up() * 4 - ang:Forward() * 8.5 - ang:Right() * 6.5, ang, 0.1)
			draw.RoundedBox(0, 0, 0, 170, 165, Color(255, 200, 200, 50))
			draw.RoundedBox(0, 0, 0, 170, 25, Color(255, 75, 75, 255))
			draw.DrawText("Benzinkannister", "Fuel_GasText", 86, 1, Color(50, 50, 50), TEXT_ALIGN_CENTER)
			draw.DrawText("Benzinkannister", "Fuel_GasText", 85, 0, Color(255, 255, 255), TEXT_ALIGN_CENTER)
		cam.End3D2D()
		ang:RotateAroundAxis(ang:Right(), 180)
		cam.Start3D2D(pos + ang:Up() * 4 - ang:Forward() * 8.5 - ang:Right() * 6.5, ang, 0.1)
			draw.RoundedBox(0, 0, 0, 170, 165, Color(255, 200, 200, 50))
			draw.RoundedBox(0, 0, 0, 170, 25, Color(255, 75, 75, 255))
			draw.DrawText("Benzinkannister", "Fuel_GasText", 86, 1, Color(50, 50, 50), TEXT_ALIGN_CENTER)
			draw.DrawText("Benzinkannister", "Fuel_GasText", 85, 0, Color(255, 255, 255), TEXT_ALIGN_CENTER)
		cam.End3D2D()
	end
end