diff --git a/public/tier0/icommandline.h b/public/tier0/icommandline.h index a4f0098f..ee3a1469 100644 --- a/public/tier0/icommandline.h +++ b/public/tier0/icommandline.h @@ -26,7 +26,6 @@ public: // Check whether a particular parameter exists virtual const char *CheckParm( const char *psz, const char **ppszValue = 0 ) const = 0; virtual bool HasParm( const char *psz ) const = 0; - virtual void RemoveParm( const char *parm ) = 0; virtual void AppendParm( const char *pszParm, const char *pszValues ) = 0; // Gets at particular parameters diff --git a/public/tier1/convar.h b/public/tier1/convar.h index 6d97bf57..c870453d 100644 --- a/public/tier1/convar.h +++ b/public/tier1/convar.h @@ -16,6 +16,8 @@ #pragma once #endif +#include +#include #include "tier0/dbg.h" #include "tier1/utlvector.h" #include "tier1/utlstring.h" @@ -341,8 +343,38 @@ struct ConCommandCB }; // Should be size of 64 (0x40) -class ConCommandDesc_t : ConCommandBase +class ConCommandDesc_t : public ConCommandBase { +public: + ConCommandDesc_t(const char* pName, FnCommandCallback_t callback, const char* pHelpString = 0, int64 flags = 0) + { + name = pName; + description = pHelpString; + this->flags = flags; + + this->callback.m_fnCommandCallback = callback; + this->callback.m_bUsingCommandCallback = true; + this->callback.m_bUsingCommandCallbackInterface = false; + this->callback.m_bUsingEmptyCommandCallback = false; + + } + + ConCommandDesc_t(const char* pName, ICommandCallback* pCallback, const char* pHelpString = 0, int64 flags = 0) + { + name = pName; + description = pHelpString; + this->flags = flags; + + this->callback.m_pCommandCallback = pCallback; + this->callback.m_bUsingCommandCallback = false; + this->callback.m_bUsingCommandCallbackInterface = true; + this->callback.m_bUsingEmptyCommandCallback = false; + } + + ConCommandRef *Register(ConCommandHandle &hndl) + { + return g_pCVar->RegisterConCommand(hndl, this); + } public: ConCommandCB callback; ConCommandCB autocompletion_callback; @@ -350,7 +382,7 @@ public: }; // Should be size of 48 (0x30) (56 in linked list) -class ConCommand : ConCommandBase +class ConCommand : public ConCommandBase { public: ConCommandCB autocompletion_callback;