SourceMod SDK  1.7
IRootConsoleMenu.h
Go to the documentation of this file.
1 
32 #ifndef _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
33 #define _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
34 
43 #define SMINTERFACE_ROOTCONSOLE_NAME "IRootConsole"
44 #define SMINTERFACE_ROOTCONSOLE_VERSION 2
45 
46 class CCommand;
47 
48 namespace SourceMod
49 {
54  {
55  public:
62  virtual const char *Arg(int n) const = 0;
63 
69  virtual int ArgC() const = 0;
70 
76  virtual const char *ArgS() const = 0;
77  };
78 
83  {
84  public:
85  virtual void OnRootConsoleCommand(const char *cmdname, const CCommand &command)
86  {
87  }
88 
89  virtual void OnRootConsoleCommand2(const char *cmdname, const ICommandArgs *args)
90  {
91  }
92  };
93 
97  class IRootConsole : public SMInterface
98  {
99  public:
108  virtual bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler) =0;
109 
117  virtual bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler) =0;
118 
125  virtual void ConsolePrint(const char *fmt, ...) =0;
126 
136  virtual void DrawGenericOption(const char *cmd, const char *text) =0;
137 
148  virtual bool AddRootConsoleCommand2(const char *cmd,
149  const char *text,
150  IRootConsoleCommand *pHandler) =0;
151  };
152 }
153 
154 #endif //_INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
155 
virtual bool AddRootConsoleCommand2(const char *cmd, const char *text, IRootConsoleCommand *pHandler)=0
Adds a root console command handler. The command must be unique.
Manages the root console menu - the "sm" command for servers.
Definition: IRootConsoleMenu.h:97
virtual void DrawGenericOption(const char *cmd, const char *text)=0
Draws a generic command/description pair. NOTE: The pair is currently four spaces indented and 16-N s...
Handles a root console menu action.
Definition: IRootConsoleMenu.h:82
virtual const char * ArgS() const =0
Returns the full argument string.
virtual bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler)=0
Adds a root console command handler. The command must be unique.
Wrapper around CCommand.
Definition: IRootConsoleMenu.h:53
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
virtual void ConsolePrint(const char *fmt,...)=0
Prints text back to the console.
Definition: IAdminSystem.h:63
virtual int ArgC() const =0
Returns the argument count.
virtual bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler)=0
Removes a root console command handler.
virtual const char * Arg(int n) const =0
Returns an argument by number.