diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 17:51:20 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 17:51:20 +0100 |
| commit | 49df428d95a7c443d418d5b7e2a93af599b54f76 (patch) | |
| tree | 604e64048aacc5e2b86f441e03e5e5ab8600bef2 /src/menu.cpp | |
| parent | Items: skip the CNetworkArray length header for m_iAmmo/m_hMyWeapons (diff) | |
| download | hl2h-49df428d95a7c443d418d5b7e2a93af599b54f76.tar.gz hl2h-49df428d95a7c443d418d5b7e2a93af599b54f76.zip | |
Add chams
- Hook IVModelRender::DrawModelExecute (VEngineModel016 slot 19) and force
models/debug/debugwhite for NPC models, identified by
ModelRenderInfo_t::entity_index.
- Two passes: MATERIAL_VAR_IGNOREZ through walls, then normal depth, with
IMaterial::ColorModulate for the configured colour; restore the shared
material's flag/colour afterwards.
- Material lookup via the IMaterialSystem list, FindMaterial fallback.
- New Chams feature/card with Through walls and colour; [chams] config.
- Remove the temporary ammo/projectile/fuse diagnostics.
Diffstat (limited to '')
| -rw-r--r-- | src/menu.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index 521bf43..77eb35f 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -63,6 +63,9 @@ FeatureState g_skybox{false, 0}; // skybox.png image override | |||
| 63 | FeatureState g_projectiles{true, 0}; // grenade / rocket ESP | 63 | FeatureState g_projectiles{true, 0}; // grenade / rocket ESP |
| 64 | bool g_proj_fuse = true; | 64 | bool g_proj_fuse = true; |
| 65 | bool g_proj_radius = true; | 65 | bool g_proj_radius = true; |
| 66 | FeatureState g_chams{false, 0}; // flat model material, optional through walls | ||
| 67 | bool g_chams_walls = true; | ||
| 68 | int g_chams_rgb[3] = {255, 60, 60}; | ||
| 66 | bool g_item_health = true; | 69 | bool g_item_health = true; |
| 67 | bool g_item_ammo = true; | 70 | bool g_item_ammo = true; |
| 68 | bool g_item_armor = true; | 71 | bool g_item_armor = true; |
| @@ -234,6 +237,9 @@ void config_save() { | |||
| 234 | fprintf(f, "[projectiles]\nactive=%d\nbind=%d\nfuse=%d\nradius=%d\n", | 237 | fprintf(f, "[projectiles]\nactive=%d\nbind=%d\nfuse=%d\nradius=%d\n", |
| 235 | g_projectiles.active, g_projectiles.bind, (int)g_proj_fuse, | 238 | g_projectiles.active, g_projectiles.bind, (int)g_proj_fuse, |
| 236 | (int)g_proj_radius); | 239 | (int)g_proj_radius); |
| 240 | fprintf(f, "[chams]\nactive=%d\nbind=%d\nwalls=%d\nr=%d\ng=%d\nb=%d\n", | ||
| 241 | g_chams.active, g_chams.bind, (int)g_chams_walls, g_chams_rgb[0], | ||
| 242 | g_chams_rgb[1], g_chams_rgb[2]); | ||
| 237 | fprintf(f, "[items]\nactive=%d\nbind=%d\nhealth=%d\nammo=%d\n" | 243 | fprintf(f, "[items]\nactive=%d\nbind=%d\nhealth=%d\nammo=%d\n" |
| 238 | "armor=%d\nweapons=%d\ncrates=%d\ndistance=%d\nmax_dist=%d\n" | 244 | "armor=%d\nweapons=%d\ncrates=%d\ndistance=%d\nmax_dist=%d\n" |
| 239 | "usable=%d\n", | 245 | "usable=%d\n", |
| @@ -284,7 +290,7 @@ static bool config_load() { | |||
| 284 | bool in_esp = false, in_bhop = false, in_aim = false, | 290 | bool in_esp = false, in_bhop = false, in_aim = false, |
| 285 | in_jumpbug = false, in_spread = false, in_items = false, | 291 | in_jumpbug = false, in_spread = false, in_items = false, |
| 286 | in_tint = false, in_fog = false, in_view = false, in_movement = false, | 292 | in_tint = false, in_fog = false, in_view = false, in_movement = false, |
| 287 | in_proj = false; | 293 | in_proj = false, in_chams = false; |
| 288 | while (fgets(line, sizeof(line), f)) { | 294 | while (fgets(line, sizeof(line), f)) { |
| 289 | line[strcspn(line, "\r\n")] = 0; | 295 | line[strcspn(line, "\r\n")] = 0; |
| 290 | if (line[0] == '[') { | 296 | if (line[0] == '[') { |
| @@ -312,6 +318,8 @@ static bool config_load() { | |||
| 312 | cur = &g_skybox; | 318 | cur = &g_skybox; |
| 313 | else if (strstr(line, "[projectiles]")) | 319 | else if (strstr(line, "[projectiles]")) |
| 314 | cur = &g_projectiles; | 320 | cur = &g_projectiles; |
| 321 | else if (strstr(line, "[chams]")) | ||
| 322 | cur = &g_chams; | ||
| 315 | else if (strstr(line, "[aimbot]")) | 323 | else if (strstr(line, "[aimbot]")) |
| 316 | cur = &g_aimbot; | 324 | cur = &g_aimbot; |
| 317 | else if (strstr(line, "[triggerbot]")) | 325 | else if (strstr(line, "[triggerbot]")) |
| @@ -335,6 +343,7 @@ static bool config_load() { | |||
| 335 | in_view = strstr(line, "[view]") != nullptr; | 343 | in_view = strstr(line, "[view]") != nullptr; |
| 336 | in_movement = strstr(line, "[movement]") != nullptr; | 344 | in_movement = strstr(line, "[movement]") != nullptr; |
| 337 | in_proj = (cur == &g_projectiles); | 345 | in_proj = (cur == &g_projectiles); |
| 346 | in_chams = (cur == &g_chams); | ||
| 338 | } else if (cur || in_view || in_movement) { | 347 | } else if (cur || in_view || in_movement) { |
| 339 | char *eq = strchr(line, '='); | 348 | char *eq = strchr(line, '='); |
| 340 | if (!eq) | 349 | if (!eq) |
| @@ -381,6 +390,17 @@ static bool config_load() { | |||
| 381 | else if (strcmp(key, "radius") == 0) | 390 | else if (strcmp(key, "radius") == 0) |
| 382 | g_proj_radius = atoi(val) != 0; | 391 | g_proj_radius = atoi(val) != 0; |
| 383 | } | 392 | } |
| 393 | if (in_chams) { | ||
| 394 | if (strcmp(key, "walls") == 0) | ||
| 395 | g_chams_walls = atoi(val) != 0; | ||
| 396 | else if (strcmp(key, "r") == 0 || strcmp(key, "g") == 0 || | ||
| 397 | strcmp(key, "b") == 0) { | ||
| 398 | int v = atoi(val); | ||
| 399 | if (v < 0) v = 0; | ||
| 400 | if (v > 255) v = 255; | ||
| 401 | g_chams_rgb[key[0] == 'r' ? 0 : key[0] == 'g' ? 1 : 2] = v; | ||
| 402 | } | ||
| 403 | } | ||
| 384 | if (in_aim) { | 404 | if (in_aim) { |
| 385 | if (strcmp(key, "smooth") == 0) { | 405 | if (strcmp(key, "smooth") == 0) { |
| 386 | int v = atoi(val); | 406 | int v = atoi(val); |
| @@ -605,6 +625,11 @@ void config_reset_defaults() { | |||
| 605 | g_projectiles = {true, 0}; | 625 | g_projectiles = {true, 0}; |
| 606 | g_proj_fuse = true; | 626 | g_proj_fuse = true; |
| 607 | g_proj_radius = true; | 627 | g_proj_radius = true; |
| 628 | g_chams = {false, 0}; | ||
| 629 | g_chams_walls = true; | ||
| 630 | g_chams_rgb[0] = 255; | ||
| 631 | g_chams_rgb[1] = 60; | ||
| 632 | g_chams_rgb[2] = 60; | ||
| 608 | g_item_health = true; | 633 | g_item_health = true; |
| 609 | g_item_ammo = true; | 634 | g_item_ammo = true; |
| 610 | g_item_armor = true; | 635 | g_item_armor = true; |
| @@ -738,7 +763,8 @@ static FeatureState *feature_state(int feature) { | |||
| 738 | static FeatureState *feats[FEAT_COUNT] = { | 763 | static FeatureState *feats[FEAT_COUNT] = { |
| 739 | &g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, | 764 | &g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, |
| 740 | &g_silentaim, &g_jumpbug, &g_melee, &g_spread, &g_item_esp, | 765 | &g_silentaim, &g_jumpbug, &g_melee, &g_spread, &g_item_esp, |
| 741 | &g_fullbright, &g_world_tint, &g_fog, &g_skybox, &g_projectiles}; | 766 | &g_fullbright, &g_world_tint, &g_fog, &g_skybox, &g_projectiles, |
| 767 | &g_chams}; | ||
| 742 | if (feature < 0 || feature >= FEAT_COUNT) | 768 | if (feature < 0 || feature >= FEAT_COUNT) |
| 743 | return nullptr; | 769 | return nullptr; |
| 744 | return feats[feature]; | 770 | return feats[feature]; |
