OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #ifndef CONSOLE_INTERNAL_H
11 #define CONSOLE_INTERNAL_H
65 typedef std::map<std::string, IConsoleCmd> CommandList;
66 typedef std::map<std::string, IConsoleAlias> AliasList;
70 static AliasList &Aliases();
75 static void AliasRegister(
const std::string &name,
const std::string &cmd);
80 void IConsoleClearBuffer();
83 void IConsoleStdLibRegister();
88 void IConsoleGUIInit();
89 void IConsoleGUIFree();
IConsoleCmdProc * proc
process executed when command is typed
static const uint ICON_CMDLN_SIZE
maximum length of a typed in command
bool GetArgumentInteger(uint32 *value, const char *arg)
Change a string into its number representation.
static IConsoleAlias * AliasGet(const std::string &name)
Find the alias pointed to by its string.
void IConsoleGUIPrint(TextColour colour_code, char *string)
Handle the printing of text entered into the console or redirected there by any other means.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
std::string cmdline
command(s) that is/are being aliased
IConsoleHook * hook
any special trigger action that needs executing
std::string name
name of command
static void CmdRegister(const std::string &name, IConsoleCmdProc *proc, IConsoleHook *hook=nullptr)
Register a new command to be used in the console.
static const uint ICON_MAX_STREAMSIZE
maximum length of a totally expanded command
@ CHR_ALLOW
Allow command execution.
std::string name
name of the alias
static void AliasRegister(const std::string &name, const std::string &cmd)
Register a an alias for an already existing command in the console.
–Aliases– Aliases are like shortcuts for complex functions, variable assignments, etc.
@ CHR_DISALLOW
Disallow command execution.
@ CHR_HIDE
Hide the existence of the command.
bool IConsoleCmdProc(byte argc, char *argv[])
–Commands– Commands are commands, or functions.
ConsoleHookResult
Return values of console hooks (#IConsoleHook).
static IConsoleCmd * CmdGet(const std::string &name)
Find the command pointed to by its string.
Commands
List of commands.