2011-11-03 14:02:10 -05:00
|
|
|
|
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
2010-07-22 01:46:14 -05:00
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
//===========================================================================//
|
|
|
|
|
|
|
|
|
|
#ifndef ICVAR_H
|
|
|
|
|
#define ICVAR_H
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "appframework/IAppSystem.h"
|
2023-05-14 10:25:40 -04:00
|
|
|
|
#include "tier1/convar.h"
|
2010-07-22 01:46:14 -05:00
|
|
|
|
#include "tier1/utlvector.h"
|
2011-11-03 14:02:10 -05:00
|
|
|
|
#include "tier0/memalloc.h"
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
class ConCommandBase;
|
|
|
|
|
class ConCommand;
|
|
|
|
|
class ConVar;
|
|
|
|
|
class Color;
|
|
|
|
|
class IConVarListener;
|
|
|
|
|
class CConVarDetail;
|
|
|
|
|
struct ConVarSnapshot_t;
|
|
|
|
|
union CVValue_t;
|
2023-03-30 00:54:33 +03:00
|
|
|
|
class KeyValues;
|
2023-05-14 10:25:40 -04:00
|
|
|
|
class ConVarRefAbstract;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: DLL interface to ConVars/ConCommands
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
abstract_class ICvar : public IAppSystem
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-05-14 10:25:40 -04:00
|
|
|
|
// bAllowDeveloper - Allows finding convars with FCVAR_DEVELOPMENTONLY flag
|
|
|
|
|
virtual ConVarHandle FindConVar( const char *name, bool bAllowDeveloper = false ) = 0;
|
|
|
|
|
virtual ConVarHandle FindFirstConVar() = 0;
|
|
|
|
|
virtual ConVarHandle FindNextConVar( ConVarHandle prev ) = 0;
|
|
|
|
|
virtual void SetConVarValue( ConVarHandle cvarid, CSplitScreenSlot nSlot, CVValue_t *pNewValue, CVValue_t *pOldValue ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual ConCommandHandle FindCommand( const char *name ) = 0;
|
|
|
|
|
virtual ConCommandHandle FindFirstCommand() = 0;
|
|
|
|
|
virtual ConCommandHandle FindNextCommand( ConCommandHandle prev ) = 0;
|
|
|
|
|
virtual void DispatchConCommand( ConCommandHandle cmd, const CCommandContext &ctx, const CCommand &args ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
// Install a global change callback (to be called when any convar changes)
|
2023-07-26 14:11:11 +03:00
|
|
|
|
virtual void InstallGlobalChangeCallback( FnChangeCallbackGlobal_t callback ) = 0;
|
|
|
|
|
virtual void RemoveGlobalChangeCallback( FnChangeCallbackGlobal_t callback ) = 0;
|
2023-07-07 03:40:42 +03:00
|
|
|
|
virtual void CallGlobalChangeCallbacks( ConVarRefAbstract *var, CSplitScreenSlot nSlot, const char *pOldString, float flOldValue ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
// Reverts cvars which contain a specific flag
|
|
|
|
|
virtual void RevertFlaggedConVars( int nFlag ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual void SetMaxSplitScreenSlots( int nSlots ) = 0;
|
|
|
|
|
virtual int GetMaxSplitScreenSlots() const = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual void RegisterCreationListeners( ICVarListenerCallbacks *callbacks ) = 0;
|
|
|
|
|
virtual void RemoveCreationListeners( ICVarListenerCallbacks *callbacks ) = 0;
|
2023-03-30 00:02:29 +03:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual void unk1() = 0;
|
2023-03-30 00:02:29 +03:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual void ResetConVarsToDefaultValues( const char *pszPrefix ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual ConVarSnapshot_t *TakeConVarSnapshot( void ) = 0;
|
|
|
|
|
virtual void ResetConVarsToSnapshot( ConVarSnapshot_t *pSnapshot ) = 0;
|
|
|
|
|
virtual void DestroyConVarSnapshot( ConVarSnapshot_t *pSnaoshot ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual characterset_t GetCharacterSet( void ) = 0;
|
|
|
|
|
virtual void SetConVarsFromGameInfo( KeyValues *pKV ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-07-07 03:40:42 +03:00
|
|
|
|
virtual void unk2() = 0;
|
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
// Register, unregister vars
|
|
|
|
|
virtual void RegisterConVar( ConVar *pConVar, int64 nAdditionalFlags, ConVarHandle &pCvarRef, ConVar &pCvar ) = 0;
|
|
|
|
|
virtual void UnregisterConVar( ConVarHandle handle ) = 0;
|
|
|
|
|
virtual ConVar* GetConVar( ConVarHandle handle ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
// Register, unregister commands
|
|
|
|
|
virtual ConCommandHandle RegisterConCommand( ConCommand *pCmd, int64 nAdditionalFlags = 0 ) = 0;
|
|
|
|
|
virtual void UnregisterConCommand( ConCommandHandle handle ) = 0;
|
2023-07-26 14:11:11 +03:00
|
|
|
|
virtual ConCommand* GetCommand( ConCommandHandle handle ) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-05-14 10:25:40 -04:00
|
|
|
|
virtual void QueueThreadSetValue( ConVarRefAbstract *ref, CSplitScreenSlot nSlot, CVValue_t *value ) = 0;
|
2023-03-28 14:21:16 +03:00
|
|
|
|
};
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// These global names are defined by tier1.h, duplicated here so you
|
|
|
|
|
// don't have to include tier1.h
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// These are marked DLL_EXPORT for Linux.
|
|
|
|
|
DECLARE_TIER1_INTERFACE( ICvar, cvar );
|
|
|
|
|
DECLARE_TIER1_INTERFACE( ICvar, g_pCVar );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ICVAR_H
|