diff options
Diffstat (limited to '')
| -rw-r--r-- | src/menu.cpp | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index f590d69..9dffc9e 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -40,7 +40,7 @@ struct MenuNode { | |||
| 40 | const char *label; | 40 | const char *label; |
| 41 | bool expanded; // for root/feature: whether children are visible | 41 | bool expanded; // for root/feature: whether children are visible |
| 42 | int child_count; | 42 | int child_count; |
| 43 | MenuNode *children[8]; // max children per node | 43 | MenuNode *children[12]; // max children per node |
| 44 | 44 | ||
| 45 | // leaf data | 45 | // leaf data |
| 46 | bool *active_ptr; // NODE_TOGGLE: pointer to the active flag | 46 | bool *active_ptr; // NODE_TOGGLE: pointer to the active flag |
| @@ -65,6 +65,8 @@ static FeatureState g_abh{true, 0}; | |||
| 65 | static FeatureState g_jumpbug{true, 0}; | 65 | static FeatureState g_jumpbug{true, 0}; |
| 66 | static bool g_jumpbug_assist = false; | 66 | static bool g_jumpbug_assist = false; |
| 67 | static FeatureState g_melee{true, 0}; | 67 | static FeatureState g_melee{true, 0}; |
| 68 | static FeatureState g_spread{true, 0}; | ||
| 69 | static bool g_spread_no_spread = true; | ||
| 68 | static FeatureState g_esp{true, 0}; | 70 | static FeatureState g_esp{true, 0}; |
| 69 | static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu | 71 | static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu |
| 70 | static FeatureState g_triggerbot{true, 603}; // default Mouse4 | 72 | static FeatureState g_triggerbot{true, 603}; // default Mouse4 |
| @@ -104,6 +106,9 @@ static MenuNode g_jumpbug_active{NODE_TOGGLE, "Active", false, 0, {}, &g_jumpbug | |||
| 104 | static MenuNode g_jumpbug_assist_node{NODE_TOGGLE, "Assist timing", false, 0, {}, &g_jumpbug_assist, nullptr, nullptr}; | 106 | static MenuNode g_jumpbug_assist_node{NODE_TOGGLE, "Assist timing", false, 0, {}, &g_jumpbug_assist, nullptr, nullptr}; |
| 105 | static MenuNode g_melee_feat{NODE_FEATURE, "Melee killbot", false, 1, {}, nullptr, nullptr, nullptr}; | 107 | static MenuNode g_melee_feat{NODE_FEATURE, "Melee killbot", false, 1, {}, nullptr, nullptr, nullptr}; |
| 106 | static MenuNode g_melee_active{NODE_TOGGLE, "Active", false, 0, {}, &g_melee.active, nullptr, nullptr}; | 108 | static MenuNode g_melee_active{NODE_TOGGLE, "Active", false, 0, {}, &g_melee.active, nullptr, nullptr}; |
| 109 | static MenuNode g_spread_feat{NODE_FEATURE, "Spread control", false, 1, {}, nullptr, nullptr, nullptr}; | ||
| 110 | static MenuNode g_spread_active{NODE_TOGGLE, "Active", false, 0, {}, &g_spread.active, nullptr, nullptr}; | ||
| 111 | static MenuNode g_spread_no_spread_node{NODE_TOGGLE, "No spread", false, 0, {}, &g_spread_no_spread, nullptr, nullptr}; | ||
| 107 | static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; | 112 | static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; |
| 108 | static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; | 113 | static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; |
| 109 | static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { | 114 | static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { |
| @@ -161,6 +166,9 @@ static void build_tree() { | |||
| 161 | g_jumpbug_feat.child_count = 2; | 166 | g_jumpbug_feat.child_count = 2; |
| 162 | g_melee_feat.children[0] = &g_melee_active; | 167 | g_melee_feat.children[0] = &g_melee_active; |
| 163 | g_melee_feat.child_count = 1; | 168 | g_melee_feat.child_count = 1; |
| 169 | g_spread_feat.children[0] = &g_spread_active; | ||
| 170 | g_spread_feat.children[1] = &g_spread_no_spread_node; | ||
| 171 | g_spread_feat.child_count = 2; | ||
| 164 | g_esp_feat.children[0] = &g_esp_active; | 172 | g_esp_feat.children[0] = &g_esp_active; |
| 165 | g_aimbot_feat.children[0] = &g_aimbot_active; | 173 | g_aimbot_feat.children[0] = &g_aimbot_active; |
| 166 | g_aimbot_feat.children[1] = &g_aimbot_bind; | 174 | g_aimbot_feat.children[1] = &g_aimbot_bind; |
| @@ -187,11 +195,12 @@ static void build_tree() { | |||
| 187 | g_root.children[1] = &g_abh_feat; | 195 | g_root.children[1] = &g_abh_feat; |
| 188 | g_root.children[2] = &g_jumpbug_feat; | 196 | g_root.children[2] = &g_jumpbug_feat; |
| 189 | g_root.children[3] = &g_melee_feat; | 197 | g_root.children[3] = &g_melee_feat; |
| 190 | g_root.children[4] = &g_esp_feat; | 198 | g_root.children[4] = &g_spread_feat; |
| 191 | g_root.children[5] = &g_aimbot_feat; | 199 | g_root.children[5] = &g_esp_feat; |
| 192 | g_root.children[6] = &g_triggerbot_feat; | 200 | g_root.children[6] = &g_aimbot_feat; |
| 193 | g_root.children[7] = &g_silentaim_feat; | 201 | g_root.children[7] = &g_triggerbot_feat; |
| 194 | g_root.child_count = 8; | 202 | g_root.children[8] = &g_silentaim_feat; |
| 203 | g_root.child_count = 9; | ||
| 195 | } | 204 | } |
| 196 | 205 | ||
| 197 | static int g_depth[48]; // depth of each visible row (for indentation) | 206 | static int g_depth[48]; // depth of each visible row (for indentation) |
| @@ -316,6 +325,8 @@ static void config_save() { | |||
| 316 | fprintf(f, "[jumpbug]\nactive=%d\nassist=%d\n", g_jumpbug.active, | 325 | fprintf(f, "[jumpbug]\nactive=%d\nassist=%d\n", g_jumpbug.active, |
| 317 | (int)g_jumpbug_assist); | 326 | (int)g_jumpbug_assist); |
| 318 | fprintf(f, "[melee]\nactive=%d\n", g_melee.active); | 327 | fprintf(f, "[melee]\nactive=%d\n", g_melee.active); |
| 328 | fprintf(f, "[spread]\nactive=%d\nno_spread=%d\n", g_spread.active, | ||
| 329 | (int)g_spread_no_spread); | ||
| 319 | fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" | 330 | fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" |
| 320 | "fov=%d\nfov_circle=%d\n" | 331 | "fov=%d\nfov_circle=%d\n" |
| 321 | "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" | 332 | "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" |
| @@ -346,7 +357,7 @@ static void config_load() { | |||
| 346 | char line[256]; | 357 | char line[256]; |
| 347 | FeatureState *cur = nullptr; | 358 | FeatureState *cur = nullptr; |
| 348 | bool in_esp = false, in_bhop = false, in_aim = false, in_silent = false, | 359 | bool in_esp = false, in_bhop = false, in_aim = false, in_silent = false, |
| 349 | in_jumpbug = false; | 360 | in_jumpbug = false, in_spread = false; |
| 350 | while (fgets(line, sizeof(line), f)) { | 361 | while (fgets(line, sizeof(line), f)) { |
| 351 | line[strcspn(line, "\r\n")] = 0; | 362 | line[strcspn(line, "\r\n")] = 0; |
| 352 | if (line[0] == '[') { | 363 | if (line[0] == '[') { |
| @@ -358,6 +369,8 @@ static void config_load() { | |||
| 358 | cur = &g_jumpbug; | 369 | cur = &g_jumpbug; |
| 359 | else if (strstr(line, "[melee]")) | 370 | else if (strstr(line, "[melee]")) |
| 360 | cur = &g_melee; | 371 | cur = &g_melee; |
| 372 | else if (strstr(line, "[spread]")) | ||
| 373 | cur = &g_spread; | ||
| 361 | else if (strstr(line, "[esp]")) | 374 | else if (strstr(line, "[esp]")) |
| 362 | cur = &g_esp; | 375 | cur = &g_esp; |
| 363 | else if (strstr(line, "[aimbot]")) | 376 | else if (strstr(line, "[aimbot]")) |
| @@ -373,6 +386,7 @@ static void config_load() { | |||
| 373 | in_aim = (cur == &g_aimbot); | 386 | in_aim = (cur == &g_aimbot); |
| 374 | in_silent = (cur == &g_silentaim); | 387 | in_silent = (cur == &g_silentaim); |
| 375 | in_jumpbug = (cur == &g_jumpbug); | 388 | in_jumpbug = (cur == &g_jumpbug); |
| 389 | in_spread = (cur == &g_spread); | ||
| 376 | } else if (cur) { | 390 | } else if (cur) { |
| 377 | char *eq = strchr(line, '='); | 391 | char *eq = strchr(line, '='); |
| 378 | if (!eq) | 392 | if (!eq) |
| @@ -385,6 +399,9 @@ static void config_load() { | |||
| 385 | if (in_jumpbug && strcmp(key, "assist") == 0) { | 399 | if (in_jumpbug && strcmp(key, "assist") == 0) { |
| 386 | g_jumpbug_assist = atoi(val) != 0; | 400 | g_jumpbug_assist = atoi(val) != 0; |
| 387 | } | 401 | } |
| 402 | if (in_spread && strcmp(key, "no_spread") == 0) { | ||
| 403 | g_spread_no_spread = atoi(val) != 0; | ||
| 404 | } | ||
| 388 | if (in_aim) { | 405 | if (in_aim) { |
| 389 | if (strcmp(key, "smooth") == 0) { | 406 | if (strcmp(key, "smooth") == 0) { |
| 390 | int v = atoi(val); | 407 | int v = atoi(val); |
| @@ -546,10 +563,10 @@ static bool key_pressed(int sc) { | |||
| 546 | // feature gate queried from hl2h.cpp do_move(): feature must be Active AND | 563 | // feature gate queried from hl2h.cpp do_move(): feature must be Active AND |
| 547 | // its bind key held (always-on when unbound). | 564 | // its bind key held (always-on when unbound). |
| 548 | static FeatureState *feature_state(int feature) { | 565 | static FeatureState *feature_state(int feature) { |
| 549 | static FeatureState *feats[8] = {&g_bhop, &g_abh, &g_esp, | 566 | static FeatureState *feats[9] = {&g_bhop, &g_abh, &g_esp, |
| 550 | &g_aimbot, &g_triggerbot, &g_silentaim, | 567 | &g_aimbot, &g_triggerbot, &g_silentaim, |
| 551 | &g_jumpbug, &g_melee}; | 568 | &g_jumpbug, &g_melee, &g_spread}; |
| 552 | if (feature < 0 || feature > 7) | 569 | if (feature < 0 || feature > 8) |
| 553 | return nullptr; | 570 | return nullptr; |
| 554 | return feats[feature]; | 571 | return feats[feature]; |
| 555 | } | 572 | } |
| @@ -579,6 +596,8 @@ bool bhop_autostrafe_enabled() { return g_bhop_autostrafe; } | |||
| 579 | 596 | ||
| 580 | bool jumpbug_assist_enabled() { return g_jumpbug_assist; } | 597 | bool jumpbug_assist_enabled() { return g_jumpbug_assist; } |
| 581 | 598 | ||
| 599 | bool spread_no_spread_enabled() { return g_spread_no_spread; } | ||
| 600 | |||
| 582 | unsigned aimbot_bone_mask() { | 601 | unsigned aimbot_bone_mask() { |
| 583 | unsigned m = 0; | 602 | unsigned m = 0; |
| 584 | if (g_aim_bones[AIM_BONE_HEAD]) | 603 | if (g_aim_bones[AIM_BONE_HEAD]) |
