include("shared.lua")

local use_font = system.IsWindows() and "Tahoma" or "Verdana"
surface.CreateFont("mg_entfont", {font = use_font, size = 35, weight = 1000, blursize = 0, antialias = true, shadow = false})

local localply
local cam_Start3D2D, cam_End3D2D, draw_SimpleTextOutlined = cam.Start3D2D, cam.End3D2D, draw.SimpleTextOutlined

function ENT:Draw()
	self:DrawModel()
end

local vector_1 = Vector(0, 0, 1)
function ENT:DrawTranslucent()
	localply = localply or LocalPlayer()
	if localply:GetPos():DistToSqr(self:GetPos()) > 40000 then return end
	if IsValid(self:GetParent()) then return end
	local owner = zmlab.f.GetOwner(self)
	local pname = owner and owner:Nick() or "Niemand"
	local ang = self:GetAngles()	
	local pos = self:GetPos() + (vector_1 * (self:OBBMaxs().z + 5 + math.sin(SysTime() * 2)))
	ang:RotateAroundAxis(ang:Forward(), 90)
	ang:RotateAroundAxis(ang:Right(), -90)
	ang:RotateAroundAxis(ang:Up(), 0)
	cam_Start3D2D(pos, Angle(0, EyeAngles().y - 90, 90), 0.1)
		draw_SimpleTextOutlined(self.PrintName, "mg_entfont", 0, -100, team.GetColor(zmlab.config.cookjob), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
		draw_SimpleTextOutlined(string.Comma(math.Round(self:GetMethAmount(), 1))..zmlab.config.UoW, "mg_entfont", 0, -60, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, color_black)
	cam_End3D2D()
end