2006-12-17 10:59:01 +01:00
|
|
|
#ifndef _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
|
|
|
|
|
2006-12-16 03:16:21 +01:00
|
|
|
#include "sourcemod.h"
|
2007-01-17 07:49:59 +01:00
|
|
|
#include <IRootConsoleMenu.h>
|
2006-12-16 03:16:21 +01:00
|
|
|
#include "PluginSys.h"
|
2006-12-17 10:59:01 +01:00
|
|
|
#include "sourcemm_api.h"
|
|
|
|
#include <convar.h>
|
2007-01-17 07:49:59 +01:00
|
|
|
#include <sh_list.h>
|
|
|
|
#include <sh_string.h>
|
|
|
|
#include "sm_trie.h"
|
2006-12-16 03:16:21 +01:00
|
|
|
|
|
|
|
using namespace SourceMod;
|
2007-01-17 07:49:59 +01:00
|
|
|
using namespace SourceHook;
|
2006-12-16 03:16:21 +01:00
|
|
|
|
2007-01-17 07:49:59 +01:00
|
|
|
struct ConsoleEntry
|
|
|
|
{
|
|
|
|
String command;
|
|
|
|
String description;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RootConsoleMenu :
|
2006-12-16 03:16:21 +01:00
|
|
|
public IConCommandBaseAccessor,
|
2007-01-17 07:49:59 +01:00
|
|
|
public SMGlobalClass,
|
|
|
|
public IRootConsoleCommand,
|
|
|
|
public IRootConsole
|
2006-12-16 03:16:21 +01:00
|
|
|
{
|
2007-01-17 07:49:59 +01:00
|
|
|
public:
|
|
|
|
RootConsoleMenu();
|
|
|
|
~RootConsoleMenu();
|
|
|
|
public: //IConCommandBaseAccessor
|
|
|
|
bool RegisterConCommandBase(ConCommandBase *pCommand);
|
|
|
|
public: //SMGlobalClass
|
|
|
|
void OnSourceModStartup(bool late);
|
|
|
|
void OnSourceModShutdown();
|
|
|
|
public: //IRootConsoleCommand
|
|
|
|
void OnRootConsoleCommand(const char *cmd, unsigned int argcount);
|
|
|
|
public: //IRootConsole
|
|
|
|
bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler);
|
|
|
|
bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler);
|
|
|
|
void ConsolePrint(const char *fmt, ...);
|
|
|
|
const char *GetArgument(unsigned int argno);
|
|
|
|
unsigned int GetArgumentCount();
|
|
|
|
const char *GetArguments();
|
2007-01-17 19:22:00 +01:00
|
|
|
void DrawGenericOption(const char *cmd, const char *text);
|
2007-01-17 07:49:59 +01:00
|
|
|
public:
|
|
|
|
void GotRootCmd();
|
|
|
|
private:
|
|
|
|
Trie *m_pCommands;
|
|
|
|
List<ConsoleEntry *> m_Menu;
|
2006-12-17 10:59:01 +01:00
|
|
|
};
|
|
|
|
|
2007-01-17 07:49:59 +01:00
|
|
|
extern RootConsoleMenu g_RootMenu;
|
|
|
|
|
2006-12-17 10:59:01 +01:00
|
|
|
#endif //_INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
|