include("shared.lua")


//----------------------------//
function ENT:Draw()
	self:DrawModel()
	if(LocalPlayer():GetPos():Distance(self:GetPos()) < 500)then
		self:Draw_MainInfo()
	end
end
function ENT:DrawTranslucent()
	self:Draw()
end

local ButtonIcon = Material("materials/zerochain/zpizmak/ui/zpizmak_button.png", "smooth")
function ENT:Draw_MainInfo()

	local Pos = self:GetPos()

	local Ang = Angle( 0, LocalPlayer():EyeAngles().y - 90, 90 )

	local status

	local sState = self:GetSignState()
	if(sState)then
		status = zpizmak.language.OpenSign_open
	else
		status = zpizmak.language.OpenSign_closed
	end

	cam.Start3D2D(Pos , Ang, 0.1)

		surface.SetDrawColor( 0, 0, 0, 100 )
		surface.SetMaterial( ButtonIcon )
		surface.DrawTexturedRect( -225, -360, 450, 80 )

		if(sState)then
			surface.SetDrawColor( 0, 0, 0, 100 )
			surface.SetMaterial( ButtonIcon )
			surface.DrawTexturedRect( -150, -280, 300, 80 )

			draw.DrawText(zpizmak.language.OpenSign_Revenue..self:GetSessionEarnings()..zpizmak.config.Currency, "zpizmak_vgui_font03",0, -250,  Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER  )
		end

		draw.DrawText(status, "zpizmak_plate_font02",0, -350,  Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER  )

	cam.End3D2D()
end


function ENT:Think()
	self:SetNextClientThink( CurTime())
    return true
end
function ENT:OnRemove() end
