From ba500fef7fbf94725f18541b0e23a45591379dba Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 20:15:51 +0100 Subject: Fix tooltip truncation; add Stucklaunch assist Tooltips: text_in() shifted the x position to fit the full string before truncating, which drew the tooltip text outside its box. Truncate to the available width first, then clamp inside the clip. Stucklaunch (Movement): - opt-in feature (Active off by default) with its own bind; - holds jump, alternates +use every 2 ticks to regrab a physics prop, optionally +attack while the gravity gun is active, and air-strafes; - engagement uses m_hGroundEntity (client netvar) latched for ~0.5 s so the prop stays active while airborne; falls back to running whenever active if the netvar is unavailable, with a startup warning to bind it; - does not spawn or place props; the player supplies the prop and initial speed. Config gets [stucklaunch] active/bind/use_spam/gravspam/autostrafe; Reset restores those defaults. CONTEXT documents the assist and its limits. --- src/menu.cpp | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index 3d008bb..00ba9be 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -44,6 +44,10 @@ 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; // Aimbot bone checklist. Head defaults on (v1 behaviour). bool g_aim_bones[AIM_BONE_COUNT] = {true, false, false, @@ -158,6 +162,11 @@ 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\n", + g_stucklaunch.active, g_stucklaunch.bind, + (int)g_stucklaunch_use_spam, (int)g_stucklaunch_gravspam, + (int)g_stucklaunch_autostrafe); 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); @@ -204,7 +213,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_jumpbug = false, in_spread = false, in_stucklaunch = false; while (fgets(line, sizeof(line), f)) { line[strcspn(line, "\r\n")] = 0; if (line[0] == '[') { @@ -212,6 +221,8 @@ 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]")) @@ -234,6 +245,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); } else if (cur) { char *eq = strchr(line, '='); if (!eq) @@ -249,6 +261,14 @@ 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; + } if (in_aim) { if (strcmp(key, "smooth") == 0) { int v = atoi(val); @@ -327,6 +347,10 @@ 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_jumpbug = {true, 0}; g_jumpbug_assist = false; g_melee = {true, 0}; @@ -432,10 +456,10 @@ static bool key_held(int sc) { // feature gate queried from hl2h.cpp do_move(): feature must be Active AND // its bind key held (always-on when unbound). static FeatureState *feature_state(int feature) { - static FeatureState *feats[9] = {&g_bhop, &g_abh, &g_esp, - &g_aimbot, &g_triggerbot, &g_silentaim, - &g_jumpbug, &g_melee, &g_spread}; - if (feature < 0 || feature > 8) + 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}; + if (feature < 0 || feature >= FEAT_COUNT) return nullptr; return feats[feature]; } @@ -467,6 +491,12 @@ 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; } + unsigned aimbot_bone_mask() { unsigned m = 0; if (g_aim_bones[AIM_BONE_HEAD]) -- cgit v1.2.3