diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-03 22:22:08 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-03 22:22:08 +0100 |
| commit | 4b7dd1ca76ff0f97d53038ac9a11165f2fc68528 (patch) | |
| tree | d30473e54ecbb18f14e54e7cf678e7e7dc1a2a52 /src/menu.cpp | |
| parent | Vischeck: only glass materials are glass; log font/glass diagnostics (diff) | |
| download | hl2h-4b7dd1ca76ff0f97d53038ac9a11165f2fc68528.tar.gz hl2h-4b7dd1ca76ff0f97d53038ac9a11165f2fc68528.zip | |
World: add Fullbright visual feature
- New Visuals card with the usual Active + Bind; default off. Unbound+Active
is always-on, a bind makes it hold-to-brighten.
- Resolve VEngineCvar004 and set mat_fullbright 1/0 through FindVar (slot 12)
and ConVar::SetValue(int) (slot 11), bypassing the console cheat gate.
Fall back to ClientCmd if the cvar interface is unavailable.
- Reapply after map loads/respawns and persist [fullbright] active/bind.
- Log on/off; show an error toast if the cvar cannot be applied.
Diffstat (limited to 'src/menu.cpp')
| -rw-r--r-- | src/menu.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index 2d4c660..0c022e4 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -45,6 +45,7 @@ FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in the GUI | |||
| 45 | FeatureState g_triggerbot{true, 603}; // default Mouse4 | 45 | FeatureState g_triggerbot{true, 603}; // default Mouse4 |
| 46 | FeatureState g_silentaim{true, 602}; // default Mouse3 | 46 | FeatureState g_silentaim{true, 602}; // default Mouse3 |
| 47 | FeatureState g_item_esp{true, 0}; // valuable item tags, always-on by default | 47 | FeatureState g_item_esp{true, 0}; // valuable item tags, always-on by default |
| 48 | FeatureState g_fullbright{false, 0}; // mat_fullbright world lighting | ||
| 48 | bool g_item_health = true; | 49 | bool g_item_health = true; |
| 49 | bool g_item_ammo = true; | 50 | bool g_item_ammo = true; |
| 50 | bool g_item_armor = true; | 51 | bool g_item_armor = true; |
| @@ -184,6 +185,8 @@ void config_save() { | |||
| 184 | g_triggerbot.bind); | 185 | g_triggerbot.bind); |
| 185 | fprintf(f, "[silentaim]\nactive=%d\nbind=%d\nfov=%d\n", g_silentaim.active, | 186 | fprintf(f, "[silentaim]\nactive=%d\nbind=%d\nfov=%d\n", g_silentaim.active, |
| 186 | g_silentaim.bind, g_silent_fov); | 187 | g_silentaim.bind, g_silent_fov); |
| 188 | fprintf(f, "[fullbright]\nactive=%d\nbind=%d\n", g_fullbright.active, | ||
| 189 | g_fullbright.bind); | ||
| 187 | fprintf(f, "[items]\nactive=%d\nbind=%d\nhealth=%d\nammo=%d\n" | 190 | fprintf(f, "[items]\nactive=%d\nbind=%d\nhealth=%d\nammo=%d\n" |
| 188 | "armor=%d\nweapons=%d\ncrates=%d\ndistance=%d\nmax_dist=%d\n", | 191 | "armor=%d\nweapons=%d\ncrates=%d\ndistance=%d\nmax_dist=%d\n", |
| 189 | g_item_esp.active, g_item_esp.bind, (int)g_item_health, | 192 | g_item_esp.active, g_item_esp.bind, (int)g_item_health, |
| @@ -235,6 +238,8 @@ static bool config_load() { | |||
| 235 | cur = &g_esp; | 238 | cur = &g_esp; |
| 236 | else if (strstr(line, "[items]")) | 239 | else if (strstr(line, "[items]")) |
| 237 | cur = &g_item_esp; | 240 | cur = &g_item_esp; |
| 241 | else if (strstr(line, "[fullbright]")) | ||
| 242 | cur = &g_fullbright; | ||
| 238 | else if (strstr(line, "[aimbot]")) | 243 | else if (strstr(line, "[aimbot]")) |
| 239 | cur = &g_aimbot; | 244 | cur = &g_aimbot; |
| 240 | else if (strstr(line, "[triggerbot]")) | 245 | else if (strstr(line, "[triggerbot]")) |
| @@ -372,6 +377,7 @@ void config_reset_defaults() { | |||
| 372 | for (int i = 0; i < ESP_OPT_COUNT; i++) | 377 | for (int i = 0; i < ESP_OPT_COUNT; i++) |
| 373 | g_esp_opt[i] = true; | 378 | g_esp_opt[i] = true; |
| 374 | g_item_esp = {true, 0}; | 379 | g_item_esp = {true, 0}; |
| 380 | g_fullbright = {false, 0}; | ||
| 375 | g_item_health = true; | 381 | g_item_health = true; |
| 376 | g_item_ammo = true; | 382 | g_item_ammo = true; |
| 377 | g_item_armor = true; | 383 | g_item_armor = true; |
| @@ -488,7 +494,8 @@ static bool key_held(int sc) { | |||
| 488 | static FeatureState *feature_state(int feature) { | 494 | static FeatureState *feature_state(int feature) { |
| 489 | static FeatureState *feats[FEAT_COUNT] = { | 495 | static FeatureState *feats[FEAT_COUNT] = { |
| 490 | &g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, | 496 | &g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, |
| 491 | &g_silentaim, &g_jumpbug, &g_melee, &g_spread, &g_item_esp}; | 497 | &g_silentaim, &g_jumpbug, &g_melee, &g_spread, &g_item_esp, |
| 498 | &g_fullbright}; | ||
| 492 | if (feature < 0 || feature >= FEAT_COUNT) | 499 | if (feature < 0 || feature >= FEAT_COUNT) |
| 493 | return nullptr; | 500 | return nullptr; |
| 494 | return feats[feature]; | 501 | return feats[feature]; |
| @@ -658,6 +665,7 @@ void draw_text_col(int x, int y, const char *text, int r, int g, int b) { | |||
| 658 | // PushMakeCurrent/PopMakeCurrent so they are submitted with a clean clip. | 665 | // PushMakeCurrent/PopMakeCurrent so they are submitted with a clean clip. |
| 659 | void outer_draw() { | 666 | void outer_draw() { |
| 660 | poll_keyboard(); | 667 | poll_keyboard(); |
| 668 | fullbright_update(); | ||
| 661 | gui_handle_input(); | 669 | gui_handle_input(); |
| 662 | // HL2H_DRAW_TEST=1 draws a probe rect without needing the GUI open | 670 | // HL2H_DRAW_TEST=1 draws a probe rect without needing the GUI open |
| 663 | static bool draw_test = getenv("HL2H_DRAW_TEST") != nullptr; | 671 | static bool draw_test = getenv("HL2H_DRAW_TEST") != nullptr; |
