html>
This document aims to inform you of how you may cause any HUD item (whol menuDef's only, not individual itemDef's, but you can always re-write that part of the hud to split the itemDef's into their own menuDef's if needs be) to be hidden and shown again. This should prove useful in some per-class configs.
To hide a menuDef you use 'hudscript hide <name of menuDef>' and to make it show again you use 'hudscript show <name of menuDef>'. Really couldn't be simpler. That name is as in the 'name "<name>"' line at the top of the menuDef.
This should be an example that many people will make good use of, toggling the Engineer's Auto-Sentry Camera on and off. Turning it off can increase your FPS by 10-15% or more depending on the situation.
First we have to find which part of the HUD actually draws the Auto-Sentry Camera. Looking through hud.menu should soon find that it is in fact:
menuDef { name "sentrycam" fullScreen MENU_FALSE rect 484 331 160 120 visible MENU_TRUESo, the name to use with hudscript is 'sentrycam'. Here's what I have in my engineer config to bind the ' (single quote) key to toggle the Auto-Sentry Camera:
set toggle_scam_on "hudscript show sentrycam ; set toggle_scam vstr toggle_scam_off" set toggle_scam_off "hudscript hide sentrycam ; set toggle_scam vstr toggle_scam_on" set toggle_scam "vstr toggle_scam_off" bind ' "vstr toggle_scam"