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"
|
|
|
|
|
#include "tier1/iconvar.h"
|
|
|
|
|
#include "tier1/utlvector.h"
|
2011-11-03 14:02:10 -05:00
|
|
|
|
#include "tier0/memalloc.h"
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
class ConCommandBase;
|
|
|
|
|
class ConCommand;
|
|
|
|
|
class ConVar;
|
|
|
|
|
class Color;
|
2015-07-09 13:07:26 -04:00
|
|
|
|
class IConVarListener;
|
|
|
|
|
class CConVarDetail;
|
|
|
|
|
struct ConVarSnapshot_t;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// ConVars/ComCommands are marked as having a particular DLL identifier
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
typedef int CVarDLLIdentifier_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Used to display console messages
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
abstract_class IConsoleDisplayFunc
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void ColorPrint( const Color& clr, const char *pMessage ) = 0;
|
|
|
|
|
virtual void Print( const char *pMessage ) = 0;
|
|
|
|
|
virtual void DPrint( const char *pMessage ) = 0;
|
|
|
|
|
|
|
|
|
|
virtual void GetConsoleText( char *pchText, size_t bufSize ) const = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: Applications can implement this to modify behavior in ICvar
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
#define CVAR_QUERY_INTERFACE_VERSION "VCvarQuery001"
|
|
|
|
|
abstract_class ICvarQuery : public IAppSystem
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
// Can these two convars be aliased?
|
|
|
|
|
virtual bool AreConVarsLinkable( const ConVar *child, const ConVar *parent ) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
union CVValue_t;
|
|
|
|
|
struct ConVarDesc_t;
|
|
|
|
|
|
|
|
|
|
struct characterset_t;
|
|
|
|
|
struct CSplitScreenSlot;
|
|
|
|
|
|
2010-07-22 01:46:14 -05:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: DLL interface to ConVars/ConCommands
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
abstract_class ICvar : public IAppSystem
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-03-28 14:21:16 +03:00
|
|
|
|
// allow_developer - Allows finding convars with FCVAR_DEVELOPMENTONLY flag
|
|
|
|
|
virtual ConVarID FindConVar(const char *name, bool allow_developer = false) = 0;
|
|
|
|
|
virtual ConVarID FindFirstConVar() = 0;
|
|
|
|
|
virtual ConVarID FindNextConVar(ConVarID previous) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void SetConVarValue(ConVarID cvarid, CSplitScreenSlot nSlot, CVValue_t *value, void*) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual ConCommandID FindCommand(const char *name) = 0;
|
|
|
|
|
virtual ConCommandID FindFirstCommand() = 0;
|
|
|
|
|
virtual ConCommandID FindNextCommand(ConCommandID previous) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:52:20 +03:00
|
|
|
|
virtual void DispatchConCommand(ConCommandID command, CCommandContext& ctx, CCommand& tok) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
// Install a global change callback (to be called when any convar changes)
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void InstallGlobalChangeCallback(FnChangeCallback_t callback) = 0;
|
|
|
|
|
virtual void RemoveGlobalChangeCallback(FnChangeCallback_t callback) = 0;
|
|
|
|
|
virtual void CallGlobalChangeCallbacks(ConVar *var, const char *pOldString, float flOldValue) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
// Reverts cvars which contain a specific flag
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void RevertFlaggedConVars(int nFlag) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void SetMaxSplitScreenSlots(int nSlots) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
virtual int GetMaxSplitScreenSlots() const = 0;
|
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void RegisterCreationListener() = 0;
|
|
|
|
|
virtual void RemoveCreationListener() = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void unk2() = 0;
|
|
|
|
|
virtual void unk3() = 0;
|
|
|
|
|
virtual void unk4() = 0;
|
|
|
|
|
virtual void unk5() = 0;
|
|
|
|
|
virtual void unk6() = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual characterset_t GetCharacterSet() = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void unk8() = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void RegisterConVar(ConVarDesc_t, void*, ConVarID&, ConVar&) = 0;
|
|
|
|
|
virtual void UnregisterConVar(ConVarID cvar) = 0;
|
|
|
|
|
virtual ConVar* GetConVar(ConVarID cvar) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void RegisterConCommand(void*, void*, ConCommandID&, ConCommand&) = 0;
|
|
|
|
|
virtual void UnregisterConCommand(ConCommandID command) = 0;
|
|
|
|
|
virtual ConCommand* GetConCommand(ConCommandID command) = 0;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-03-28 14:21:16 +03:00
|
|
|
|
virtual void QueueThreadSetValue(ConVarRefAbstract *ref, CSplitScreenSlot nSlot, CVValue_t *value) = 0;
|
|
|
|
|
};
|
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
|