10#ifndef CONSOLE_INTERNAL_H
11#define CONSOLE_INTERNAL_H
75 typedef std::map<std::string, IConsoleCmd> CommandList;
76 typedef std::map<std::string, IConsoleAlias> AliasList;
80 static AliasList &Aliases();
85 static void AliasRegister(
const std::string &name, std::string_view cmd);
90void IConsoleClearBuffer();
93void IConsoleStdLibRegister();
95void IConsoleGUIInit();
96void IConsoleGUIFree();
Commands
List of commands.
ConsoleHookResult(bool echo) IConsoleHook
Checks whether the command may be executed.
bool(std::span< std::string_view > argv) IConsoleCmdProc
Entrypoint of a console command.
ConsoleHookResult
Return values of console hooks (IConsoleHook).
@ CHR_HIDE
Hide the existence of the command.
@ CHR_DISALLOW
Disallow command execution.
@ CHR_ALLOW
Allow command execution.
void IConsoleGUIPrint(TextColour colour_code, const std::string &string)
Handle the printing of text entered into the console or redirected there by any other means.
static const uint ICON_CMDLN_SIZE
maximum length of a typed in command
Types related to the graphics and/or input devices.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
–Aliases– Aliases are like shortcuts for complex functions, variable assignments, etc.
std::string cmdline
command(s) that is/are being aliased
std::string name
name of the alias
–Commands– Commands are commands, or functions.
IConsoleCmdProc * proc
process executed when command is typed
IConsoleHook * hook
any special trigger action that needs executing
std::string name
name of command
static void AliasRegister(const std::string &name, std::string_view cmd)
Register a an alias for an already existing command in the console.
static IConsoleAlias * AliasGet(const std::string &name)
Find the alias pointed to by its string.
static void CmdRegister(const std::string &name, IConsoleCmdProc *proc, IConsoleHook *hook=nullptr)
Register a new command to be used in the console.
static IConsoleCmd * CmdGet(const std::string &name)
Find the command pointed to by its string.