summaryrefslogtreecommitdiff
path: root/engine/cvar.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/cvar.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/cvar.h')
-rw-r--r--engine/cvar.h68
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