diff options
Diffstat (limited to 'src/menu.cpp')
| -rw-r--r-- | src/menu.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index d26b62e..585695c 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -61,6 +61,7 @@ static bool g_bhop_autostrafe = true; | |||
| 61 | static FeatureState g_abh{true, 0}; | 61 | static FeatureState g_abh{true, 0}; |
| 62 | static FeatureState g_esp{true, 0}; | 62 | static FeatureState g_esp{true, 0}; |
| 63 | static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu | 63 | static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu |
| 64 | static FeatureState g_triggerbot{true, 603}; // default Mouse4 | ||
| 64 | 65 | ||
| 65 | // Aimbot bone checklist. Head defaults on (v1 behaviour). | 66 | // Aimbot bone checklist. Head defaults on (v1 behaviour). |
| 66 | enum { | 67 | enum { |
| @@ -113,6 +114,9 @@ static MenuNode g_aimbot_bone_nodes[AIM_BONE_COUNT] = { | |||
| 113 | }; | 114 | }; |
| 114 | static MenuNode g_aimbot_smooth_node{NODE_VALUE, "Smoothness", false, 0, {}, nullptr, | 115 | static MenuNode g_aimbot_smooth_node{NODE_VALUE, "Smoothness", false, 0, {}, nullptr, |
| 115 | nullptr, nullptr, &g_aim_smooth, 1, 45, 1}; | 116 | nullptr, nullptr, &g_aim_smooth, 1, 45, 1}; |
| 117 | static MenuNode g_triggerbot_feat{NODE_FEATURE, "Triggerbot", false, 1, {}, nullptr, nullptr, nullptr}; | ||
| 118 | static MenuNode g_triggerbot_active{NODE_TOGGLE, "Active", false, 0, {}, &g_triggerbot.active, nullptr, nullptr}; | ||
| 119 | static MenuNode g_triggerbot_bind{NODE_BIND, "Bind", false, 0, {}, nullptr, &g_triggerbot.bind, nullptr}; | ||
| 116 | 120 | ||
| 117 | static MenuNode *g_visible[32]; // flattened visible nodes for arrow navigation | 121 | static MenuNode *g_visible[32]; // flattened visible nodes for arrow navigation |
| 118 | static int g_visible_count = 0; | 122 | static int g_visible_count = 0; |
| @@ -135,6 +139,9 @@ static void build_tree() { | |||
| 135 | for (int i = 0; i < AIM_BONE_COUNT; i++) | 139 | for (int i = 0; i < AIM_BONE_COUNT; i++) |
| 136 | g_aimbot_bones_feat.children[i] = &g_aimbot_bone_nodes[i]; | 140 | g_aimbot_bones_feat.children[i] = &g_aimbot_bone_nodes[i]; |
| 137 | g_aimbot_bones_feat.child_count = AIM_BONE_COUNT; | 141 | g_aimbot_bones_feat.child_count = AIM_BONE_COUNT; |
| 142 | g_triggerbot_feat.children[0] = &g_triggerbot_active; | ||
| 143 | g_triggerbot_feat.children[1] = &g_triggerbot_bind; | ||
| 144 | g_triggerbot_feat.child_count = 2; | ||
| 138 | for (int i = 0; i < ESP_OPT_COUNT; i++) | 145 | for (int i = 0; i < ESP_OPT_COUNT; i++) |
| 139 | g_esp_feat.children[i + 1] = &g_esp_opt_nodes[i]; | 146 | g_esp_feat.children[i + 1] = &g_esp_opt_nodes[i]; |
| 140 | g_esp_feat.child_count = ESP_OPT_COUNT + 1; | 147 | g_esp_feat.child_count = ESP_OPT_COUNT + 1; |
| @@ -142,7 +149,8 @@ static void build_tree() { | |||
| 142 | g_root.children[1] = &g_abh_feat; | 149 | g_root.children[1] = &g_abh_feat; |
| 143 | g_root.children[2] = &g_esp_feat; | 150 | g_root.children[2] = &g_esp_feat; |
| 144 | g_root.children[3] = &g_aimbot_feat; | 151 | g_root.children[3] = &g_aimbot_feat; |
| 145 | g_root.child_count = 4; | 152 | g_root.children[4] = &g_triggerbot_feat; |
| 153 | g_root.child_count = 5; | ||
| 146 | } | 154 | } |
| 147 | 155 | ||
| 148 | static int g_depth[32]; // depth of each visible row (for indentation) | 156 | static int g_depth[32]; // depth of each visible row (for indentation) |
| @@ -214,6 +222,8 @@ static void config_save() { | |||
| 214 | g_aim_bones[AIM_BONE_HEAD], g_aim_bones[AIM_BONE_TORSO], | 222 | g_aim_bones[AIM_BONE_HEAD], g_aim_bones[AIM_BONE_TORSO], |
| 215 | g_aim_bones[AIM_BONE_LARM], g_aim_bones[AIM_BONE_RARM], | 223 | g_aim_bones[AIM_BONE_LARM], g_aim_bones[AIM_BONE_RARM], |
| 216 | g_aim_bones[AIM_BONE_LLEG], g_aim_bones[AIM_BONE_RLEG]); | 224 | g_aim_bones[AIM_BONE_LLEG], g_aim_bones[AIM_BONE_RLEG]); |
| 225 | fprintf(f, "[triggerbot]\nactive=%d\nbind=%d\n", g_triggerbot.active, | ||
| 226 | g_triggerbot.bind); | ||
| 217 | fprintf(f, "[esp]\nactive=%d\nbind=%d\nneutral=%d\nhealthbar=%d\n" | 227 | fprintf(f, "[esp]\nactive=%d\nbind=%d\nneutral=%d\nhealthbar=%d\n" |
| 218 | "healthnum=%d\nname=%d\nskeleton=%d\nbox=%d\n", | 228 | "healthnum=%d\nname=%d\nskeleton=%d\nbox=%d\n", |
| 219 | g_esp.active, g_esp.bind, g_esp_opt[ESP_OPT_SHOW_NEUTRAL], | 229 | g_esp.active, g_esp.bind, g_esp_opt[ESP_OPT_SHOW_NEUTRAL], |
| @@ -241,6 +251,8 @@ static void config_load() { | |||
| 241 | cur = &g_esp; | 251 | cur = &g_esp; |
| 242 | else if (strstr(line, "[aimbot]")) | 252 | else if (strstr(line, "[aimbot]")) |
| 243 | cur = &g_aimbot; | 253 | cur = &g_aimbot; |
| 254 | else if (strstr(line, "[triggerbot]")) | ||
| 255 | cur = &g_triggerbot; | ||
| 244 | else | 256 | else |
| 245 | cur = nullptr; | 257 | cur = nullptr; |
| 246 | in_esp = (cur == &g_esp); | 258 | in_esp = (cur == &g_esp); |
| @@ -401,8 +413,9 @@ static bool key_pressed(int sc) { | |||
| 401 | // feature gate queried from hl2h.cpp do_move(): feature must be Active AND | 413 | // feature gate queried from hl2h.cpp do_move(): feature must be Active AND |
| 402 | // its bind key held (always-on when unbound). | 414 | // its bind key held (always-on when unbound). |
| 403 | bool feature_active(int feature) { | 415 | bool feature_active(int feature) { |
| 404 | static FeatureState *feats[4] = {&g_bhop, &g_abh, &g_esp, &g_aimbot}; | 416 | static FeatureState *feats[5] = {&g_bhop, &g_abh, &g_esp, &g_aimbot, |
| 405 | if (feature < 0 || feature > 3) | 417 | &g_triggerbot}; |
| 418 | if (feature < 0 || feature > 4) | ||
| 406 | return false; | 419 | return false; |
| 407 | FeatureState *f = feats[feature]; | 420 | FeatureState *f = feats[feature]; |
| 408 | if (!f->active) | 421 | if (!f->active) |
| @@ -479,7 +492,7 @@ static void menu_handle_input() { | |||
| 479 | MenuNode *n = g_visible[g_selected]; | 492 | MenuNode *n = g_visible[g_selected]; |
| 480 | if (n->bind_ptr) { | 493 | if (n->bind_ptr) { |
| 481 | // clear same bind from other features | 494 | // clear same bind from other features |
| 482 | FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot}; | 495 | FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot, &g_triggerbot}; |
| 483 | for (auto *f : features) | 496 | for (auto *f : features) |
| 484 | if (&f->bind != n->bind_ptr && f->bind == i) | 497 | if (&f->bind != n->bind_ptr && f->bind == i) |
| 485 | f->bind = 0; | 498 | f->bind = 0; |
| @@ -694,10 +707,11 @@ void outer_draw() { | |||
| 694 | draw_text(270, 10 + i * 20, "[press key]"); | 707 | draw_text(270, 10 + i * 20, "[press key]"); |
| 695 | else { | 708 | else { |
| 696 | /* stable name for current bind */ | 709 | /* stable name for current bind */ |
| 697 | static char bn[3][32]; | 710 | static char bn[4][32]; |
| 698 | static FeatureState *feats[] = {&g_bhop, &g_abh, &g_aimbot}; | 711 | static FeatureState *feats[] = {&g_bhop, &g_abh, &g_aimbot, |
| 712 | &g_triggerbot}; | ||
| 699 | int fi = 0; | 713 | int fi = 0; |
| 700 | for (int k = 0; k < 3; k++) | 714 | for (int k = 0; k < 4; k++) |
| 701 | if (n->bind_ptr == &feats[k]->bind) | 715 | if (n->bind_ptr == &feats[k]->bind) |
| 702 | fi = k; | 716 | fi = k; |
| 703 | snprintf(bn[fi], 32, "[%s]", scancode_name(*n->bind_ptr)); | 717 | snprintf(bn[fi], 32, "[%s]", scancode_name(*n->bind_ptr)); |
