
local function getTextY(line)
	return 15 + 25 * line
end

function love.draw2()
	-- Set background
	love.graphics.setBackgroundColor(0, 0, 0)
	love.graphics.setColor(1, 1, 1)

	if BotState.camfeed then
		love.graphics.draw(BotState.camfeed)
	end

	-- Draw time
	local time
	if BotState.lastMessage == 0 then
		time = "Never"
	else
		time = math.floor(love.timer.getTime() - BotState.lastMessage) .. "s ago"
	end
	love.graphics.print("Last message received: " .. time, 5, 5)

	-- Draw cpu battery
	if BotState.cpuBatteryCorrected == nil or BotState.cpuBatteryCorrected <= 3 then
		love.graphics.setColor(1, 0, 0)
	else
		love.graphics.setColor(1, 1, 1)
	end
	love.graphics.print("CPU Batt: " .. formatSafe("%.02f (%.02f) V", BotState.cpuBattery, BotState.cpuBatteryCorrected), 5, getTextY(1))

	-- Draw servo battery
	if BotState.servoBatteryCorrected == nil or BotState.servoBatteryCorrected <= 3 then
		love.graphics.setColor(1, 0, 0)
	else
		love.graphics.setColor(1, 1, 1)
	end
	love.graphics.print("Servo Batt: " .. formatSafe("%.02f (%.02f) V", BotState.servoBattery, BotState.servoBatteryCorrected), 5, getTextY(2))

	-- Draw latency
	love.graphics.setColor(1, 1, 1)
	love.graphics.print("Latency: " .. Ping.latency, 5, getTextY(3))
end
