From f1794edcc60f6a27e622884c82397bb77e2aa280 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 18:31:27 +0100 Subject: GUI: wire real feature state and config Replace the dummy preview controls with the actual settings: - cards bind directly to the feature state and the existing option variables; Active/Bind now drive the same gates as the text menu; - every feature persists active+bind, including movement, melee and spread; - config path and build info are real; Reload config re-reads the INI; - Reset defaults is two-click, restores feature settings/binds and keeps the GUI layout; - window position, category and expanded cards persist under [gui] in the same config file; layout saves on drag/category/expand/close; - mouse bind capture handles all five buttons and consumes the click so it cannot re-arm immediately; - Active/Bind tooltips and full scancode names. The old text tree stays on F1 for one verification pass. --- src/hl2h.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/hl2h.h') diff --git a/src/hl2h.h b/src/hl2h.h index d5a9dc3..678c5af 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -174,6 +174,43 @@ enum EspOption { ESP_OPT_SHOW_SPEEDGRAPH = 6, ESP_OPT_COUNT = 7 }; +enum AimBone { + AIM_BONE_HEAD = 0, + AIM_BONE_TORSO, + AIM_BONE_LARM, + AIM_BONE_RARM, + AIM_BONE_LLEG, + AIM_BONE_RLEG, + AIM_BONE_COUNT +}; + +// --------------------------------------------------------------------------- +// feature state / settings (owned by menu.cpp until the text menu is removed) +// --------------------------------------------------------------------------- + +struct FeatureState { + bool active; + int bind; // SDL scancode, 0 = none (always-on) +}; + +extern FeatureState g_bhop, g_abh, g_jumpbug, g_melee, g_spread, g_esp, + g_aimbot, g_triggerbot, g_silentaim; +extern bool g_bhop_autostrafe; +extern bool g_jumpbug_assist; +extern bool g_spread_no_spread; +extern bool g_aim_bones[AIM_BONE_COUNT]; +extern int g_aim_smooth; +extern bool g_aim_vischeck; +extern int g_aim_fov; +extern bool g_aim_fov_circle; +extern int g_silent_fov; +extern bool g_esp_opt[ESP_OPT_COUNT]; + +const char *scancode_name(int sc); +void config_save(); +void config_reload(); +void config_reset_defaults(); +const char *config_path_cstr(); // --------------------------------------------------------------------------- // cross-file declarations @@ -237,6 +274,8 @@ void gui_draw(); bool gui_is_open(); bool gui_bind_capture_active(); QAngle gui_frozen_view(); +void gui_config_init(); +void gui_config_write(FILE *f); // ISurface pointer (defined in menu.cpp, used for drawing tests) struct ISurface; extern ISurface *g_surface; -- cgit v1.2.3