summaryrefslogtreecommitdiffstats
path: root/src/menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 3e20cb3..0ed89d4 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -62,6 +62,7 @@ static FeatureState g_bhop{true, 0};
62static bool g_bhop_autostrafe = true; 62static bool g_bhop_autostrafe = true;
63 63
64static FeatureState g_abh{true, 0}; 64static FeatureState g_abh{true, 0};
65static FeatureState g_jumpbug{true, 0};
65static FeatureState g_esp{true, 0}; 66static FeatureState g_esp{true, 0};
66static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu 67static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu
67static FeatureState g_triggerbot{true, 603}; // default Mouse4 68static FeatureState g_triggerbot{true, 603}; // default Mouse4
@@ -96,6 +97,8 @@ static MenuNode g_bhop_active{NODE_TOGGLE, "Active", false, 0, {}, &g_bhop.activ
96static MenuNode g_bhop_autostrafe_node{NODE_TOGGLE, "Uni-directional auto-strafe", false, 0, {}, &g_bhop_autostrafe, nullptr, nullptr}; 97static MenuNode g_bhop_autostrafe_node{NODE_TOGGLE, "Uni-directional auto-strafe", false, 0, {}, &g_bhop_autostrafe, nullptr, nullptr};
97static MenuNode g_abh_feat{NODE_FEATURE, "ABH", false, 1, {}, nullptr, nullptr, nullptr}; 98static MenuNode g_abh_feat{NODE_FEATURE, "ABH", false, 1, {}, nullptr, nullptr, nullptr};
98static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, nullptr, nullptr}; 99static MenuNode g_abh_active{NODE_TOGGLE, "Active", false, 0, {}, &g_abh.active, nullptr, nullptr};
100static MenuNode g_jumpbug_feat{NODE_FEATURE, "Jumpbug", false, 1, {}, nullptr, nullptr, nullptr};
101static MenuNode g_jumpbug_active{NODE_TOGGLE, "Active", false, 0, {}, &g_jumpbug.active, nullptr, nullptr};
99static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr}; 102static MenuNode g_esp_feat{NODE_FEATURE, "ESP", false, 1, {}, nullptr, nullptr, nullptr};
100static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr}; 103static MenuNode g_esp_active{NODE_TOGGLE, "Active", false, 0, {}, &g_esp.active, nullptr, nullptr};
101static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = { 104static MenuNode g_esp_opt_nodes[ESP_OPT_COUNT] = {
@@ -145,6 +148,9 @@ static void build_tree() {
145 g_bhop_feat.children[1] = &g_bhop_autostrafe_node; 148 g_bhop_feat.children[1] = &g_bhop_autostrafe_node;
146 g_bhop_feat.child_count = 2; 149 g_bhop_feat.child_count = 2;
147 g_abh_feat.children[0] = &g_abh_active; 150 g_abh_feat.children[0] = &g_abh_active;
151 g_abh_feat.child_count = 1;
152 g_jumpbug_feat.children[0] = &g_jumpbug_active;
153 g_jumpbug_feat.child_count = 1;
148 g_esp_feat.children[0] = &g_esp_active; 154 g_esp_feat.children[0] = &g_esp_active;
149 g_aimbot_feat.children[0] = &g_aimbot_active; 155 g_aimbot_feat.children[0] = &g_aimbot_active;
150 g_aimbot_feat.children[1] = &g_aimbot_bind; 156 g_aimbot_feat.children[1] = &g_aimbot_bind;
@@ -169,11 +175,12 @@ static void build_tree() {
169 g_esp_feat.child_count = ESP_OPT_COUNT + 1; 175 g_esp_feat.child_count = ESP_OPT_COUNT + 1;
170 g_root.children[0] = &g_bhop_feat; 176 g_root.children[0] = &g_bhop_feat;
171 g_root.children[1] = &g_abh_feat; 177 g_root.children[1] = &g_abh_feat;
172 g_root.children[2] = &g_esp_feat; 178 g_root.children[2] = &g_jumpbug_feat;
173 g_root.children[3] = &g_aimbot_feat; 179 g_root.children[3] = &g_esp_feat;
174 g_root.children[4] = &g_triggerbot_feat; 180 g_root.children[4] = &g_aimbot_feat;
175 g_root.children[5] = &g_silentaim_feat; 181 g_root.children[5] = &g_triggerbot_feat;
176 g_root.child_count = 6; 182 g_root.children[6] = &g_silentaim_feat;
183 g_root.child_count = 7;
177} 184}
178 185
179static int g_depth[48]; // depth of each visible row (for indentation) 186static int g_depth[48]; // depth of each visible row (for indentation)
@@ -295,6 +302,7 @@ static void config_save() {
295 fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active, 302 fprintf(f, "[bhop]\nactive=%d\nbind=%d\nautostrafe=%d\n", g_bhop.active,
296 g_bhop.bind, g_bhop_autostrafe); 303 g_bhop.bind, g_bhop_autostrafe);
297 fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); 304 fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind);
305 fprintf(f, "[jumpbug]\nactive=%d\n", g_jumpbug.active);
298 fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" 306 fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n"
299 "fov=%d\nfov_circle=%d\n" 307 "fov=%d\nfov_circle=%d\n"
300 "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" 308 "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n"
@@ -332,6 +340,8 @@ static void config_load() {
332 cur = &g_bhop; 340 cur = &g_bhop;
333 else if (strstr(line, "[abh]")) 341 else if (strstr(line, "[abh]"))
334 cur = &g_abh; 342 cur = &g_abh;
343 else if (strstr(line, "[jumpbug]"))
344 cur = &g_jumpbug;
335 else if (strstr(line, "[esp]")) 345 else if (strstr(line, "[esp]"))
336 cur = &g_esp; 346 cur = &g_esp;
337 else if (strstr(line, "[aimbot]")) 347 else if (strstr(line, "[aimbot]"))
@@ -516,10 +526,10 @@ static bool key_pressed(int sc) {
516// feature gate queried from hl2h.cpp do_move(): feature must be Active AND 526// feature gate queried from hl2h.cpp do_move(): feature must be Active AND
517// its bind key held (always-on when unbound). 527// its bind key held (always-on when unbound).
518static FeatureState *feature_state(int feature) { 528static FeatureState *feature_state(int feature) {
519 static FeatureState *feats[6] = {&g_bhop, &g_abh, &g_esp, 529 static FeatureState *feats[7] = {&g_bhop, &g_abh, &g_esp,
520 &g_aimbot, &g_triggerbot, 530 &g_aimbot, &g_triggerbot, &g_silentaim,
521 &g_silentaim}; 531 &g_jumpbug};
522 if (feature < 0 || feature > 5) 532 if (feature < 0 || feature > 6)
523 return nullptr; 533 return nullptr;
524 return feats[feature]; 534 return feats[feature];
525} 535}