diff options
Diffstat (limited to 'engine/cvar.h')
| -rw-r--r-- | engine/cvar.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/engine/cvar.h b/engine/cvar.h new file mode 100644 index 0000000..8bd8978 --- /dev/null +++ b/engine/cvar.h @@ -0,0 +1,68 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//===========================================================================// + +#if !defined( CVAR_H ) +#define CVAR_H +#ifdef _WIN32 +#pragma once +#endif + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class ConVar; +class ConCommandBase; +class CCommand; +class CUtlBuffer; + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +class CCvarUtilities +{ +public: + bool IsCommand( const CCommand &args ); + + // Writes lines containing "set variable value" for all variables + // with the archive flag set to true. + void WriteVariables( CUtlBuffer &buff, bool bAllVars ); + + // Returns the # of cvars with the server flag set. + int CountVariablesWithFlags( int flags ); + + // Lists cvars to console + void CvarList( const CCommand &args ); + + // Prints help text for cvar + void CvarHelp( const CCommand &args ); + + // Revert all cvar values + void CvarRevert( const CCommand &args ); + + // Revert all cvar values + void CvarDifferences( const CCommand &args ); + + // Toggles a cvar on/off, or cycles through a set of values + void CvarToggle( const CCommand &args ); + + // Finds commands with a specified flag. + void CvarFindFlags_f( const CCommand &args ); + +private: + // just like Cvar_set, but optimizes out the search + void SetDirect( ConVar *var, const char *value ); + + bool IsValidToggleCommand( const char *cmd ); +}; + +extern CCvarUtilities *cv; + + +#endif // CVAR_H |