From 9904891162a6749d39110110c0812a64c241a7ea Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 21:22:47 +0100 Subject: Remove stucklaunch; add valuable-item ESP - Drop the stucklaunch feature, its settings, diagnostics and m_hGroundEntity resolution. - Add a Visuals feature that scans the client entity list for valuable pickups: health/medkits/chargers, ammo boxes/crates/grenades, batteries, HEV suit modules/chargers, supply crates and generic items. - Model-first classification with class fallbacks; category toggles, distance labels and a max-distance slider. - Draw colored marker/label tags through walls, independent of the hostile NPC ESP. - Persist [items] active/bind/health/ammo/armor/crates/distance/max_dist; Reset restores defaults; GUI card and CONTEXT updated. --- src/menu.cpp | 84 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 40 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index cc3890a..af8d10d 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -44,11 +44,13 @@ FeatureState g_esp{true, 0}; FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in the GUI FeatureState g_triggerbot{true, 603}; // default Mouse4 FeatureState g_silentaim{true, 602}; // default Mouse3 -FeatureState g_stucklaunch{false, 0}; // opt-in movement assist -bool g_stucklaunch_use_spam = true; -bool g_stucklaunch_gravspam = false; -bool g_stucklaunch_autostrafe = true; -int g_stucklaunch_spam_ticks = 2; +FeatureState g_item_esp{true, 0}; // valuable item tags, always-on by default +bool g_item_health = true; +bool g_item_ammo = true; +bool g_item_armor = true; +bool g_item_crates = true; +bool g_item_distance = true; +int g_item_max_dist = 2500; // Aimbot bone checklist. Head defaults on (v1 behaviour). bool g_aim_bones[AIM_BONE_COUNT] = {true, false, false, @@ -163,11 +165,6 @@ void config_save() { fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active, g_bhop.bind, g_bhop_autostrafe); fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); - fprintf(f, "[stucklaunch]\nactive=%d\nbind=%d\nuse_spam=%d\n" - "gravspam=%d\nautostrafe=%d\nspam_ticks=%d\n", - g_stucklaunch.active, g_stucklaunch.bind, - (int)g_stucklaunch_use_spam, (int)g_stucklaunch_gravspam, - (int)g_stucklaunch_autostrafe, g_stucklaunch_spam_ticks); fprintf(f, "[jumpbug]\nactive=%d\nbind=%d\nassist=%d\n", g_jumpbug.active, g_jumpbug.bind, (int)g_jumpbug_assist); fprintf(f, "[melee]\nactive=%d\nbind=%d\n", g_melee.active, g_melee.bind); @@ -186,6 +183,11 @@ void config_save() { g_triggerbot.bind); fprintf(f, "[silentaim]\nactive=%d\nbind=%d\nfov=%d\n", g_silentaim.active, g_silentaim.bind, g_silent_fov); + fprintf(f, "[items]\nactive=%d\nbind=%d\nhealth=%d\nammo=%d\n" + "armor=%d\ncrates=%d\ndistance=%d\nmax_dist=%d\n", + g_item_esp.active, g_item_esp.bind, (int)g_item_health, + (int)g_item_ammo, (int)g_item_armor, (int)g_item_crates, + (int)g_item_distance, g_item_max_dist); fprintf(f, "[esp]\nactive=%d\nbind=%d\nneutral=%d\nhealthbar=%d\n" "healthnum=%d\nname=%d\nskeleton=%d\nbox=%d\nspeedgraph=%d\n", g_esp.active, g_esp.bind, g_esp_opt[ESP_OPT_SHOW_NEUTRAL], @@ -214,7 +216,7 @@ static bool config_load() { char line[256]; FeatureState *cur = nullptr; bool in_esp = false, in_bhop = false, in_aim = false, in_silent = false, - in_jumpbug = false, in_spread = false, in_stucklaunch = false; + in_jumpbug = false, in_spread = false, in_items = false; while (fgets(line, sizeof(line), f)) { line[strcspn(line, "\r\n")] = 0; if (line[0] == '[') { @@ -222,8 +224,6 @@ static bool config_load() { cur = &g_bhop; else if (strstr(line, "[abh]")) cur = &g_abh; - else if (strstr(line, "[stucklaunch]")) - cur = &g_stucklaunch; else if (strstr(line, "[jumpbug]")) cur = &g_jumpbug; else if (strstr(line, "[melee]")) @@ -232,6 +232,8 @@ static bool config_load() { cur = &g_spread; else if (strstr(line, "[esp]")) cur = &g_esp; + else if (strstr(line, "[items]")) + cur = &g_item_esp; else if (strstr(line, "[aimbot]")) cur = &g_aimbot; else if (strstr(line, "[triggerbot]")) @@ -246,7 +248,7 @@ static bool config_load() { in_silent = (cur == &g_silentaim); in_jumpbug = (cur == &g_jumpbug); in_spread = (cur == &g_spread); - in_stucklaunch = (cur == &g_stucklaunch); + in_items = (cur == &g_item_esp); } else if (cur) { char *eq = strchr(line, '='); if (!eq) @@ -262,18 +264,22 @@ static bool config_load() { if (in_spread && strcmp(key, "no_spread") == 0) { g_spread_no_spread = atoi(val) != 0; } - if (in_stucklaunch) { - if (strcmp(key, "use_spam") == 0) - g_stucklaunch_use_spam = atoi(val) != 0; - else if (strcmp(key, "gravspam") == 0) - g_stucklaunch_gravspam = atoi(val) != 0; - else if (strcmp(key, "autostrafe") == 0) - g_stucklaunch_autostrafe = atoi(val) != 0; - else if (strcmp(key, "spam_ticks") == 0) { + if (in_items) { + if (strcmp(key, "health") == 0) + g_item_health = atoi(val) != 0; + else if (strcmp(key, "ammo") == 0) + g_item_ammo = atoi(val) != 0; + else if (strcmp(key, "armor") == 0) + g_item_armor = atoi(val) != 0; + else if (strcmp(key, "crates") == 0) + g_item_crates = atoi(val) != 0; + else if (strcmp(key, "distance") == 0) + g_item_distance = atoi(val) != 0; + else if (strcmp(key, "max_dist") == 0) { int v = atoi(val); - if (v < 1) v = 1; - if (v > 16) v = 16; - g_stucklaunch_spam_ticks = v; + if (v < 250) v = 250; + if (v > 5000) v = 5000; + g_item_max_dist = v; } } if (in_aim) { @@ -354,11 +360,6 @@ void config_reset_defaults() { g_bhop = {true, 0}; g_bhop_autostrafe = true; g_abh = {true, 0}; - g_stucklaunch = {false, 0}; - g_stucklaunch_use_spam = true; - g_stucklaunch_gravspam = false; - g_stucklaunch_autostrafe = true; - g_stucklaunch_spam_ticks = 2; g_jumpbug = {true, 0}; g_jumpbug_assist = false; g_melee = {true, 0}; @@ -367,6 +368,13 @@ void config_reset_defaults() { g_esp = {true, 0}; for (int i = 0; i < ESP_OPT_COUNT; i++) g_esp_opt[i] = true; + g_item_esp = {true, 0}; + g_item_health = true; + g_item_ammo = true; + g_item_armor = true; + g_item_crates = true; + g_item_distance = true; + g_item_max_dist = 2500; g_aimbot = {true, 604}; g_triggerbot = {true, 603}; g_silentaim = {true, 602}; @@ -476,7 +484,7 @@ static bool key_held(int sc) { static FeatureState *feature_state(int feature) { static FeatureState *feats[FEAT_COUNT] = { &g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, - &g_silentaim, &g_jumpbug, &g_melee, &g_spread, &g_stucklaunch}; + &g_silentaim, &g_jumpbug, &g_melee, &g_spread, &g_item_esp}; if (feature < 0 || feature >= FEAT_COUNT) return nullptr; return feats[feature]; @@ -509,14 +517,6 @@ bool jumpbug_assist_enabled() { return g_jumpbug_assist; } bool spread_no_spread_enabled() { return g_spread_no_spread; } -bool stucklaunch_use_spam_enabled() { return g_stucklaunch_use_spam; } - -bool stucklaunch_gravspam_enabled() { return g_stucklaunch_gravspam; } - -bool stucklaunch_autostrafe_enabled() { return g_stucklaunch_autostrafe; } - -int stucklaunch_spam_ticks() { return g_stucklaunch_spam_ticks; } - unsigned aimbot_bone_mask() { unsigned m = 0; if (g_aim_bones[AIM_BONE_HEAD]) @@ -658,8 +658,10 @@ void outer_draw() { // HL2H_DRAW_TEST=1 draws a probe rect without needing the GUI open static bool draw_test = getenv("HL2H_DRAW_TEST") != nullptr; bool esp_on = feature_active(FEAT_ESP); + bool items_on = feature_active(FEAT_ITEM_ESP); bool toasts = gui_toasts_active(); - if (!g_surface || (!gui_is_open() && !draw_test && !esp_on && !toasts)) + if (!g_surface || + (!gui_is_open() && !draw_test && !esp_on && !items_on && !toasts)) return; // Level/menu -> game transitions can invalidate the VGUI font handle. @@ -709,6 +711,8 @@ void outer_draw() { surf_push_make_current(panel, false); if (esp_on && overlay_font) esp_draw(); + if (items_on && overlay_font) + esp_draw_items(); if (draw_test && overlay_font) { surf_draw_set_color(255, 0, 0, 255); surf_draw_filled_rect(20, 20, 180, 60); -- cgit v1.2.3