Switch smn_maplists off KTrie (
bug 5884 part 4, r=ds).
3 * =============================================================================
5 * Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
32 #ifndef _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
33 #define _INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_
36 * @file IRootConsoleMenu.h
37 * @brief Defines the interface for adding options to the "sm" console command.
39 * You must be using the compat_wrappers.h header file to use this on
40 * Original/Episode1 builds.
43 #define SMINTERFACE_ROOTCONSOLE_NAME "IRootConsole"
44 #define SMINTERFACE_ROOTCONSOLE_VERSION 2
51 * @brief Wrapper around CCommand.
57 * @brief Returns an argument by number.
59 * @brief n Argument number.
60 * @return Argument string.
62 virtual const char *Arg(int n) const = 0;
65 * @brief Returns the argument count.
67 * @return Argument count.
69 virtual int ArgC() const = 0;
72 * @brief Returns the full argument string.
74 * @return Argument string.
76 virtual const char *ArgS() const = 0;
80 * @brief Handles a root console menu action.
82 class IRootConsoleCommand
85 virtual void OnRootConsoleCommand(const char *cmdname, const CCommand &command)
89 virtual void OnRootConsoleCommand2(const char *cmdname, const ICommandArgs *args)
95 * @brief Manages the root console menu - the "sm" command for servers.
97 class IRootConsole : public SMInterface
101 * @brief Adds a root console command handler. The command must be unique.
103 * @param cmd String containing the console command.
104 * @param text Description text.
105 * @param pHandler An IRootConsoleCommand pointer to handle the command.
106 * @return True on success, false on too many commands or duplicate command.
108 virtual bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler) =0;
111 * @brief Removes a root console command handler.
113 * @param cmd String containing the console command.
114 * @param pHandler An IRootConsoleCommand pointer for verification.
115 * @return True on success, false otherwise.
117 virtual bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler) =0;
120 * @brief Prints text back to the console.
122 * @param fmt Format of string.
123 * @param ... Format arguments.
125 virtual void ConsolePrint(const char *fmt, ...) =0;
128 * @brief Draws a generic command/description pair.
129 * NOTE: The pair is currently four spaces indented and 16-N spaces of separation,
130 * N being the length of the command name. This is subject to change in case we
131 * account for Valve's font choices.
133 * @param cmd String containing the command option.
134 * @param text String containing the command description.
136 virtual void DrawGenericOption(const char *cmd, const char *text) =0;
139 * @brief Adds a root console command handler. The command must be unique.
141 * This version of the function uses the OnRootConsoleCommand2 callback.
143 * @param cmd String containing the console command.
144 * @param text Description text.
145 * @param pHandler An IRootConsoleCommand pointer to handle the command.
146 * @return True on success, false on too many commands or duplicate command.
148 virtual bool AddRootConsoleCommand2(const char *cmd,
150 IRootConsoleCommand *pHandler) =0;
154 #endif //_INCLUDE_SOURCEMOD_ROOT_CONSOLE_MENU_H_