summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/console.cpp313
-rw-r--r--src/console_cmds.cpp116
-rw-r--r--src/console_internal.h56
3 files changed, 34 insertions, 451 deletions
diff --git a/src/console.cpp b/src/console.cpp
index 89b38c590..5775ccac0 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -28,9 +28,8 @@
#define ICON_TOKEN_COUNT 20
/* console parser */
-IConsoleCmd *_iconsole_cmds; ///< list of registred commands
-IConsoleVar *_iconsole_vars; ///< list of registred vars
-IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
+IConsoleCmd *_iconsole_cmds; ///< list of registered commands
+IConsoleAlias *_iconsole_aliases; ///< list of registered aliases
FILE *_iconsole_output_file;
@@ -197,7 +196,7 @@ bool GetArgumentInteger(uint32 *value, const char *arg)
* *************************/
/**
- * General internal hooking code that is the same for both commands and variables
+ * General internal hooking code
* @param hooks IConsoleHooks structure that will be set according to
* @param type type access trigger
* @param proc function called when the hook criteria is met
@@ -263,21 +262,8 @@ void IConsoleCmdHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *
}
/**
- * Add a hook to a variable that will be triggered at certain points
- * @param name name of the variable that the hook is added to
- * @param type type of hook that is added (ACCESS, BEFORE and AFTER change)
- * @param proc function called when the hook criteria is met
- */
-void IConsoleVarHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc)
-{
- IConsoleVar *var = IConsoleVarGet(name);
- if (var == NULL) return;
- IConsoleHookAdd(&var->hook, type, proc);
-}
-
-/**
* Perhaps ugly macro, but this saves us the trouble of writing the same function
- * three types, just with different variables. Yes, templates would be handy. It was
+ * twice, just with different variables. Yes, templates would be handy. It was
* either this define or an even more ugly void* magic function
*/
#define IConsoleAddSorted(_base, item_new, IConsoleType, type) \
@@ -474,280 +460,6 @@ static void IConsoleAliasExec(const IConsoleAlias *alias, byte tokencount, char
}
/**
- * Special function for adding string-type variables. They in addition
- * also need a 'size' value saying how long their string buffer is.
- * @param name name of the variable that will be used
- * @param addr memory location the variable will point to
- * @param size the length of the string buffer
- * @param help the help string shown for the variable
- * For more information see IConsoleVarRegister()
- */
-void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help)
-{
- IConsoleVar *var;
- IConsoleVarRegister(name, addr, ICONSOLE_VAR_STRING, help);
- var = IConsoleVarGet(name);
- var->size = size;
-}
-
-/**
- * Register a new variable to be used in the console
- * @param name name of the variable that will be used
- * @param addr memory location the variable will point to
- * @param help the help string shown for the variable
- * @param type the type of the variable (simple atomic) so we know which values it can get
- */
-void IConsoleVarRegister(const char *name, void *addr, IConsoleVarTypes type, const char *help)
-{
- char *new_cmd = strdup(name);
- IConsoleVar *item_new = MallocT<IConsoleVar>(1);
-
- item_new->help = (help != NULL) ? strdup(help) : NULL;
-
- item_new->next = NULL;
- item_new->name = new_cmd;
- item_new->addr = addr;
- item_new->proc = NULL;
- item_new->type = type;
-
- item_new->hook.access = NULL;
- item_new->hook.pre = NULL;
- item_new->hook.post = NULL;
-
- IConsoleAddSorted(_iconsole_vars, item_new, IConsoleVar, "a variable");
-}
-
-/**
- * Find the variable pointed to by its string
- * @param name variable to be found
- * @return return Varstruct of the found variable, or NULL on failure
- */
-IConsoleVar *IConsoleVarGet(const char *name)
-{
- IConsoleVar *item;
- for (item = _iconsole_vars; item != NULL; item = item->next) {
- if (strcmp(item->name, name) == 0) return item;
- }
-
- return NULL;
-}
-
-/**
- * Get the value of the variable and put it into a printable
- * string form so we can use it for printing
- */
-static char *IConsoleVarGetStringValue(const IConsoleVar *var)
-{
- static char tempres[50];
- char *value = tempres;
-
- switch (var->type) {
- case ICONSOLE_VAR_BOOLEAN:
- snprintf(tempres, sizeof(tempres), "%s", (*(bool*)var->addr) ? "on" : "off");
- break;
- case ICONSOLE_VAR_BYTE:
- snprintf(tempres, sizeof(tempres), "%u", *(byte*)var->addr);
- break;
- case ICONSOLE_VAR_UINT16:
- snprintf(tempres, sizeof(tempres), "%u", *(uint16*)var->addr);
- break;
- case ICONSOLE_VAR_UINT32:
- snprintf(tempres, sizeof(tempres), "%u", *(uint32*)var->addr);
- break;
- case ICONSOLE_VAR_INT16:
- snprintf(tempres, sizeof(tempres), "%i", *(int16*)var->addr);
- break;
- case ICONSOLE_VAR_INT32:
- snprintf(tempres, sizeof(tempres), "%i", *(int32*)var->addr);
- break;
- case ICONSOLE_VAR_STRING:
- value = (char*)var->addr;
- break;
- default: NOT_REACHED();
- }
-
- return value;
-}
-
-/**
- * Print out the value of the variable after it has been assigned
- * a new value, thus giving us feedback on the action
- */
-static void IConsoleVarPrintSetValue(const IConsoleVar *var)
-{
- char *value = IConsoleVarGetStringValue(var);
- IConsolePrintF(CC_WARNING, "'%s' changed to: %s", var->name, value);
-}
-
-/**
- * Set a new value to a console variable
- * @param *var the variable being set/changed
- * @param value the new value given to the variable, cast properly
- */
-static void IConsoleVarSetValue(const IConsoleVar *var, uint32 value)
-{
- IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_PRE_ACTION);
- switch (var->type) {
- case ICONSOLE_VAR_BOOLEAN:
- *(bool*)var->addr = (value != 0);
- break;
- case ICONSOLE_VAR_BYTE:
- *(byte*)var->addr = (byte)value;
- break;
- case ICONSOLE_VAR_UINT16:
- *(uint16*)var->addr = (uint16)value;
- break;
- case ICONSOLE_VAR_INT16:
- *(int16*)var->addr = (int16)value;
- break;
- case ICONSOLE_VAR_UINT32:
- *(uint32*)var->addr = (uint32)value;
- break;
- case ICONSOLE_VAR_INT32:
- *(int32*)var->addr = (int32)value;
- break;
- default: NOT_REACHED();
- }
-
- IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_POST_ACTION);
- IConsoleVarPrintSetValue(var);
-}
-
-/**
- * Set a new value to a string-type variable. Basically this
- * means to copy the new value over to the container.
- * @param *var the variable in question
- * @param *value the new value
- */
-static void IConsoleVarSetStringvalue(const IConsoleVar *var, const char *value)
-{
- if (var->type != ICONSOLE_VAR_STRING || var->addr == NULL) return;
-
- IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_PRE_ACTION);
- ttd_strlcpy((char*)var->addr, value, var->size);
- IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_POST_ACTION);
- IConsoleVarPrintSetValue(var); // print out the new value, giving feedback
- return;
-}
-
-/**
- * Query the current value of a variable and return it
- * @param *var the variable queried
- * @return current value of the variable
- */
-static uint32 IConsoleVarGetValue(const IConsoleVar *var)
-{
- uint32 result = 0;
-
- switch (var->type) {
- case ICONSOLE_VAR_BOOLEAN:
- result = *(bool*)var->addr;
- break;
- case ICONSOLE_VAR_BYTE:
- result = *(byte*)var->addr;
- break;
- case ICONSOLE_VAR_UINT16:
- result = *(uint16*)var->addr;
- break;
- case ICONSOLE_VAR_INT16:
- result = *(int16*)var->addr;
- break;
- case ICONSOLE_VAR_UINT32:
- result = *(uint32*)var->addr;
- break;
- case ICONSOLE_VAR_INT32:
- result = *(int32*)var->addr;
- break;
- default: NOT_REACHED();
- }
- return result;
-}
-
-/**
- * Print out the value of the variable when asked
- */
-void IConsoleVarPrintGetValue(const IConsoleVar *var)
-{
- char *value;
- /* Some variables need really specific handling, handle this in its
- * callback function */
- if (var->proc != NULL) {
- var->proc(0, NULL);
- return;
- }
-
- value = IConsoleVarGetStringValue(var);
- IConsolePrintF(CC_WARNING, "Current value for '%s' is: %s", var->name, value);
-}
-
-/**
- * Execute a variable command. Without any parameters, print out its value
- * with parameters it assigns a new value to the variable
- * @param *var the variable that we will be querying/changing
- * @param tokencount how many additional parameters have been given to the commandline
- * @param *token the actual parameters the variable was called with
- */
-static void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[ICON_TOKEN_COUNT])
-{
- const char *tokenptr = token[0];
- byte t_index = tokencount;
- uint32 value;
-
- DEBUG(console, 6, "Requested command is a variable");
-
- if (tokencount == 0) { // Just print out value
- IConsoleVarPrintGetValue(var);
- return;
- }
-
- /* Use of assignment sign is not mandatory but supported, so just 'ignore it appropiately' */
- if (strcmp(tokenptr, "=") == 0) tokencount--;
-
- if (tokencount == 1) {
- /* Some variables need really special handling, handle it in their callback procedure */
- if (var->proc != NULL) {
- var->proc(tokencount, &token[t_index - tokencount]); // set the new value
- return;
- }
- /* Strings need special processing. No need to convert the argument to
- * an integer value, just copy over the argument on a one-by-one basis */
- if (var->type == ICONSOLE_VAR_STRING) {
- IConsoleVarSetStringvalue(var, token[t_index - tokencount]);
- return;
- } else if (GetArgumentInteger(&value, token[t_index - tokencount])) {
- IConsoleVarSetValue(var, value);
- return;
- }
-
- /* Increase or decrease the value by one. This of course can only happen to 'number' types */
- if (strcmp(tokenptr, "++") == 0 && var->type != ICONSOLE_VAR_STRING) {
- IConsoleVarSetValue(var, IConsoleVarGetValue(var) + 1);
- return;
- }
-
- if (strcmp(tokenptr, "--") == 0 && var->type != ICONSOLE_VAR_STRING) {
- IConsoleVarSetValue(var, IConsoleVarGetValue(var) - 1);
- return;
- }
- }
-
- IConsoleError("invalid variable assignment");
-}
-
-/**
- * Add a callback function to the variable. Some variables need
- * very special processing, which can only be done with custom code
- * @param name name of the variable the callback function is added to
- * @param proc the function called
- */
-void IConsoleVarProcAdd(const char *name, IConsoleCmdProc *proc)
-{
- IConsoleVar *var = IConsoleVarGet(name);
- if (var == NULL) return;
- var->proc = proc;
-}
-
-/**
* Execute a given command passed to us. First chop it up into
* individual tokens (seperated by spaces), then execute it if possible
* @param cmdstr string to be parsed and executed
@@ -756,7 +468,6 @@ void IConsoleCmdExec(const char *cmdstr)
{
IConsoleCmd *cmd = NULL;
IConsoleAlias *alias = NULL;
- IConsoleVar *var = NULL;
const char *cmdptr;
char *tokens[ICON_TOKEN_COUNT], tokenstream[ICON_MAX_STREAMSIZE];
@@ -824,8 +535,8 @@ void IConsoleCmdExec(const char *cmdstr)
}
if (tokens[0] == '\0') return; // don't execute empty commands
- /* 2. Determine type of command (cmd, alias or variable) and execute
- * First try commands, then aliases, and finally variables. Execute
+ /* 2. Determine type of command (cmd or alias) and execute
+ * First try commands, then aliases. Execute
* the found action taking into account its hooking code
*/
cmd = IConsoleCmdGet(tokens[0]);
@@ -841,20 +552,12 @@ void IConsoleCmdExec(const char *cmdstr)
return;
}
- t_index--; // ignore the variable-name for comfort for both aliases and variaables
+ t_index--;
alias = IConsoleAliasGet(tokens[0]);
if (alias != NULL) {
IConsoleAliasExec(alias, t_index, &tokens[1]);
return;
}
- var = IConsoleVarGet(tokens[0]);
- if (var != NULL) {
- if (IConsoleHookHandle(&var->hook, ICONSOLE_HOOK_ACCESS)) {
- IConsoleVarExec(var, t_index, &tokens[1]);
- }
- return;
- }
-
- IConsoleError("command or variable not found");
+ IConsoleError("command not found");
}
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index cfd46e042..bde992874 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -44,14 +44,14 @@
static FILE *_script_file;
static bool _script_running;
-/* console command / variable defines */
+/* console command defines */
#define DEF_CONSOLE_CMD(function) static bool function(byte argc, char *argv[])
#define DEF_CONSOLE_HOOK(function) static bool function()
-/*****************************
- * variable and command hooks
- *****************************/
+/****************
+ * command hooks
+ ****************/
#ifdef ENABLE_NETWORK
@@ -69,7 +69,7 @@ DEF_CONSOLE_HOOK(ConHookServerOnly)
if (!NetworkAvailable()) return false;
if (!_network_server) {
- IConsoleError("This command/variable is only available to a network server.");
+ IConsoleError("This command is only available to a network server.");
return false;
}
return true;
@@ -80,7 +80,7 @@ DEF_CONSOLE_HOOK(ConHookClientOnly)
if (!NetworkAvailable()) return false;
if (_network_server) {
- IConsoleError("This command/variable is not available to a network server.");
+ IConsoleError("This command is not available to a network server.");
return false;
}
return true;
@@ -91,7 +91,7 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
if (!NetworkAvailable()) return false;
if (!_networking) {
- IConsoleError("Not connected. This command/variable is only available in multiplayer.");
+ IConsoleError("Not connected. This command is only available in multiplayer.");
return false;
}
return true;
@@ -100,7 +100,7 @@ DEF_CONSOLE_HOOK(ConHookNeedNetwork)
DEF_CONSOLE_HOOK(ConHookNoNetwork)
{
if (_networking) {
- IConsoleError("This command/variable is forbidden in multiplayer.");
+ IConsoleError("This command is forbidden in multiplayer.");
return false;
}
return true;
@@ -555,7 +555,7 @@ DEF_CONSOLE_CMD(ConServerInfo)
{
if (argc == 0) {
IConsoleHelp("List current and maximum client/company limits. Usage 'server_info'");
- IConsoleHelp("You can change these values by setting the variables 'max_clients', 'max_companies' and 'max_spectators'");
+ IConsoleHelp("You can change these values by modifying settings 'network.max_clients', 'network.max_companies' and 'network.max_spectators'");
return true;
}
@@ -1243,35 +1243,6 @@ DEF_CONSOLE_CMD(ConScreenShot)
return true;
}
-DEF_CONSOLE_CMD(ConInfoVar)
-{
- static const char * const _icon_vartypes[] = {"boolean", "byte", "uint16", "uint32", "int16", "int32", "string"};
- const IConsoleVar *var;
-
- if (argc == 0) {
- IConsoleHelp("Print out debugging information about a variable. Usage: 'info_var <var>'");
- return true;
- }
-
- if (argc < 2) return false;
-
- var = IConsoleVarGet(argv[1]);
- if (var == NULL) {
- IConsoleError("the given variable was not found");
- return true;
- }
-
- IConsolePrintF(CC_DEFAULT, "variable name: %s", var->name);
- IConsolePrintF(CC_DEFAULT, "variable type: %s", _icon_vartypes[var->type]);
- IConsolePrintF(CC_DEFAULT, "variable addr: %p", var->addr);
-
- if (var->hook.access) IConsoleWarning("variable is access hooked");
- if (var->hook.pre) IConsoleWarning("variable is pre hooked");
- if (var->hook.post) IConsoleWarning("variable is post hooked");
- return true;
-}
-
-
DEF_CONSOLE_CMD(ConInfoCmd)
{
const IConsoleCmd *cmd;
@@ -1348,7 +1319,6 @@ DEF_CONSOLE_CMD(ConHelp)
{
if (argc == 2) {
const IConsoleCmd *cmd;
- const IConsoleVar *var;
const IConsoleAlias *alias;
cmd = IConsoleCmdGet(argv[1]);
@@ -1368,25 +1338,16 @@ DEF_CONSOLE_CMD(ConHelp)
return true;
}
- var = IConsoleVarGet(argv[1]);
- if (var != NULL && var->help != NULL) {
- IConsoleHelp(var->help);
- return true;
- }
-
- IConsoleError("command or variable not found");
+ IConsoleError("command not found");
return true;
}
IConsolePrint(CC_WARNING, " ---- OpenTTD Console Help ---- ");
- IConsolePrint(CC_DEFAULT, " - variables: [command to list all variables: list_vars]");
- IConsolePrint(CC_DEFAULT, " set value with '<var> = <value>', use '++/--' to in-or decrement");
- IConsolePrint(CC_DEFAULT, " or omit '=' and just '<var> <value>'. get value with typing '<var>'");
IConsolePrint(CC_DEFAULT, " - commands: [command to list all commands: list_cmds]");
IConsolePrint(CC_DEFAULT, " call commands with '<command> <arg2> <arg3>...'");
IConsolePrint(CC_DEFAULT, " - to assign strings, or use them as arguments, enclose it within quotes");
IConsolePrint(CC_DEFAULT, " like this: '<command> \"string argument with spaces\"'");
- IConsolePrint(CC_DEFAULT, " - use 'help <command> | <variable>' to get specific information");
+ IConsolePrint(CC_DEFAULT, " - use 'help <command>' to get specific information");
IConsolePrint(CC_DEFAULT, " - scroll console output with shift + (up | down) | (pageup | pagedown))");
IConsolePrint(CC_DEFAULT, " - scroll console input history with the up | down arrows");
IConsolePrint(CC_DEFAULT, "");
@@ -1411,24 +1372,6 @@ DEF_CONSOLE_CMD(ConListCommands)
return true;
}
-DEF_CONSOLE_CMD(ConListVariables)
-{
- const IConsoleVar *var;
-
- if (argc == 0) {
- IConsoleHelp("List all registered variables. Usage: 'list_vars [<pre-filter>]'");
- return true;
- }
-
- for (var = _iconsole_vars; var != NULL; var = var->next) {
- if (argv[1] == NULL || strstr(var->name, argv[1]) != NULL) {
- IConsolePrintF(CC_DEFAULT, "%s", var->name);
- }
- }
-
- return true;
-}
-
DEF_CONSOLE_CMD(ConListAliases)
{
const IConsoleAlias *alias;
@@ -1737,24 +1680,6 @@ DEF_CONSOLE_CMD(ConListSettings)
return true;
}
-DEF_CONSOLE_CMD(ConListDumpVariables)
-{
- const IConsoleVar *var;
-
- if (argc == 0) {
- IConsoleHelp("List all variables with their value. Usage: 'dump_vars [<pre-filter>]'");
- return true;
- }
-
- for (var = _iconsole_vars; var != NULL; var = var->next) {
- if (argv[1] == NULL || strstr(var->name, argv[1]) != NULL) {
- IConsoleVarPrintGetValue(var);
- }
- }
-
- return true;
-}
-
DEF_CONSOLE_CMD(ConGamelogPrint)
{
GamelogPrintConsole();
@@ -1762,9 +1687,9 @@ DEF_CONSOLE_CMD(ConGamelogPrint)
}
#ifdef _DEBUG
-/*******************************************
- * debug commands and variables
- ********************************************/
+/******************
+ * debug commands
+ ******************/
static void IConsoleDebugLibRegister()
{
@@ -1775,15 +1700,13 @@ static void IConsoleDebugLibRegister()
}
#endif
-/*******************************************
- * console command and variable registration
- ********************************************/
+/*******************************
+ * console command registration
+ *******************************/
void IConsoleStdLibRegister()
{
- /* default variables and functions */
IConsoleCmdRegister("debug_level", ConDebugLevel);
- IConsoleCmdRegister("dump_vars", ConListDumpVariables);
IConsoleCmdRegister("echo", ConEcho);
IConsoleCmdRegister("echoc", ConEchoC);
IConsoleCmdRegister("exec", ConExec);
@@ -1791,9 +1714,7 @@ void IConsoleStdLibRegister()
IConsoleCmdRegister("part", ConPart);
IConsoleCmdRegister("help", ConHelp);
IConsoleCmdRegister("info_cmd", ConInfoCmd);
- IConsoleCmdRegister("info_var", ConInfoVar);
IConsoleCmdRegister("list_cmds", ConListCommands);
- IConsoleCmdRegister("list_vars", ConListVariables);
IConsoleCmdRegister("list_aliases", ConListAliases);
IConsoleCmdRegister("newgame", ConNewGame);
IConsoleCmdRegister("restart", ConRestart);
@@ -1838,7 +1759,7 @@ void IConsoleStdLibRegister()
IConsoleCmdRegister("stop_ai", ConStopAI);
#endif /* ENABLE_AI */
- /* networking variables and functions */
+ /* networking functions */
#ifdef ENABLE_NETWORK
/* Network hooks; only active in network */
IConsoleCmdHookAdd ("resetengines", ICONSOLE_HOOK_ACCESS, ConHookNoNetwork);
@@ -1898,7 +1819,6 @@ void IConsoleStdLibRegister()
IConsoleCmdRegister("unpause", ConUnPauseGame);
IConsoleCmdHookAdd("unpause", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
- /*** Networking variables ***/
IConsoleCmdRegister("company_pw", ConCompanyPassword);
IConsoleCmdHookAdd("company_pw", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
IConsoleAliasRegister("company_password", "company_pw %+");
diff --git a/src/console_internal.h b/src/console_internal.h
index d4b3748a0..0be93bf19 100644
--- a/src/console_internal.h
+++ b/src/console_internal.h
@@ -19,16 +19,6 @@ enum {
ICON_MAX_STREAMSIZE = 2048, ///< maximum length of a totally expanded command
};
-enum IConsoleVarTypes {
- ICONSOLE_VAR_BOOLEAN,
- ICONSOLE_VAR_BYTE,
- ICONSOLE_VAR_UINT16,
- ICONSOLE_VAR_UINT32,
- ICONSOLE_VAR_INT16,
- ICONSOLE_VAR_INT32,
- ICONSOLE_VAR_STRING
-};
-
enum IConsoleHookTypes {
ICONSOLE_HOOK_ACCESS,
ICONSOLE_HOOK_PRE_ACTION,
@@ -36,15 +26,15 @@ enum IConsoleHookTypes {
};
/** --Hooks--
- * Hooks are certain triggers get get accessed/executed on either
- * access, before execution/change or after execution/change. This allows
+ * Hooks are certain triggers that are executed on either
+ * access, before execution or after execution. This allows
* for general flow of permissions or special action needed in some cases
*/
typedef bool IConsoleHook();
struct IConsoleHooks{
- IConsoleHook *access; ///< trigger when accessing the variable/command
- IConsoleHook *pre; ///< trigger before the variable/command is changed/executed
- IConsoleHook *post; ///< trigger after the variable/command is changed/executed
+ IConsoleHook *access; ///< trigger when accessing the command
+ IConsoleHook *pre; ///< trigger before the command is executed
+ IConsoleHook *post; ///< trigger after the command is executed
};
/** --Commands--
@@ -64,31 +54,10 @@ struct IConsoleCmd {
IConsoleHooks hook; ///< any special trigger action that needs executing
};
-/** --Variables--
- * Variables are pointers to real ingame variables which allow for
- * changing while ingame. After changing they keep their new value
- * and can be used for debugging, gameplay, etc. It accepts:
- * - no arguments; just print out current value
- * - '= <new value>' to assign a new value to the variable
- * - '++' to increase value by one
- * - '--' to decrease value by one
- */
-struct IConsoleVar {
- char *name; ///< name of the variable
- IConsoleVar *next; ///< next variable in list
-
- void *addr; ///< the address where the variable is pointing at
- uint32 size; ///< size of the variable, used for strings
- char *help; ///< the optional help string shown when requesting information
- IConsoleVarTypes type; ///< type of variable (for correct assignment/output)
- IConsoleCmdProc *proc; ///< some variables need really special handling, use a callback function for that
- IConsoleHooks hook; ///< any special trigger action that needs executing
-};
-
/** --Aliases--
* Aliases are like shortcuts for complex functions, variable assignments,
- * etc. You can use a simple alias to rename a longer command (eg 'lv' for
- * 'list_vars' for example), or concatenate more commands into one
+ * etc. You can use a simple alias to rename a longer command (eg 'set' for
+ * 'setting' for example), or concatenate more commands into one
* (eg. 'ng' for 'load %A; unpause; debug_level 5'). Aliases can parse the arguments
* given to them in the command line.
* - "%A - %Z" substitute arguments 1 t/m 26
@@ -105,7 +74,6 @@ struct IConsoleAlias {
/* console parser */
extern IConsoleCmd *_iconsole_cmds; ///< list of registred commands
-extern IConsoleVar *_iconsole_vars; ///< list of registred vars
extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
/* console functions */
@@ -117,19 +85,11 @@ void IConsoleAliasRegister(const char *name, const char *cmd);
IConsoleCmd *IConsoleCmdGet(const char *name);
IConsoleAlias *IConsoleAliasGet(const char *name);
-/* Variables */
-void IConsoleVarRegister(const char *name, void *addr, IConsoleVarTypes type, const char *help);
-void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help);
-IConsoleVar *IConsoleVarGet(const char *name);
-void IConsoleVarPrintGetValue(const IConsoleVar *var);
-
-/* console std lib (register ingame commands/aliases/variables) */
+/* console std lib (register ingame commands/aliases) */
void IConsoleStdLibRegister();
/* Hooking code */
void IConsoleCmdHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
-void IConsoleVarHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
-void IConsoleVarProcAdd(const char *name, IConsoleCmdProc *proc);
/* Supporting functions */
bool GetArgumentInteger(uint32 *value, const char *arg);