mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
More ConCommand tweaks
This commit is contained in:

committed by
Nicholas Hastings

parent
2541d89f62
commit
bff074c159
@ -392,7 +392,7 @@ public:
|
|||||||
const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 );
|
const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 );
|
||||||
ConCommand( ConCommandRefAbstract *pReferenceOut, const char *pName, FnCommandCallbackVoid_t callback,
|
ConCommand( ConCommandRefAbstract *pReferenceOut, const char *pName, FnCommandCallbackVoid_t callback,
|
||||||
const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 );
|
const char *pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 );
|
||||||
ConCommand( ConCommandRefAbstract* pReferenceOut, const char* pName, FnCommandCallbackNoContext_t pCallback,
|
ConCommand( ConCommandRefAbstract* pReferenceOut, const char* pName, FnCommandCallbackNoContext_t callback,
|
||||||
const char* pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 );
|
const char* pHelpString = 0, int64 flags = 0, FnCommandCompletionCallback completionFunc = 0 );
|
||||||
ConCommand( ConCommandRefAbstract *pReferenceOut, const char *pName, ICommandCallback *pCallback,
|
ConCommand( ConCommandRefAbstract *pReferenceOut, const char *pName, ICommandCallback *pCallback,
|
||||||
const char *pHelpString = 0, int64 flags = 0, ICommandCompletionCallback *pCommandCompletionCallback = 0 );
|
const char *pHelpString = 0, int64 flags = 0, ICommandCompletionCallback *pCommandCompletionCallback = 0 );
|
||||||
@ -425,10 +425,12 @@ private:
|
|||||||
class CallbackInfo_t
|
class CallbackInfo_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FnCommandCallback_t m_fnCommandCallback;
|
union {
|
||||||
FnCommandCallbackVoid_t m_fnVoidCommandCallback;
|
FnCommandCallback_t m_fnCommandCallback;
|
||||||
FnCommandCallbackNoContext_t m_fnContextlessCommandCallback;
|
FnCommandCallbackVoid_t m_fnVoidCommandCallback;
|
||||||
ICommandCallback* m_pCommandCallback;
|
FnCommandCallbackNoContext_t m_fnContextlessCommandCallback;
|
||||||
|
ICommandCallback* m_pCommandCallback;
|
||||||
|
};
|
||||||
|
|
||||||
bool m_bUsingCommandCallbackInterface : 1;
|
bool m_bUsingCommandCallbackInterface : 1;
|
||||||
bool m_bHasVoidCommandCallback : 1;
|
bool m_bHasVoidCommandCallback : 1;
|
||||||
@ -1106,13 +1108,13 @@ private:
|
|||||||
#define CON_COMMAND_SHARED( name, description ) \
|
#define CON_COMMAND_SHARED( name, description ) \
|
||||||
static ConCommandRefAbstract name##_ref; \
|
static ConCommandRefAbstract name##_ref; \
|
||||||
static void name##_callback( const CCommandContext &context, const CCommand &args ); \
|
static void name##_callback( const CCommandContext &context, const CCommand &args ); \
|
||||||
static ConCommand name##_command_client( &name##_ref, #name "_client", name##_callback, name, description ); \
|
static ConCommand name##_command_client( &name##_ref, #name "_client", name##_callback, description ); \
|
||||||
static void name##_callback( const CCommandContext &context, const CCommand &args )
|
static void name##_callback( const CCommandContext &context, const CCommand &args )
|
||||||
#else
|
#else
|
||||||
#define CON_COMMAND_SHARED( name, description ) \
|
#define CON_COMMAND_SHARED( name, description ) \
|
||||||
static ConCommandRefAbstract name##_ref; \
|
static ConCommandRefAbstract name##_ref; \
|
||||||
static void name##_callback( const CCommandContext &context, const CCommand &args ); \
|
static void name##_callback( const CCommandContext &context, const CCommand &args ); \
|
||||||
static ConCommand name##_command( &name##_ref, #name, name##_callback, name, description ); \
|
static ConCommand name##_command( &name##_ref, #name, name##_callback, description ); \
|
||||||
static void name##_callback( const CCommandContext &context, const CCommand &args )
|
static void name##_callback( const CCommandContext &context, const CCommand &args )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user