перепиши с нуля мой говнокод так чтобы он имел нормальный вид и структуру для ховеров

local mad = require 'MoonAdditions'

--OSNOVNAÂ FUNKCIÂ
function main()
	while not isPlayerPlaying(PLAYER_HANDLE) do wait(100) end
	wait(100)

	while true do wait(0)
		--draw_text(string text, float x, float y, [uint style, float width, float height, uint align, float wrap, bool proportional, bool justify, int text_r, int text_g, int text_b, int text_a, uint outline, uint shadow, int shadow_r, int shadow_g, int shadow_b, int shadow_a, bool background, int background_r, int background_g, int background_b, int background_a])
		local	text            = 'zagolovok menu'
		local	x               = 45
		local	y               = 240
		local	style           = mad.font_style.FONT_SUBTITLES
		local	size			= 1.45
		local	width           = size * 0.35
		local	height          = size * 1.15
		local	align           = mad.font_align.LEFT
		local	wrap            = 180.0
		local	proportional    = true
		local	justify         = false
		local	text_r          = 255
		local	text_g          = 70
		local	text_b          = 255
		local	text_a          = 255
		local	outline         = 1
		local	shadow          = 0
		local	shadow_r        = 0
		local	shadow_g        = 0
		local	shadow_b        = 0
		local	shadow_a        = 255
		local	background      = 0
		local	background_r    = 0
		local	background_g    = 0
		local	background_b    = 0
		local	background_a	= 0
		
		mad.draw_text(text, x, y, style, width, height, align, wrap, proportional, justify, text_r, text_g, text_b, text_a, outline, shadow, shadow_r, shadow_g, shadow_b, shadow_a, background, background_r, background_g, background_b, background_a)
		
		local pointX, pointY = getCursorPos()
		local text_in_p1 = isPointInArea2d(pointX, pointY, 45, 275+((22)*0), 45+125, 275+((22)*1))
		local text_in_p2 = isPointInArea2d(pointX, pointY, 45, 275+((22)*1), 45+125, 275+((22)*2))
		local text_in_p3 = isPointInArea2d(pointX, pointY, 45, 275+((22)*2), 45+125, 275+((22)*3))
		local text_in_p4 = isPointInArea2d(pointX, pointY, 45, 275+((22)*3), 45+125, 275+((22)*4))
		local text_in_p5 = isPointInArea2d(pointX, pointY, 45, 275+((22)*4), 45+125, 275+((22)*5))
		local text_in_p6 = isPointInArea2d(pointX, pointY, 45, 275+((22)*5), 45+125, 275+((22)*6))
		local text_in_p7 = isPointInArea2d(pointX, pointY, 45, 275+((22)*6), 45+125, 275+((22)*7))
		
		print('text_in_p1', text_in_p1)
		print('text_in_p2', text_in_p2)
		print('text_in_p3', text_in_p3)
		print('text_in_p4', text_in_p4)
		print('text_in_p5', text_in_p5)
		print('text_in_p6', text_in_p6)
		print('text_in_p7', text_in_p7)
		
		text_g = 255
		if text_in_p1 then text_r = 70 end
		if text_in_p2 then text_g = 70 end
		if text_in_p3 then text_r = 70 end
		if text_in_p4 then text_g = 70 end
		if text_in_p5 then text_r = 70 end
		if text_in_p6 then text_g = 70 end
		if text_in_p7 then text_r = 70 end
		
		
		local	text            = 'Recording ~n~Playback ~n~Pause 3 ~n~Car slot 4 ~n~Save/Load 5 ~n~Triggers ~n~Options'
		local	x               = 45
		local	y               = 275
		local	style           = mad.font_style.FONT_SUBTITLES
		local	size			= 1
		local	width           = size * 0.58
		local	height          = size * 1.02
		local	align           = mad.font_align.LEFT
		local	wrap            = 190.0
		local	proportional    = true
		local	justify         = false
		--local	text_r          = 255
		--local	text_g          = 255
		local	text_b          = 255
		local	text_a          = 255
		local	outline         = 1
		local	shadow          = 0
		local	shadow_r        = 0
		local	shadow_g        = 0
		local	shadow_b        = 0
		local	shadow_a        = 255
		local	background      = 0
		local	background_r    = 0
		local	background_g    = 0
		local	background_b    = 0
		local	background_a	= 0
		
		mad.draw_text(text, x, y, style, width, height, align, wrap, proportional, justify, text_r, text_g, text_b, text_a, outline, shadow, shadow_r, shadow_g, shadow_b, shadow_a, background, background_r, background_g, background_b, background_a)
		
	end
end

function isPointInArea2d(pointX, pointY, cornerAX, cornerAY, cornerBX, cornerBY)
    -- Определяем минимальные и максимальные границы для X и Y
    local minX = math.min(cornerAX, cornerBX)
    local maxX = math.max(cornerAX, cornerBX)
    local minY = math.min(cornerAY, cornerBY)
    local maxY = math.max(cornerAY, cornerBY)
    
    -- Проверяем, находится ли точка внутри этих границ
    if pointX >= minX and pointX <= maxX and pointY >= minY and pointY <= maxY then
        return true
    else
        return false
    end
end