2005-04-16 21:59:26 +02:00
|
|
|
/* ======== SourceMM ========
|
2005-04-17 01:33:39 +02:00
|
|
|
* Copyright (C) 2004-2005 Metamod:Source Development Team
|
2005-04-16 21:59:26 +02:00
|
|
|
* No warranties of any kind
|
|
|
|
*
|
|
|
|
* License: zlib/libpng
|
|
|
|
*
|
|
|
|
* Author(s): David "BAILOPAN" Anderson
|
|
|
|
* ============================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE_CONCOMMANDS_H
|
|
|
|
#define _INCLUDE_CONCOMMANDS_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Header for console commands
|
|
|
|
* @file concommands.h
|
|
|
|
*/
|
|
|
|
|
2005-05-01 20:42:16 +02:00
|
|
|
#include <interface.h>
|
|
|
|
#include <eiface.h>
|
2005-04-16 21:59:26 +02:00
|
|
|
#include "sourcemm.h"
|
|
|
|
#include <convar.h>
|
2005-08-12 19:44:53 +02:00
|
|
|
#include "sh_list.h"
|
2005-04-16 21:59:26 +02:00
|
|
|
|
|
|
|
class SMConVarAccessor : public IConCommandBaseAccessor
|
|
|
|
{
|
2005-08-12 19:44:53 +02:00
|
|
|
SourceHook::List<ConCommandBase*> m_RegisteredCommands;
|
2005-04-16 21:59:26 +02:00
|
|
|
public:
|
|
|
|
virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
|
2005-05-26 10:06:23 +02:00
|
|
|
bool Register(ConCommandBase *pCommand);
|
2005-05-06 11:44:41 +02:00
|
|
|
void MarkCommandsAsGameDLL();
|
2005-05-26 10:06:23 +02:00
|
|
|
void Unregister(ConCommandBase *pCommand);
|
2005-09-24 23:10:53 +02:00
|
|
|
void UnregisterGameDLLCommands();
|
2005-05-26 10:06:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CAlwaysRegisterableCommand : public ConCommandBase
|
|
|
|
{
|
|
|
|
ICvar *m_pICvar;
|
|
|
|
public:
|
|
|
|
CAlwaysRegisterableCommand();
|
|
|
|
bool IsRegistered( void ) const;
|
|
|
|
// If already registered, removes us
|
|
|
|
// Then it registers us again
|
|
|
|
void BringToFront();
|
2005-04-16 21:59:26 +02:00
|
|
|
};
|
|
|
|
|
2005-07-07 22:58:05 +02:00
|
|
|
const char *GetPluginsFile();
|
|
|
|
|
2005-04-16 21:59:26 +02:00
|
|
|
extern SMConVarAccessor g_SMConVarAccessor;
|
|
|
|
|
|
|
|
#endif //_INCLUDE_CONCOMMANDS_H
|