mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-10 02:39:35 +00:00
1
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user