From 15e4d33220bedb62beac635580fa4d222a7f5863 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 15:44:45 +0100 Subject: ESP: menu toggles for neutral/healthbar/healthnum/name --- src/esp.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/esp.cpp') diff --git a/src/esp.cpp b/src/esp.cpp index 3914342..4462f07 100644 --- a/src/esp.cpp +++ b/src/esp.cpp @@ -280,6 +280,8 @@ void esp_draw() { esp_collect(engine_get_local_player()); for (int i = 0; i < g_ntargets; i++) { const EspTarget &t = g_targets[i]; + if (t.neutral && !esp_option(ESP_OPT_SHOW_NEUTRAL)) + continue; if (t.friendly) surf_color(60, 255, 60, 255); else if (t.neutral) surf_color(220, 220, 220, 255); else surf_color(255, 60, 60, 255); @@ -289,7 +291,10 @@ void esp_draw() { int top = (int)(t.sy - t.h); int bot = (int)t.sy; surf_rect(0, left, top, right, bot); - if (t.show_health) { + bool draw_bar = t.show_health && esp_option(ESP_OPT_SHOW_HEALTHBAR); + bool draw_num = t.show_health && esp_option(ESP_OPT_SHOW_HEALTHNUM); + int num_x = right + 3; + if (draw_bar) { float frac = t.health / (t.maxhealth > 1.0f ? t.maxhealth : 100.0f); if (frac > 1) frac = 1; if (frac < 0) frac = 0; @@ -304,10 +309,14 @@ void esp_draw() { else surf_color(255, 40, 40, 255); if (fill_top < bot) surf_rect(1, bx0, fill_top, bx1, bot); + num_x = bx1 + 3; + } + if (draw_num) { char hptext[16]; snprintf(hptext, sizeof(hptext), "%d", (int)t.health); - draw_text_col(bx1 + 3, top, hptext, 255, 255, 255); + draw_text_col(num_x, top, hptext, 255, 255, 255); } - draw_text_col(left, top - 14, t.name, 255, 255, 255); + if (esp_option(ESP_OPT_SHOW_NAME)) + draw_text_col(left, top - 14, t.name, 255, 255, 255); } } -- cgit v1.2.3