/*
Q2PRO-X Guided / Standalone menu definitions.

This file is loaded ONLY when cl_q2prox_menu_mode is 1 (or the
-q2proxmenu2 launch flag is passed). In that mode q2pro.menu AND
q2pro-x.menu are intentionally ignored — see src/client/ui/script.c.

Everything this UI references must either:
  - be defined here (all "begin <name>"/"end" blocks below), or
  - be a code-built menu loaded by UI_Init (players, servers, demos).

Do NOT add "inject ... endinject" blocks here — guided mode does
not process injections.

Maintenance rule: if you add a user-facing Q2PRO-X feature that
should be reachable from BOTH the classic additive menu and the
guided standalone menu, update BOTH q2pro-x.menu AND this file.
*/

background black
font conchars
cursor ch1
weapon w_railgun.md2

color normal #0f90eb64
color active #0f90ff64
color selection #0f90eb64
color disabled #7f7f7f

// ===========================================================================
// TOP-LEVEL ENTRY POINTS (main / game / options)
// ===========================================================================

// `--q2prox` marks rows on mixed guided pages (where some entries are
// classic Q2 features and some are Q2PRO-X-specific). The draw layer
// renders a green "(X)" suffix next to the label only when the active
// UI is guided/standalone (uis.guided_mode_active) AND the row carries
// the flag. Pure Q2PRO-X pages (q2prox_*, g_advanced, g_config, g_help)
// intentionally do NOT use --q2prox per-row to avoid (X) spam — those
// pages are already Q2PRO-X in identity.

begin main
    plaque m_main_plaque m_main_logo
    // Guided main is task-based and all-action — the classic banner
    // bitmaps were dropped here so the (X) badge can sit consistently
    // next to whatever row is Q2PRO-X-specific (per TZ badge map).
    action "play offline..." pushmenu play_offline
    action "join online..." pushmenu join_online
    action --q2prox "quick setup..." pushmenu quick_setup
    action "options..." pushmenu options
    action "help / about Q2PRO-X" pushmenu g_help
    action "demos" pushmenu demos
    action "quit" quit
    blank
    blank "Green (X) = Q2PRO-X feature"
end

begin game
    background #0000ff20
    style --compact
    action "resume game" forcemenuoff
    action --q2prox --status "Browse every cvar live: search, description, values, source" "cvar reference..." cvar_help
    action --q2prox --status "Modern Q2PRO-X server browser overlay" "browse servers..." serverbrowser_open_modern
    action "join online..." pushmenu join_online
    action --q2prox "quick setup..." pushmenu quick_setup
    action "options..." pushmenu options
    action --q2prox "mod command overlay" modhelp_toggle
    action "demos" pushmenu demos
    action "disconnect" disconnect
    action "quit" quit
end

begin options
    banner m_banner_options
    action --q2prox "video & display..." pushmenu g_video
    action --q2prox "sound & acoustics..." pushmenu g_sound
    action "interface & HUD..." pushmenu g_interface
    action --q2prox "controls & weapon view..." pushmenu g_controls
    action --q2prox "visibility & visuals..." pushmenu g_visibility
    action --q2prox "skins & models..." pushmenu g_skins
    action --q2prox "advanced Q2PRO-X..." pushmenu g_advanced
    action --q2prox "config & files..." pushmenu g_config
    action --q2prox "help / about Q2PRO-X..." pushmenu g_help
    blank
    blank "Green (X) = Q2PRO-X feature"
end

// ===========================================================================
// SECTION 5A — Play Offline
// ===========================================================================

begin play_offline
    banner m_banner_game
    action easy "skill 0; deathmatch 0; coop 0; maxclients 1; newgame"
    action medium "skill 1; deathmatch 0; coop 0; maxclients 1; newgame"
    action hard "skill 2; deathmatch 0; coop 0; maxclients 1; newgame"
    action nightmare "skill 3; deathmatch 0; coop 0; maxclients 1; newgame"
    blank
    action "load game..." pushmenu loadgame
    action "save game..." pushmenu savegame
    action "player setup" pushmenu players
end

begin loadgame
    banner m_banner_load_game
    loadgame save0
    blank
    loadgame save1
    loadgame save2
    loadgame save3
    loadgame save4
    loadgame save5
    loadgame save6
    loadgame save7
    loadgame save8
    loadgame save9
    loadgame save10
    loadgame save11
    loadgame save12
    loadgame save13
    loadgame save14
    loadgame save15
end

begin savegame
    banner m_banner_save_game
    savegame save1
    savegame save2
    savegame save3
    savegame save4
    savegame save5
    savegame save6
    savegame save7
    savegame save8
    savegame save9
    savegame save10
    savegame save11
    savegame save12
    savegame save13
    savegame save14
    savegame save15
end

// ===========================================================================
// SECTION 5B — Join Online
// ===========================================================================

begin join_online
    title "Join Online"
    style --no-compact
    action --q2prox --status "Modern Q2PRO-X server browser overlay (q2servers.com / favorites / LAN)" "browse servers..." serverbrowser_open_modern
    action --q2prox --status "Jump straight to the Favorites source in the modern browser" "favorites..." \
        "set cl_serverbrowser_default_source 1; serverbrowser_open_modern"
    action --status "Classic legacy server browser (Q2PRO address book + servers.lst)" "legacy browser / join by address..." pushmenu j_legacy
    action --q2prox --status "Q2PRO-X setup page tuned for multiplayer comfort (laghax, movement, predicts, visibility)" "online play setup..." pushmenu j_online_setup
    blank
    action "player setup" pushmenu players
    action "downloads..." pushmenu g_downloads
    action --q2prox --status "Mod command overlay (OpenTDM/OpenFFA)" "mod command overlay..." pushmenu q2prox_modhelp
    action "demos" pushmenu demos
end

begin j_legacy
    title "Legacy Browser / Join By Address"
    style --no-compact
    action --status "Launch the legacy address-book-driven server browser" "legacy server browser..." serverbrowser_open_legacy
    action --status "Edit the 16-slot address book (adr0..adr15)" "address book..." pushmenu g_addressbook
    blank
    action --align --status "Open the modern overlay instead" "modern browser..." serverbrowser_open_modern
end

begin j_online_setup
    title "Online Play Setup"
    style --no-compact
    action --status "Adaptive prediction-error smoothing (laghax), HUD, weights" "laghax..." pushmenu q2prox_laghax
    action --status "FPS-independent movement timing + local player prediction" "movement & player..." pushmenu q2prox_movement
    action --status "Weapon predict toggles (ghost rockets, rail, shotgun, HB, etc.)" "weapon predicts..." pushmenu q2prox_predict
    action --status "Item / player highlighting for readability" "visibility & highlights..." pushmenu q2prox_vis
    action --status "OpenAL profile, HRTF, reverb, weapon / player volumes" "sound..." pushmenu g_sound
end

// ===========================================================================
// SECTION 5C — Quick Setup
// ===========================================================================

begin quick_setup
    title "Quick Setup"
    style --no-compact
    pairs --status "vid_driver: win32wgl = classic OpenGL, win32egl = capture-friendly ANGLE" "video backend" vid_driver "win32wgl" win32wgl "win32egl" win32egl
    toggle --q2prox --status "vid_windowed: run in a window instead of fullscreen" "windowed mode" vid_windowed
    pairs --status "vid_fullscreen_type: borderless desktop vs classic exclusive mode" "fullscreen mode" vid_fullscreen_type "desktop fullscreen" desktop "exclusive fullscreen" exclusive
    strings --status "vid_resolution: desktop = native monitor mode" "resolution" vid_resolution $$vid_resolution_list
    strings --status "vid_refresh: max = highest available; ignored in windowed / desktop modes" "refresh rate" vid_refresh $$vid_refresh_list
    range --q2prox --format "%d%%" --status "gl_render_scale: internal 3D scene resolution" "render scale" gl_render_scale 100 1000 25
    blank
    values --q2prox --live --status "s_enable: OpenAL is required for HRTF + room acoustics" "sound engine" s_enable "no sound" "software (DMA)" "OpenAL"
    action --q2prox --align --status "OpenAL profile / reverb / HRTF / volumes" "OpenAL & acoustics..." pushmenu q2prox_sound
    action --q2prox --align --status "Headphone 3D / HRTF / crossfeed" "headphone 3D sound..." pushmenu q2prox_binaural
    blank
    values --live --status "crosshair: aim cursor style" "crosshair" crosshair none cross dot angle
    range --q2prox --live --precision 2 --status "cl_menu_alpha: menu background transparency" "menu opacity" cl_menu_alpha 0 1 0.05
    blank
    action --q2prox --align --status "Open the modern server browser" "browse servers..." serverbrowser_open_modern
    action --align --status "Re-apply video backend / fullscreen mode" "restart video..." vid_restart
end

// ===========================================================================
// SECTION 5D — Video & Display
// ===========================================================================

begin g_video
    title "Video & Display"
    style --no-compact
    pairs --status "vid_driver: win32wgl = classic OpenGL, win32egl = capture-friendly ANGLE" "video backend" vid_driver "win32wgl" win32wgl "win32egl" win32egl
    strings --status "vid_resolution: desktop = native monitor mode" "resolution" vid_resolution $$vid_resolution_list
    toggle --q2prox --status "vid_windowed: run in a normal resizable window" "windowed mode" vid_windowed
    pairs --status "vid_fullscreen_type: fullscreen flavor when windowed is off" "fullscreen mode" vid_fullscreen_type "desktop fullscreen" desktop "exclusive fullscreen" exclusive
    strings --status "vid_refresh: max = highest available" "refresh rate" vid_refresh $$vid_refresh_list
    values --q2prox --live --status "vid_desktop_fullscreen_fit: fill = native, aspect = preserve selected mode aspect with black bars" "fullscreen fit" vid_desktop_fullscreen_fit fill aspect
    range --q2prox --status "vid_desktop_fullscreen_margin: shrink borderless window" "fullscreen margin" vid_desktop_fullscreen_margin 0 16 1
    blank
    range --q2prox --format "%d%%" --status "gl_render_scale: internal 3D scene resolution (100=native)" "render scale" gl_render_scale 100 1000 25
    values --q2prox --status "gl_render_scale_mode: auto=best path, texture=bloom/waterwarp, blit=high range, tiled=extreme" "scale mode" gl_render_scale_mode auto texture blit tiled
    values --q2prox --status "gl_render_scale_filter: resolve quality" "scale filter" gl_render_scale_filter fast balanced quality
    blank
    action --q2prox --align --status "OLED protection suite" "OLED protection..." pushmenu q2prox_oled
    action --q2prox --align --status "Fog, bloom, color grading, sharpen, cel-shading, etc." "visual effects..." pushmenu q2prox_vfx
    action --align --status "Apply vid_driver / fullscreen changes now" "restart video..." vid_restart
    action --q2prox --align --status "Print render scale status" "render scale info..." gl_render_scale_info
end

// ===========================================================================
// SECTION 5E — Sound & Acoustics
// ===========================================================================

begin g_sound
    title "Sound & Acoustics"
    style --no-compact
    values --live --status "s_enable: OpenAL is required for al_profile, HRTF, room acoustics" "sound engine" s_enable "no sound" "software (DMA)" "OpenAL"
    range --live "master volume" s_volume 0 1
    range --live "music volume" ogg_volume 0 1
    values --live --status "s_ambient: 0 = no, 1 = yes, 2 = only player's own" "ambient sounds" s_ambient "no" "yes" "only player's own"
    blank
    action --q2prox --align --status "OpenAL profile, reverb, HRTF, room acoustics" "OpenAL & acoustics..." pushmenu q2prox_sound
    action --q2prox --align --status "Headphone 3D / HRTF / crossfeed / encoding" "headphone 3D sound..." pushmenu q2prox_binaural
    action --q2prox --align --status "Per-weapon and per-category volumes" "weapon / player volumes..." pushmenu q2prox_weaponvol
    blank
    toggle --q2prox --live --status "s_mute_when_inactive: mute when the window is not focused (Alt+Tab)" "mute when inactive" s_mute_when_inactive
    action --align --status "Apply sound engine changes" "restart sound..." snd_restart
end

// ===========================================================================
// SECTION 5F — Interface & HUD
// ===========================================================================

begin g_interface
    title "Interface & HUD"
    style --no-compact
    action --status "HUD size, console scale, menu scale, viewsize, ping graph" "size & layout..." pushmenu g_interface_size
    action --status "HUD / console / menu transparency" "transparency..." pushmenu g_interface_alpha
    action --status "Crosshair / aim cursor" "crosshair..." pushmenu g_interface_crosshair
end

begin g_interface_size
    title "Size & Layout"
    style --no-compact
    range --live "screen / viewsize" viewsize 40 100 10
    pairs --live --status "scr_scale: HUD scale (auto, 1x, 2x, 4x)" "HUD scale" scr_scale auto 0 1x 1 2x 2 4x 4
    pairs --live --status "con_scale: console scale" "console scale" con_scale auto 0 1x 1 2x 2 4x 4
    pairs --live --status "ui_scale: menu scale" "menu scale" ui_scale auto 0 1x 1 2x 2 4x 4
    toggle --live "ping graph" scr_lag_draw
    values --live "demo bar" scr_demobar no yes verbose
end

begin g_interface_alpha
    title "Transparency"
    style --no-compact
    range --live --precision 2 --status "scr_alpha: HUD opacity" "HUD opacity" scr_alpha 0 1 0.05
    range --live --precision 2 --status "con_alpha: console opacity" "console opacity" con_alpha 0 1 0.05
    range --q2prox --live --precision 2 --status "cl_menu_alpha: menu background transparency" "menu opacity" cl_menu_alpha 0 1 0.05
end

begin g_interface_crosshair
    title "Crosshair / Aim Cursor"
    style --no-compact
    values --live --status "crosshair: aim cursor style" "crosshair style" crosshair none cross dot angle
    pairs --live "crosshair scale" ch_scale 0.5x 0.5 1x 1 2x 2
    toggle --live "color by health" ch_health
    range --live "red channel" ch_red 0 1
    range --live "green channel" ch_green 0 1
    range --live "blue channel" ch_blue 0 1
    range --live "alpha channel" ch_alpha 0 1
end

// ===========================================================================
// SECTION 5G — Controls & Weapon View
// ===========================================================================

begin g_controls
    title "Controls & Weapon View"
    style --no-compact
    action "input setup..." pushmenu g_input
    action "key bindings..." pushmenu g_keys
    action "weapon bindings..." pushmenu g_weapons
    action --q2prox "weapon view & hand..." pushmenu g_weapon_view
    action --q2prox "movement basics..." pushmenu g_movement_basics
end

begin g_input
    title "Input Setup"
    style --no-compact
    field --numeric --width 8 "mouse sens" sensitivity
    toggle "auto sens" m_autosens
    toggle "mouse filter" m_filter
    toggle "free look" freelook
    toggle "always run" cl_run
end

begin g_keys
    title "Key Bindings"
    style --no-compact
    bind "attack" +attack
    bind "next weapon" weapnext
    bind "previous weapon" weapprev
    bind "walk forward" +forward
    bind "backpedal" +back
    bind "run" +speed
    bind "step left" +moveleft
    bind "step right" +moveright
    bind "up / jump" +moveup
    bind "down / crouch" +movedown
    bind "inventory" inven
    bind "use item" invuse
    bind "drop item" invdrop
    bind "prev item" invprev
    bind "next item" invnext
    bind "help computer" help
    bind "pause game" pause
    bind "scoreboard" score
    bind "chat" messagemode
    blank
    action --align "legacy keys..." pushmenu g_legacykeys
end

begin g_legacykeys
    title "Legacy Key Bindings"
    style --no-compact
    bind "turn left" +left
    bind "turn right" +right
    bind "sidestep" +strafe
    bind "look up" +lookup
    bind "look down" +lookdown
    bind "center view" centerview
    bind "mouse look" +mlook
    bind "keyboard look" +klook
end

begin g_weapons
    title "Weapon Bindings"
    style --no-compact
    bind "blaster" "use Blaster"
    bind "shotgun" "use Shotgun"
    bind "super shotgun" "use Super Shotgun"
    bind "machinegun" "use Machinegun"
    bind "chaingun" "use Chaingun"
    bind "grenade launcher" "use Grenade Launcher"
    bind "rocket launcher" "use Rocket Launcher"
    bind "hyperblaster" "use HyperBlaster"
    bind "railgun" "use Railgun"
    bind "bfg10k" "use BFG10K"
    bind "grenades" "use Grenades"
end

begin g_weapon_view
    title "Weapon View & Hand"
    style --no-compact
    values --live --status "hand: server-authoritative hand (affects projectile spawn)" "hand (server)" hand right left center
    values --live --status "cl_gun: view-weapon visibility (0=off, 1=normal, 2=centered model)" "view weapon" cl_gun off on centered
    range --live --precision 2 --status "cl_gunalpha: view-weapon opacity" "view weapon alpha" cl_gunalpha 0 1 0.05
    range --live --precision 0 --status "cl_gunfov: view-weapon FOV override (90=default)" "view weapon FOV" cl_gunfov 60 120 5
    range --live --precision 1 --status "cl_gun_x: forward offset" "view weapon X" cl_gun_x -10 10 0.5
    range --live --precision 1 --status "cl_gun_y: right offset" "view weapon Y" cl_gun_y -10 10 0.5
    range --live --precision 1 --status "cl_gun_z: up offset" "view weapon Z" cl_gun_z -10 10 0.5
end

begin g_movement_basics
    title "Movement Basics"
    style --no-compact
    values --status "cl_mouse_behavior_mode: global mouse feel. q2pro = current default (raw input + m_accel + m_autosens). r1q2 = compatibility (classic transform, R1Q2 lookstrafe; backend from m_directinput: 0=legacy, 1/2=DI-like relative)" "mouse behavior" cl_mouse_behavior_mode q2pro r1q2
    values --status "cl_movement_feel_mode: client command timing (r1q2-like = classic)" "movement feel" cl_movement_feel_mode q2pro r1q2-like
    values --status "cl_predict_move_mode: client prediction backend" "client predict" cl_predict_move_mode "modern (new q2pro/Q2PRO-X)" "legacy (q2pro-m/q2pro r1826)"
    values --status "cl_step_smoothing_mode: local stair-step feel" "step smoothing" cl_step_smoothing_mode q2pro r1q2-1 r1q2-2 r1q2-3
    toggle --status "cl_fixedmove: normalize movement to 10 ms command clock" "fixed move" cl_fixedmove
    values --status "cl_predict_player: local jump/fall prediction. When cl_predict_ping_min_ms > 0, also gated by the shared adaptive ping gate." "predict player" cl_predict_player off on debug
    blank
    action --align --status "Print resolved movement feel state" "movement feel info..." movementfeel_info
end

// ===========================================================================
// SECTION 5H — Visibility & Visuals
// ===========================================================================

begin g_visibility
    title "Visibility & Visuals"
    style --no-compact
    action --q2prox "visibility highlights..." pushmenu q2prox_vis
    action "particles & effect visibility..." pushmenu g_particles
    action "rail trail setup..." pushmenu g_railtrail
    action --q2prox "visual effects..." pushmenu q2prox_vfx
end

begin g_particles
    title "Particles & Effect Visibility"
    style --no-compact
    toggle --live "particles" cl_particles
    blank
    toggle --live --status "cl_disable_particles bit 0: yes = grenade explosion particles visible" "grenade explosion particles" cl_disable_particles ~0
    toggle --live --status "cl_disable_particles bit 1: yes = grenade trail particles visible" "grenade trail particles" cl_disable_particles ~1
    toggle --live --status "cl_disable_particles bit 2: yes = rocket explosion particles visible" "rocket explosion particles" cl_disable_particles ~2
    toggle --live --status "cl_disable_particles bit 3: yes = rocket trail particles visible" "rocket trail particles" cl_disable_particles ~3
    toggle --live --status "cl_disable_particles bit 4: yes = blood particles visible" "blood particles" cl_disable_particles ~4
    toggle --live --status "cl_disable_particles bit 5: yes = blaster trail particles visible" "blaster trail particles" cl_disable_particles ~5
    blank
    toggle --live --status "cl_disable_explosions bit 0: yes = grenade explosion sprites visible" "grenade explosion sprites" cl_disable_explosions ~0
    toggle --live --status "cl_disable_explosions bit 1: yes = rocket explosion sprites visible" "rocket explosion sprites" cl_disable_explosions ~1
    blank
    toggle --live --status "gl_waterwarp: screen warp under water" "water warp" gl_waterwarp
end

begin g_railtrail
    title "Rail Trail Setup"
    style --no-compact
    values --live "rail trail type" cl_railtrail_type "default" "core only" "core and spiral"
    range --live "duration" cl_railtrail_time 0.1 3.0 0.1
    range --live "core width" cl_railcore_width 1 6 1
    range --live "spiral radius" cl_railspiral_radius 1 6 1
    strings --live "core color" cl_railcore_color black red green yellow blue cyan magenta white
    strings --live "spiral color" cl_railspiral_color black red green yellow blue cyan magenta white
end

// ===========================================================================
// SECTION 5I — Skins & Models
// ===========================================================================

begin g_skins
    title "Skins & Models"
    style --no-compact
    action --status "Pick model / skin / name via built-in player setup page" "player setup" pushmenu players
    blank
    toggle --live --status "cl_noskins: disable custom player skins" "no custom skins" cl_noskins
    toggle --live --status "cl_vwep: show visible weapons on player models" "visible weapons on players" cl_vwep
    blank
    action --align --status "Download toggles for skins / models / textures" "download options..." pushmenu g_downloads
    action --q2prox --align --status "Open the mod command overlay for mod-specific skin commands (teamskin, eskin, etc.)" "mod command overlay..." pushmenu q2prox_modhelp
end

begin g_downloads
    title "Downloads"
    style --no-compact
    toggle --live "allow downloading" allow_download
    toggle --live "maps" allow_download_maps
    toggle --live "player models / skins" allow_download_players
    toggle --live "models" allow_download_models
    toggle --live "textures" allow_download_textures
    toggle --live "sounds" allow_download_sounds
    toggle --live "pics" allow_download_pics
    blank
    toggle --live "HTTP downloads" cl_http_downloads
end

// ===========================================================================
// SECTION 5K — Advanced Q2PRO-X (power-user landing)
// ===========================================================================

begin g_advanced
    title "Advanced Q2PRO-X"
    style --no-compact
    action --status "Adaptive prediction-error smoothing, HUD, tuning weights" "laghax" pushmenu q2prox_laghax
    action --status "Ghost weapon prediction toggles and debug" "weapon predicts" pushmenu q2prox_predict
    action --status "Predict-aware visual-only filter for muzzle, projectiles, impacts, explosions" "weapon parts visibility" pushmenu q2prox_weaponfx
    action --status "Movement feel, predict mode, step smoothing, fixed move" "movement & player" pushmenu q2prox_movement
    action --status "Display backend, desktop fullscreen, render scale" "display & capture" pushmenu q2prox_video
    action --status "OpenAL profile, HRTF, reverb, runtime sound actions" "sound & acoustics" pushmenu q2prox_sound
    action --status "Headphone binaural 3D sound" "binaural / 3D" pushmenu q2prox_binaural
    action --status "Per-weapon and per-category volumes" "sound volumes" pushmenu q2prox_weaponvol
    action --status "Modern server browser overlay settings" "server browser" pushmenu q2prox_serverbrowser
    action --status "Mod command overlay (OpenTDM/OpenFFA)" "mod overlay" pushmenu q2prox_modhelp
    action --status "Passive same-team HUD for OpenTDM: teammate H/A/P, weapon, freshness" "opentdm team HUD" pushmenu q2prox_opentdm_teamhud
    action --status "Item / player visibility highlighting" "visibility / highlights" pushmenu q2prox_vis
    action --status "Useful command binds, weapon drop modifier, macros" "scripts / binds" pushmenu q2prox_scripts
end

// ===========================================================================
// SECTION 5L — Config & Files
// ===========================================================================

begin g_config
    title "Config & Files"
    style --no-compact
    toggle --live --status "cl_q2prox_cfg_autosave: autosave Q2PRO-X config on menu changes (both scopes)" "autosave config" cl_q2prox_cfg_autosave
    toggle --live --status "cl_altf4_exit: Alt+F4 quits the game" "Alt+F4 quit" cl_altf4_exit
    blank
    values --status "cl_q2prox_menu_mode: 0 = classic/additive (q2pro.menu + q2pro-x/*.menu + inject), 1 = guided/standalone (q2pro-x.menu2 only). Takes effect after restart." "menu mode (restart required)" cl_q2prox_menu_mode classic guided
    blank
    bind --status "cvar_browser_toggle: toggle the Q2PRO-X cvar reference overlay" "cvar browser toggle key" cvar_browser_toggle
    blank
    action --align --status "Save all Q2PRO-X settings (global + mod-local)" "save all configs..." q2prox_cfg_save
    action --align --status "Save global settings to baseq2/q2pro-x/q2pro-x.cfg" "save global config..." q2prox_cfg_save_global
    action --align --status "Save mod-local settings to <gamedir>/q2pro-x/q2pro-x.cfg" "save mod config..." q2prox_cfg_save_local
    blank
    action --align --status "Reset all Q2PRO-X settings to defaults" "defaults all..." q2prox_cfg_defaults
    action --align --status "Reset only global settings to defaults" "defaults global..." q2prox_cfg_defaults_global
    action --align --status "Reset only mod-local settings to defaults" "defaults mod-local..." q2prox_cfg_defaults_local
end

// ===========================================================================
// Help / About
// ===========================================================================

begin g_help
    title "Help / About Q2PRO-X"
    style --no-compact
    action --status "Browse every cvar live: search, description, values, source" "cvar reference..." cvar_help
    action --status "Cvar browser settings: alpha, language, text scale" "cvar browser settings..." pushmenu q2prox_cvarbrowser
    blank
    action --status "Print Q2PRO-X build version and component info" "version info..." version
    action --status "Print current movement feel and applied backend" "movement feel info..." movementfeel_info
    action --status "Print render scale path, max resolution, tile grid" "render scale info..." gl_render_scale_info
    action --status "Print OLED protection status + reasons" "OLED info..." vid_oled_info
    action --status "Print reverb classifier / preset data" "reverb info..." al_reverb_info
    action --status "Print binaural runtime state" "binaural info..." al_binaural_info
    action --status "Print visual FX status" "visual fx info..." gl_visual_fx_info
    action --status "Print visibility item classification" "vis items info..." cl_vis_items_info
    blank
    action --status "List available console macros" "list macros..." macrolist
end

// ===========================================================================
// Address Book (for legacy join-by-address workflow)
// ===========================================================================

begin g_addressbook
    banner m_banner_addressbook
    field --width 32 --center adr0
    field --width 32 --center adr1
    field --width 32 --center adr2
    field --width 32 --center adr3
    field --width 32 --center adr4
    field --width 32 --center adr5
    field --width 32 --center adr6
    field --width 32 --center adr7
    field --width 32 --center adr8
    field --width 32 --center adr9
    field --width 32 --center adr10
    field --width 32 --center adr11
    field --width 32 --center adr12
    field --width 32 --center adr13
    field --width 32 --center adr14
    field --width 32 --center adr15
end

// ===========================================================================
// Q2PRO-X engine-room pages (ported from q2pro-x.menu).
//
// These are the deep power-user pages. They are reached from
// Advanced Q2PRO-X and from several user-facing shortcuts earlier
// in this file. Keep in sync with the same-named pages in
// q2pro-x.menu per the maintenance rule in the top-of-file comment.
// ===========================================================================

begin q2prox_laghax
    title "Laghax"
    style --no-compact
    values --status "cl_laghax: 0 = off, 1 = fixed window, 2 = adaptive smoothing" "laghax mode" cl_laghax off fixed adaptive
    toggle --status "cl_laghax_hud: real-time laghax overlay in top-right (or wherever dragged)" "laghax HUD" cl_laghax_hud
    range --live --precision 2 --status "cl_laghax_hud_alpha: laghax HUD opacity (independent from scr_alpha)" "HUD opacity" cl_laghax_hud_alpha 0 1 0.05
    toggle --live --status "cl_laghax_hud_show_predict_params: HUD row listing weapon / player predicts currently enabled" "show predicts row" cl_laghax_hud_show_predict_params
    toggle --live --status "cl_laghax_hud_show_physics_params: HUD row showing movement feel, step smoothing, legacy predict, fixed move" "show physics row" cl_laghax_hud_show_physics_params
    toggle --live --status "cl_laghax_hud_show_predict_runtime: extra live runtime rows for weapon prediction internals (diagnostic only)" "show predict runtime" cl_laghax_hud_show_predict_runtime
    toggle --live --status "cl_laghax_hud_pillarbox_workspace: allow HUD in pillarbox side bars" "pillarbox free area" cl_laghax_hud_pillarbox_workspace
    action --align --status "Enter HUD edit mode (left-drag, Enter/Escape exits)" "edit HUD position..." laghax_hud_edit
    action --align --status "Clear saved HUD position" "reset HUD position" laghax_hud_reset
    toggle --status "cl_laghax_debug: print smoothing stats every server frame" "laghax debug" cl_laghax_debug
    range --status "cl_laghax_maxms: hard safety cap (ms)" "max ms cap" cl_laghax_maxms 0 150 5
    range --status "cl_laghax_maxwindow: adaptive-mode target cap" "adaptive max window" cl_laghax_maxwindow 0 120 5
    range --status "cl_laghax_minerror: errors below this snap instantly" "minimum error" cl_laghax_minerror 0 8 0.1
    range --status "cl_laghax_ping_weight" "ping weight" cl_laghax_ping_weight 0 1 0.05
    range --status "cl_laghax_jitter_weight" "jitter weight" cl_laghax_jitter_weight 0 1 0.05
    range --status "cl_laghax_loss_weight" "loss weight" cl_laghax_loss_weight 0 1 0.05
    range --status "cl_laghax_debt_weight" "debt weight" cl_laghax_debt_weight 0 1 0.05
    range --status "cl_laghax_gap_weight" "gap weight" cl_laghax_gap_weight 0 1 0.05
end

begin q2prox_opentdm_teamhud
    title "OpenTDM Team HUD"
    style --no-compact
    toggle --live --status "cl_opentdm_team_hud: master enable — only draws on OpenTDM while on TEAM_A/TEAM_B" "opentdm team HUD" cl_opentdm_team_hud
    range --live --precision 2 --status "cl_opentdm_team_hud_alpha: HUD opacity (independent from scr_alpha)" "HUD opacity" cl_opentdm_team_hud_alpha 0 1 0.05
      range --live --precision 2 --status "cl_opentdm_team_hud_scale: Team HUD text scale multiplier" "text scale" cl_opentdm_team_hud_scale 0.5 2 0.05
      range --live --status "cl_opentdm_team_hud_width: width of the LAST MSG area in character cells" "message width" cl_opentdm_team_hud_width 12 48 1
      toggle --live --status "cl_opentdm_team_hud_show_weapon: show teammate's current weapon (passive decode, works with cl_vwep 0)" "show weapon" cl_opentdm_team_hud_show_weapon
      toggle --live --status "cl_opentdm_team_hud_show_powerarmor: include P (power armor cells) in the H/A/P column" "show power armor" cl_opentdm_team_hud_show_powerarmor
      toggle --live --status "cl_opentdm_team_hud_show_freshness: show a freshness / age indicator for passive teammate values (green -> yellow -> red -> disappear)" "show freshness" cl_opentdm_team_hud_show_freshness
      toggle --live --status "cl_opentdm_team_hud_show_teamchat: show the last already-visible say_team message beside the teammate who sent it (HUD mirror only, console/chat output unchanged)" "show last team chat" cl_opentdm_team_hud_show_teamchat
      range --live --status "cl_opentdm_team_hud_fresh_sec: how long passive teammate values stay green before transitioning into yellow and red; never exceeds stale threshold" "fresh period (sec)" cl_opentdm_team_hud_fresh_sec 1 120 1
      range --live --status "cl_opentdm_team_hud_stale_sec: seconds until cached H/A/P and weapon values expire and disappear from the HUD" "stale threshold (sec)" cl_opentdm_team_hud_stale_sec 4 120 1
      toggle --live --status "cl_opentdm_team_hud_pillarbox_workspace: allow placement in the pillarbox side bars" "pillarbox free area" cl_opentdm_team_hud_pillarbox_workspace
    action --align --status "Enter edit mode (left-drag, Enter/Escape exits)" "edit HUD position..." opentdm_team_hud_edit
    action --align --status "Clear saved HUD position" "reset HUD position" opentdm_team_hud_reset
end

begin q2prox_predict
    title "Weapon Predicts"
    style --no-compact
    toggle --status "weapon predict master — off disables all weapon predicts; weapon-side admissions/telemetry stop, but player predict may still follow the shared ping gate. Per-weapon settings are preserved" "weapon predict master" cl_predict_weapons_enable
    blank
    pairs --status "cl_predict_debug: 0=prod, 1/2=show both streams, 3=diagnostics+suppression" "predict debug" cl_predict_debug off 0 "show both" 1 verbose 2 "diag+supp" 3
    toggle --status "cl_weapon_anim_debug: print server vs predicted gun frame" "weapon anim debug" cl_weapon_anim_debug
    toggle --status "predict own rocket launcher projectile immediately" "predict rockets" cl_predict_rockets
    toggle --status "predict the rocket impact explosion at BSP hit point (subordinate to rockets)" "predict rocket explosion" cl_predict_rockets_explosion
    toggle --status "predict the rail beam instantly on fire" "predict railgun" cl_predict_railgun
    toggle --status "predict shotgun muzzle and pellet hit feedback" "predict shotgun" cl_predict_shotgun
    toggle --status "predict super-shotgun muzzle and pellet hit feedback" "predict super shotgun" cl_predict_super_shotgun
    toggle --status "predict machinegun local fire feedback" "predict machinegun" cl_predict_machinegun
    toggle --status "predict chaingun local fire feedback with ramp-up shot counts" "predict chaingun" cl_predict_chaingun
    toggle --status "predict blaster projectile and muzzle feedback" "predict blaster" cl_predict_blaster
    toggle --status "predict grenade launcher muzzle and sound feedback" "predict grenades" cl_predict_grenades
    toggle --status "predict hand-grenade throw feedback" "predict hand grenades" cl_predict_hand_grenades
    toggle --status "predict hyperblaster local fire feedback" "predict hyperblaster" cl_predict_hyperblaster
    values --status "local jump/fall prediction — also gated by adaptive ping gate (same threshold + dwell as weapon predicts). Also in movement & player menu." "predict player" cl_predict_player off on debug
    blank
    range --status "minimum ping (ms) — 0 disables adaptive gate so only raw/master toggles remain; >0 gates weapon and player predicts on ping" "minimum ping (ms)" cl_predict_ping_min_ms 0 200 1
    range --status "dwell time (sec) — ping must stay on one side of threshold this long before shared gate flips (weapon + player predicts)" "ping dwell (sec)" cl_predict_ping_dwell_sec 0 30 1
end

begin q2prox_weaponfx
    title "Weapon Parts Visibility"
    style --no-compact
    toggle --live --status "cl_weaponfx_vis_enable: master (off = neutral, legacy cvars only)" "custom visibility layer" cl_weaponfx_vis_enable
    blank
    toggle --live --status "cl_weaponfx_vis_own_predicted: show local ghost / predicted weapon FX" "own predicted fx" cl_weaponfx_vis_own_predicted
    toggle --live --status "cl_weaponfx_vis_own_server: show authoritative server FX from our own fire path" "own server fx" cl_weaponfx_vis_own_server
    toggle --live --status "cl_weaponfx_vis_other: show weapon FX from other players / monsters" "other players fx" cl_weaponfx_vis_other
    blank
    toggle --live --status "cl_weaponfx_vis_muzzle: muzzle flash model / sprite / local muzzle visual" "muzzle flash" cl_weaponfx_vis_muzzle
    toggle --live --status "cl_weaponfx_vis_muzzle_light: dynamic light from muzzle flash" "muzzle light" cl_weaponfx_vis_muzzle_light
    toggle --live --status "cl_weaponfx_vis_hitscan: rail beam / tracer-like direct-fire path" "hitscan beam / tracer" cl_weaponfx_vis_hitscan
    toggle --live --status "cl_weaponfx_vis_projectiles: projectile model + inherent glow" "projectile models" cl_weaponfx_vis_projectiles
    toggle --live --status "cl_weaponfx_vis_trails: rocket / grenade / blaster / BFG trails" "projectile trails" cl_weaponfx_vis_trails
    toggle --live --status "cl_weaponfx_vis_impact_wall: wall / world impact visuals (sparks, smoke, blaster flash)" "wall impacts" cl_weaponfx_vis_impact_wall
    toggle --live --status "cl_weaponfx_vis_impact_flesh: blood / flesh-hit visuals" "flesh impacts" cl_weaponfx_vis_impact_flesh
    toggle --live --status "cl_weaponfx_vis_explosion_visual: explosion sprite / model" "explosion visual" cl_weaponfx_vis_explosion_visual
    toggle --live --status "cl_weaponfx_vis_explosion_particles: explosion debris / smoke particles" "explosion particles" cl_weaponfx_vis_explosion_particles
    toggle --live --status "cl_weaponfx_vis_explosion_light: dynamic light from explosions" "explosion light" cl_weaponfx_vis_explosion_light
    toggle --live --status "cl_weaponfx_vis_hit_markers: HUD hit marker (sound still governed by cl_hit_markers)" "hit markers" cl_weaponfx_vis_hit_markers
    blank
    action --align --status "Print current WFX state + effective behavior to console" "weapon parts info..." weaponfx_info
end

begin q2prox_movement
    title "Movement"
    style --no-compact
    values --status "cl_mouse_behavior_mode: global mouse feel (q2pro = default; r1q2 = compatibility, backend from m_directinput: 0=legacy, 1/2=DI-like relative)" "mouse behavior" cl_mouse_behavior_mode q2pro r1q2
    values --status "cl_movement_feel_mode: r1q2-like = classic standstill-start/jump" "movement feel" cl_movement_feel_mode q2pro r1q2-like
    values --status "cl_predict_move_mode: client prediction backend" "client predict" cl_predict_move_mode "modern (new q2pro/Q2PRO-X)" "legacy (q2pro-m/q2pro r1826)"
    values --status "cl_step_smoothing_mode: local stair-step feel" "step smoothing" cl_step_smoothing_mode q2pro r1q2-1 r1q2-2 r1q2-3
    toggle --status "cl_fixedmove: normalize movement to 10 ms command clock" "fixed move" cl_fixedmove
    toggle --status "cl_fixedmove_debug: print finalized fixedmove command timing" "fixedmove debug" cl_fixedmove_debug
    values --status "cl_predict_player: 0 = off, 1 = local jump/fall, 2 = debug. When cl_predict_ping_min_ms > 0, also gated by the shared adaptive ping gate." "predict player" cl_predict_player off on debug
    blank
    action --align --status "Print resolved movement feel state and applied backend" "movement feel info..." movementfeel_info
end

begin q2prox_video
    title "Display & Capture"
    style --no-compact
    pairs --status "vid_driver: win32wgl / win32egl" "video backend" vid_driver "win32wgl" win32wgl "win32egl" win32egl
    strings --status "vid_resolution: desktop = native" "resolution" vid_resolution $$vid_resolution_list
    toggle --status "vid_windowed: run as window" "windowed mode" vid_windowed
    pairs --status "vid_fullscreen_type" "fullscreen mode" vid_fullscreen_type "desktop fullscreen" desktop "exclusive fullscreen" exclusive
    strings --status "vid_refresh: max = highest" "refresh rate" vid_refresh $$vid_refresh_list
    range --status "vid_desktop_fullscreen_margin" "fullscreen margin" vid_desktop_fullscreen_margin 0 16 1
    values --live --status "vid_desktop_fullscreen_fit: fill / aspect" "fullscreen fit" vid_desktop_fullscreen_fit fill aspect
    action --align --status "OLED protection suite" "OLED protection..." pushmenu q2prox_oled
    range --format "%d%%" --status "gl_render_scale: internal 3D resolution" "render scale" gl_render_scale 100 1000 25
    values --status "gl_render_scale_mode" "scale mode" gl_render_scale_mode auto texture blit tiled
    values --status "gl_render_scale_filter" "scale filter" gl_render_scale_filter fast balanced quality
    blank
    range --live --precision 2 --status "cl_menu_alpha" "menu opacity" cl_menu_alpha 0 1 0.05
    blank
    action --align --status "Print render scale status" "render scale info..." gl_render_scale_info
    action --align --status "Apply vid_driver or fullscreen changes" "restart video..." vid_restart
end

begin q2prox_oled
    title "OLED Protection"
    style --no-compact
    toggle --live --status "vid_oled_enable: master switch for OLED protection suite" "OLED protection" vid_oled_enable
    blank
    toggle --live --status "vid_oled_bar_protection: animate aspect-fit pillarbox bars" "bar protection" vid_oled_bar_protection
    values --live --status "vid_oled_bar_preset: fade / random fade / breathe" "bar preset" vid_oled_bar_preset fade "random fade" breathe
    pairs --live "bar color A" vid_oled_bar_color_a "black" "#000000" "near black" "#0a0a0a" "dim gray" "#141414" "gray" "#1e1e1e"
    pairs --live "bar color B" vid_oled_bar_color_b "black" "#000000" "near black" "#0a0a0a" "dim gray" "#141414" "gray" "#1e1e1e"
    range --live --format "%d s" "bar start delay" vid_oled_bar_delay_sec 10 3600 10
    range --live --format "%d min" "bar active time" vid_oled_bar_active_min 1 10 1
    range --live --format "%d min" "bar idle interval" vid_oled_bar_interval_min 1 60 1
    blank
    toggle --live --status "vid_oled_idle_protection: dim screen after inactivity" "idle screen protection" vid_oled_idle_protection
    range --live --format "%d s" "idle delay" vid_oled_idle_delay_sec 20 3600 10
    range --live --format "%d s" "idle fade time" vid_oled_idle_fade_sec 5 120 5
    range --live --precision 1 "idle hold time" vid_oled_idle_hold_sec 0.0 30.0 0.5
    toggle --live --status "vid_oled_idle_monitor_off (Win opt-in): DPMS monitor off during HOLD_DARK" "idle monitor DPMS off" vid_oled_idle_monitor_off
    range --live --precision 2 "idle restore time" vid_oled_idle_restore_sec 0.1 5.0 0.1
    toggle --live --status "vid_oled_idle_mute_audio: mute audio while idle-dim active" "mute audio on idle protect" vid_oled_idle_mute_audio
    blank
    toggle --live --status "vid_oled_ui_protection: breathing alpha on protected UI" "interface alpha protect" vid_oled_ui_protection
    range --live --precision 2 "interface min alpha" vid_oled_ui_min_alpha 0.0 1.0 0.05
    range --live --precision 2 "interface max alpha" vid_oled_ui_max_alpha 0.05 1.0 0.05
    range --live --format "%d s" "interface cycle time" vid_oled_ui_cycle_sec 5 600 5
    blank
    action --align --status "Print OLED protection status" "OLED info..." vid_oled_info
end

begin q2prox_vfx
    title "Visual FX"
    style --no-compact
    toggle --live --status "usefog: client-side fog" "fog" usefog
    range --live --precision 2 "fog density" fogdensity 0.01 1 0.01
    range --live --precision 2 "fog hue" foghue 0 1 0.05
    range --live --precision 2 "fog saturation" fogsaturation 0 1 0.05
    range --live --precision 2 "fog lightness" foglightness 0 1 0.05
    blank
    values --live "dynamic lights" gl_dynamic no yes "only switchable"
    values --live "shadows" gl_shadows off basic fade
    toggle --live "no glow" cl_noglow
    toggle --live "poly blend" gl_polyblend
    toggle --live "colored lightmaps" gl_coloredlightmaps
    range --live --precision 1 "brightness" gl_brightness 0 1 0.1
    range --live --precision 0 "cel shading" gl_celshading 0 10 1
    blank
    values --live "bloom" gl_bloom off 1 2 3 4 5 6 7 8
    range --live --precision 2 "bloom strength" gl_bloom_strength 0 3 0.1
    range --live --precision 2 "bloom threshold" gl_bloom_threshold 0 1 0.05
    range --live --precision 1 "bloom sigma" gl_bloom_sigma 1 12 0.5
    range --live --precision 2 "glowmap intensity" gl_glowmap_intensity 0 2 0.1
    blank
    values --live "grading profile" gl_post_profile off neutral warm arena cinematic
    range --live --precision 2 "contrast" gl_post_contrast 0.5 2 0.05
    range --live --precision 2 "vibrance" gl_post_vibrance -1 1 0.05
    range --live --precision 2 "temperature" gl_post_temperature -1 1 0.05
    blank
    range --live --precision 1 "sharpen" gl_sharpen 0 10 0.5
    blank
    action --align --status "Print visual FX status" "visual fx info..." gl_visual_fx_info
end

begin q2prox_sound
    title "Sound & Acoustics"
    style --no-compact
    values --live --status "s_enable: OpenAL required for al_profile, HRTF, room acoustics" "sound engine" s_enable "no sound" "software (DMA)" "OpenAL"
    values --live --status "al_sound_profile: acoustics recipe (manual tweaks switch to custom)" "sound profile" al_sound_profile custom competitive balanced immersive cinematic cathedral
    pairs --live "output rate" s_khz 11 11 22 22 44 44 48 48 96 96
    pairs --live "sample format" s_sampleformat auto auto s16 s16 float32 float32
    values --live "OpenAL profile" al_profile "Q2PRO-X" "R1Q2-like"
    values --live "HRTF" al_hrtf off auto on
    pairs --live "OpenAL resampler" al_resampler default default cubic cubic bsinc12 bsinc12 bsinc24 bsinc24 point point linear linear
    pairs --live "DMA resampler" s_resampler legacy legacy linear linear cubic cubic
    toggle --live --status "al_reverb: room acoustics / EFX reverb" "reverberation support" al_reverb
    pairs --live --status "al_eax_preset: -1 = auto classifier" "reverb preset" al_eax_preset auto -1 generic 0 small 1 medium 2 hall 3 corridor 4 outdoor 5 underwater 6
    range --live "reverb wet" al_eax_wet 0 1 0.05
    range --live "local wet" al_eax_local_wet 0 1 0.05
    range --live "lerp time" al_reverb_lerp_time 0 5 0.1
    toggle --live "occlusion" al_eax_occlusion
    range --live "explosion wet" al_eax_explosion_wet 0 1 0.05
    range --live "explosion decay" al_eax_explosion_decay 1 3 0.05
    range --live "explosion late" al_eax_explosion_late 1 2 0.05
    range --live "transport wet" al_eax_transport_wet 0 1 0.05
    range --live "reflections" al_reverb_reflections 0 4 0.1
    range --live "late reverb" al_reverb_late 0 4 0.1
    range --live "decay" al_reverb_decay 0.1 50 0.5
    range --live "delay" al_reverb_delay 0.1 4 0.1
    range --live "HF brightness" al_reverb_hf 0 4 0.1
    range --live "diffusion" al_reverb_diffusion 0 2 0.1
    toggle --live "reverb debug" al_eax_debug
    blank
    toggle --live --status "s_mute_when_inactive: mute when window not focused" "mute when inactive" s_mute_when_inactive
    blank
    action --align --status "Print reverb classifier / preset" "reverb info..." al_reverb_info
    action --align --status "Reload active reverb preset" "reload reverb..." al_reverb_reload
    action --align --status "Print available OpenAL resamplers" "resampler list..." al_resampler_list
    action --align --status "Apply sound engine / HRTF / profile changes" "restart sound..." snd_restart
end

begin q2prox_binaural
    title "Binaural / 3D Sound"
    style --no-compact
    values --status "al_binaural_profile: curated headphone presets" "binaural profile" al_binaural_profile custom default auto deep cinematic
    values --status "al_binaural: 0=off, 1=auto, 2=on" "binaural" al_binaural off auto on
    values --status "al_binaural_encoding: requires snd_restart" "encoding" al_binaural_encoding auto basic hrtf uhj
    values --status "al_binaural_hrtf_mode" "HRTF mode" al_binaural_hrtf_mode default full ambi1 ambi2 ambi3
    pairs --status "al_binaural_hrtf_size" "HRTF filter size" al_binaural_hrtf_size default 0 32 32 64 64
    range --status "al_binaural_crossfeed" "crossfeed" al_binaural_crossfeed 0 6 1
    blank
    action --align --status "Print current binaural runtime state" "binaural info..." al_binaural_info
    action --align --status "Apply binaural / sound engine changes" "restart sound..." snd_restart
end

begin q2prox_weaponvol
    title "Sound Volumes"
    style --no-compact
    range --live --format "%d%%" "blaster" s_weapon_blaster_volume 0 100 5
    range --live --format "%d%%" "shotgun" s_weapon_shotgun_volume 0 100 5
    range --live --format "%d%%" "super shotgun" s_weapon_supershotgun_volume 0 100 5
    range --live --format "%d%%" "machinegun" s_weapon_machinegun_volume 0 100 5
    range --live --format "%d%%" "chaingun" s_weapon_chaingun_volume 0 100 5
    range --live --format "%d%%" "hand grenades" s_weapon_handgrenade_volume 0 100 5
    range --live --format "%d%%" "grenade launcher" s_weapon_grenadelauncher_volume 0 100 5
    range --live --format "%d%%" "rocket launcher" s_weapon_rocketlauncher_volume 0 100 5
    range --live --format "%d%%" "hyperblaster" s_weapon_hyperblaster_volume 0 100 5
    range --live --format "%d%%" "railgun" s_weapon_railgun_volume 0 100 5
    range --live --format "%d%%" "BFG10K" s_weapon_bfg_volume 0 100 5
    blank
    range --live --format "%d%%" "player sounds" s_player_volume 0 100 5
    range --live --format "%d%%" "voice / pain" s_voice_volume 0 100 5
    range --live --format "%d%%" "item pickups" s_pickup_volume 0 100 5
    range --live --format "%d%%" "environment" s_environment_volume 0 100 5
    range --live --format "%d%%" "monsters" s_monster_volume 0 100 5
    range --live --format "%d%%" "announcer" s_announcer_volume 0 100 5
    range --live --format "%d%%" "menu / UI" s_interface_volume 0 100 5
    range --live --format "%d%%" "other / misc" s_other_volume 0 100 5
    range --live --format "%d%%" "ambient loops" s_ambient_volume 0 100 5
end

begin q2prox_serverbrowser
    title "Server Browser"
    style --no-compact
    values --live --status "cl_serverbrowser_ui: 0 = legacy, 1 = modern" "browser mode" cl_serverbrowser_ui legacy modern
    range --live --precision 2 "opacity" cl_serverbrowser_alpha 0 1 0.05
    range --live --precision 1 "text scale" cl_serverbrowser_scale 0.5 2 0.1
    toggle --live "compact mode" cl_serverbrowser_compact
    toggle --live "fullscreen" cl_serverbrowser_fullscreen
    toggle --live --status "cl_serverbrowser_pillarbox_workspace: allow dragging into pillarbox bars" "pillarbox free area" cl_serverbrowser_pillarbox_workspace
    toggle --live "show details" cl_serverbrowser_show_details
    toggle --live "show badges" cl_serverbrowser_show_badges
    toggle --live "row colors" cl_serverbrowser_row_colors
    blank
    toggle --live "hide empty" cl_serverbrowser_hide_empty
    toggle --live "hide full" cl_serverbrowser_hide_full
    toggle --live "only with players" cl_serverbrowser_only_players
    range --live --precision 0 "max ping" cl_serverbrowser_max_ping 0 999 50
    toggle --live "show passworded" cl_serverbrowser_show_passworded
    toggle --live "show down" cl_serverbrowser_show_down
    blank
    values --live "default source" cl_serverbrowser_default_source "q2servers.com" favorites LAN custom
    field --width 32 --status "cl_serverbrowser_custom_source" "custom source" cl_serverbrowser_custom_source
    blank
    action --align --status "Open the modern server browser overlay" "open server browser..." serverbrowser_open_modern
    action --align --status "Open the classic legacy server browser menu" "open legacy browser..." serverbrowser_open_legacy
    bind "toggle key" serverbrowser_toggle
end

begin q2prox_cvarbrowser
    title "Cvar Browser"
    style --no-compact
    range --live --precision 2 "opacity" cl_cvar_browser_alpha 0 1 0.05
    values --live --status "cl_cvar_browser_lang: 0 = English, 1 = Russian" "browser language" cl_cvar_browser_lang English Russian
    range --live --precision 2 "text scale" cl_cvar_browser_scale 0.5 2 0.05
    blank
    action --align --status "Open the modern cvar reference browser overlay" "open cvar browser..." cvar_help
    bind "toggle key" cvar_browser_toggle
end

begin q2prox_modhelp
    title "Mod Command Overlay"
    style --no-compact
    range --live --precision 2 "opacity" cl_modhelp_alpha 0 1 0.05
    range --live --precision 1 "text scale" cl_modhelp_scale 0.5 2 0.1
    toggle --live "compact mode" cl_modhelp_compact
    toggle --live "fullscreen" cl_modhelp_fullscreen
    toggle --live "show aliases" cl_modhelp_show_aliases
    blank
    toggle --live "show general" cl_modhelp_show_general
    toggle --live "show spectator" cl_modhelp_show_spectator
    toggle --live "show team" cl_modhelp_show_team
    toggle --live "show stats" cl_modhelp_show_stats
    toggle --live "show voting" cl_modhelp_show_voting
    toggle --live "show admin" cl_modhelp_show_admin
    blank
    values --live "overlay role" cl_modhelp_role auto player spectator caster captain admin
    values --live "unavailable rows" cl_modhelp_unavailable show gray hide
    toggle --live "confirm dangerous" cl_modhelp_confirm_dangerous
    toggle --live "prefer context page" cl_modhelp_prefer_context_page
    blank
    toggle --live "show row badges" cl_modhelp_show_badges
    toggle --live "keep last page" cl_modhelp_keep_page
    toggle --live "show pinned first" cl_modhelp_show_pinned
    toggle --live "use local overrides" cl_modhelp_use_local
    blank
    action --align --status "Toggle mod overlay on/off" "toggle overlay..." modhelp_toggle
    bind "overlay toggle key" modhelp_toggle
    bind "search key" modhelp_search
end

begin q2prox_vis
    title "Visibility Highlights"
    style --no-compact
    toggle --live --status "cl_vis_enable: master switch for highlighting" "enable highlighting" cl_vis_enable
    toggle --live "single-player" cl_vis_singleplayer
    toggle --live "item highlighting" cl_vis_items
    values --live "item style" cl_vis_items_style off shell tint "shell+tint"
    range --live --precision 2 "tint alpha" cl_vis_items_alpha 0.05 1 0.05
    range --live --precision 2 "shell alpha" cl_vis_items_shell_alpha 0.05 1 0.05
    range --live --precision 2 "shell thickness" cl_vis_items_shell_scale 0.01 4 0.01
    range --live --precision 2 "item brightness" cl_vis_items_brightness 0 10 0.05
    range --live --precision 2 "item scale" cl_vis_items_scale 0.1 5 0.05
    blank
    toggle --live "weapon highlighting" cl_vis_weapons
    range --live --precision 2 "weapon scale" cl_vis_weapons_scale 0.1 5 0.05
    blank
    toggle --live "player highlighting" cl_vis_players
    values --live "player mode" cl_vis_players_mode off all "random FFA" duel auto team
    values --live "player style" cl_vis_players_style off shell tint "shell+tint"
    range --live --precision 2 "player tint alpha" cl_vis_players_alpha 0.05 1 0.05
    range --live --precision 2 "player shell alpha" cl_vis_players_shell_alpha 0.05 1 0.05
    range --live --precision 3 "player shell thickness" cl_vis_players_shell_scale 0 0.05 0.005
    range --live --precision 2 "player brightness" cl_vis_players_brightness 0 10 0.05
    toggle --live "highlight self" cl_vis_players_self
    values --live "auto fallback" cl_vis_players_auto_fallback all "random FFA"
    range --live --precision 0 "duel hold ms" cl_vis_players_duel_hold_ms 100 3000 100
    values --live "team source" cl_vis_players_team_source off auto opentdm
    values --live "team fallback" cl_vis_players_team_fallback all "random FFA" duel
    range --live --precision 0 "team hold ms" cl_vis_players_team_hold_ms 100 3000 100
    pairs --live "friendly color" cl_vis_players_team_friendly_color cyan "#33ccff" blue "#3366ff" green "#33ff66" lime "#66ff66" yellow "#ffff33" white "#ffffff"
    pairs --live "enemy color" cl_vis_players_team_enemy_color red "#ff4444" orange "#ff6633" magenta "#ff33ff" yellow "#ffff33" white "#ffffff" cyan "#33ccff"
    blank
    action --status "Per-class item toggles (health, armor, ammo, powerups, keys)" "item toggles..." pushmenu q2prox_vis_toggles
    action --status "Per-class item colors" "item colors..." pushmenu q2prox_vis_colors
    action --status "Per-weapon enable toggles" "weapon toggles..." pushmenu q2prox_vis_weapon_toggles
    action --status "Per-weapon colors" "weapon colors..." pushmenu q2prox_vis_weapon_colors
    blank
    action --align --status "Print item classification and status" "vis items info..." cl_vis_items_info
end

begin q2prox_vis_toggles
    title "Vis Toggles"
    style --no-compact
    toggle --live "health small" cl_vis_health_small
    toggle --live "health medium" cl_vis_health_medium
    toggle --live "health large" cl_vis_health_large
    toggle --live "health mega" cl_vis_health_mega
    toggle --live "armor shard" cl_vis_armor_shard
    toggle --live "armor jacket" cl_vis_armor_jacket
    toggle --live "armor combat" cl_vis_armor_combat
    toggle --live "armor body" cl_vis_armor_body
    toggle --live "armor screen" cl_vis_armor_screen
    toggle --live "armor shield" cl_vis_armor_shield
    toggle --live "ammo" cl_vis_ammo
    toggle --live "powerups" cl_vis_powerups
    toggle --live "keys" cl_vis_keys
end

begin q2prox_vis_colors
    title "Vis Colors"
    style --no-compact
    pairs --live "health small" cl_vis_health_small_color green "#66ff66" lime "#33ff33" cyan "#66ffff" yellow "#ffff33" white "#ffffff"
    pairs --live "health medium" cl_vis_health_medium_color green "#33ff33" lime "#00ff00" cyan "#33ffff" yellow "#ffcc33" white "#ffffff"
    pairs --live "health large" cl_vis_health_large_color green "#00ff00" lime "#33ff33" cyan "#00ffff" yellow "#ffcc33" white "#ffffff"
    pairs --live "health mega" cl_vis_health_mega_color magenta "#ff33ff" red "#ff3333" cyan "#33ffff" blue "#3399ff" white "#ffffff"
    pairs --live "armor shard" cl_vis_armor_shard_color cyan "#66ffff" green "#66ff66" blue "#6699ff" white "#ffffff"
    pairs --live "armor jacket" cl_vis_armor_jacket_color green "#66ff66" lime "#33ff33" cyan "#66ffff" yellow "#ffcc33" white "#ffffff"
    pairs --live "armor combat" cl_vis_armor_combat_color yellow "#ffd633" orange "#ff9933" green "#66ff66" white "#ffffff"
    pairs --live "armor body" cl_vis_armor_body_color red "#ff3333" orange "#ff6633" magenta "#ff33ff" yellow "#ffcc33" white "#ffffff"
    pairs --live "armor screen" cl_vis_armor_screen_color cyan "#66ccff" blue "#3399ff" green "#66ff66" white "#ffffff"
    pairs --live "armor shield" cl_vis_armor_shield_color blue "#3399ff" cyan "#66ccff" magenta "#ff33ff" white "#ffffff"
    pairs --live "ammo" cl_vis_ammo_color white "#ffffff" cyan "#66ffff" green "#66ff66" yellow "#ffcc33"
    pairs --live "powerups" cl_vis_powerups_color blue "#3399ff" cyan "#33ffff" magenta "#ff33ff" red "#ff3333" white "#ffffff"
    pairs --live "keys" cl_vis_keys_color magenta "#ff66cc" red "#ff3333" cyan "#66ffff" yellow "#ffcc33" white "#ffffff"
end

begin q2prox_vis_weapon_toggles
    title "Weapon Toggles"
    style --no-compact
    toggle --live "shotgun" cl_vis_weapon_shotgun
    toggle --live "super shotgun" cl_vis_weapon_sshotgun
    toggle --live "machinegun" cl_vis_weapon_machinegun
    toggle --live "chaingun" cl_vis_weapon_chaingun
    toggle --live "grenade launcher" cl_vis_weapon_grenade
    toggle --live "rocket launcher" cl_vis_weapon_rocket
    toggle --live "hyperblaster" cl_vis_weapon_hyperblaster
    toggle --live "railgun" cl_vis_weapon_railgun
    toggle --live "BFG10K" cl_vis_weapon_bfg
end

begin q2prox_vis_weapon_colors
    title "Weapon Colors"
    style --no-compact
    pairs --live "shotgun" cl_vis_weapon_shotgun_color grey "#999999" white "#ffffff" yellow "#ffcc33" green "#66ff66"
    pairs --live "super shotgun" cl_vis_weapon_sshotgun_color grey "#999999" white "#ffffff" yellow "#ffcc33" green "#66ff66"
    pairs --live "machinegun" cl_vis_weapon_machinegun_color brown "#cc9933" yellow "#ffcc33" orange "#ff9933" white "#ffffff"
    pairs --live "chaingun" cl_vis_weapon_chaingun_color brown "#cc9933" yellow "#ffcc33" orange "#ff9933" white "#ffffff"
    pairs --live "grenade launcher" cl_vis_weapon_grenade_color "dark red" "#993333" red "#ff3333" orange "#ff6633" white "#ffffff"
    pairs --live "rocket launcher" cl_vis_weapon_rocket_color red "#ff3333" orange "#ff6633" yellow "#ffcc33" white "#ffffff"
    pairs --live "hyperblaster" cl_vis_weapon_hyperblaster_color "green-yellow" "#99cc33" green "#66ff66" yellow "#ffcc33" cyan "#66ffff" white "#ffffff"
    pairs --live "railgun" cl_vis_weapon_railgun_color blue "#3366ff" cyan "#33ccff" magenta "#ff33ff" white "#ffffff"
    pairs --live "BFG10K" cl_vis_weapon_bfg_color "green-blue" "#33cc99" green "#33ff66" cyan "#33ffff" blue "#3399ff" white "#ffffff"
end

begin q2prox_scripts
    title "Scripts / Binds"
    style --no-compact
    bind --status "+dropw: hold to make weapon binds drop instead of use" "weapon drop modifier" +dropw
    bind --status "followip: connect to last IP shown in console" "follow console IP" followip
    bind --status "aadump: dump scoreboard to console" "score dump (console)" aadump
    bind --status "aashot: dump scoreboard to file" "score dump (file)" aashot
    bind "ready" ready
    bind "unready" unready
    bind "vote yes" "vote yes"
    bind "vote no" "vote no"
    bind "screenshot" screenshot
    blank
    action --align --status "Print available console macros" "list macros..." macrolist
end
