1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-20 04:26:03 +08:00

Update ICommandLine

This commit is contained in:
Nick Hastings
2023-04-02 11:52:25 -04:00
committed by Nicholas Hastings
parent 7c0eabfd64
commit 843d279123
2 changed files with 34 additions and 3 deletions

View File

@ -26,7 +26,6 @@ public:
// Check whether a particular parameter exists // Check whether a particular parameter exists
virtual const char *CheckParm( const char *psz, const char **ppszValue = 0 ) const = 0; virtual const char *CheckParm( const char *psz, const char **ppszValue = 0 ) const = 0;
virtual bool HasParm( const char *psz ) 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; virtual void AppendParm( const char *pszParm, const char *pszValues ) = 0;
// Gets at particular parameters // Gets at particular parameters

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
#endif #endif
#include <interfaces/interfaces.h>
#include <icvar.h>
#include "tier0/dbg.h" #include "tier0/dbg.h"
#include "tier1/utlvector.h" #include "tier1/utlvector.h"
#include "tier1/utlstring.h" #include "tier1/utlstring.h"
@ -341,8 +343,38 @@ struct ConCommandCB
}; };
// Should be size of 64 (0x40) // 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: public:
ConCommandCB callback; ConCommandCB callback;
ConCommandCB autocompletion_callback; ConCommandCB autocompletion_callback;
@ -350,7 +382,7 @@ public:
}; };
// Should be size of 48 (0x30) (56 in linked list) // Should be size of 48 (0x30) (56 in linked list)
class ConCommand : ConCommandBase class ConCommand : public ConCommandBase
{ {
public: public:
ConCommandCB autocompletion_callback; ConCommandCB autocompletion_callback;