Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.4 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #if !defined( CVAR_H )
  9. #define CVAR_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class ConVar;
  17. class ConCommandBase;
  18. class CCommand;
  19. class CUtlBuffer;
  20. #define COMMAND_COMPLETION_MAXITEMS 64
  21. #define COMMAND_COMPLETION_ITEM_LENGTH 64
  22. //-----------------------------------------------------------------------------
  23. // Purpose:
  24. //-----------------------------------------------------------------------------
  25. class CCvarUtilities
  26. {
  27. public:
  28. bool IsCommand( const CCommand &args, const int iSplitscreenSlot = -1 );
  29. // Writes lines containing "set variable value" for all variables
  30. // with the archive flag set to true.
  31. void WriteVariables( CUtlBuffer *buff, const int iSplitscreenSlot = -1, bool bSlotRequired = false, void *pConvarsList = 0 );
  32. // Returns the # of cvars with the server flag set.
  33. int CountVariablesWithFlags( int flags );
  34. // Lists cvars to console
  35. void CvarList( const CCommand &args );
  36. // Prints help text for cvar
  37. void CvarHelp( const CCommand &args );
  38. // Revert all cvar values
  39. void CvarRevert( const CCommand &args );
  40. // Revert all cvar values
  41. void CvarDifferences( const CCommand &args );
  42. // Toggles a cvar on/off, or cycles through a set of values
  43. void CvarToggle( const CCommand &args );
  44. // Finds commands with a specified flag.
  45. void CvarFindFlags_f( const CCommand &args );
  46. // Enable cvars marked with FCVAR_DEVELOPMENTONLY
  47. void EnableDevCvars();
  48. int CvarFindFlagsCompletionCallback( const char *partial, char commands[ COMMAND_COMPLETION_MAXITEMS ][ COMMAND_COMPLETION_ITEM_LENGTH ] );
  49. void ResetConVarsToDefaultValues( const char *pMatchStr ); // reset all convars that start with pMatchStr to their default values
  50. private:
  51. // just like Cvar_set, but optimizes out the search
  52. void SetDirect( ConVar *var, const char *value );
  53. bool IsValidToggleCommand( const char *cmd );
  54. bool IsHidden( const ConCommandBase *var );
  55. };
  56. extern CCvarUtilities *ConVarUtilities;
  57. // reset basic game convars to defaults. what is reset is specific to l4d
  58. void ResetGameConVarsToDefaults( void );
  59. #endif // CVAR_H