Jump to content

WoW:Console: Difference between revisions

From Thunderbrew
No edit summary
No edit summary
Line 5: Line 5:
A command is a function associated with a string that contains no whitespace. The function accepts the name of the command as a string, as well as an optional argument string. For example, running the following command:
A command is a function associated with a string that contains no whitespace. The function accepts the name of the command as a string, as well as an optional argument string. For example, running the following command:


<code>
<pre>
RUN commandname "with argument"
RUN commandname "with argument"
</code>
</pre>


will dispatch a handler function:
will dispatch a handler function:


<code>
<pre>
int32 handler(const char* command, const char* argument) {
int32 handler(const char* command, const char* argument) {
   print(command);  // "commandname"
   print(command);  // "commandname"
Line 17: Line 17:
   return 1;
   return 1;
}
}
</code>
</pre>


=== Categories ===
=== Categories ===


Every [[#Commands|Command]] or [[WoW:CVar]] belongs to a category number.
Every [[#Commands|Command]] or [[WoW:CVar]] belongs to a category number.

Revision as of 20:53, 12 June 2025

The console is fundamental to the entire engine. It determines how the Graphics API is initialized, controls how configurations are set, and allows many features to be toggled or adjusted using commands without having to quit the game.

Commands

A command is a function associated with a string that contains no whitespace. The function accepts the name of the command as a string, as well as an optional argument string. For example, running the following command:

RUN commandname "with argument"

will dispatch a handler function:

int32 handler(const char* command, const char* argument) {
  print(command);  // "commandname"
  print(argument); // "with argument"
  return 1;
}

Categories

Every Command or WoW:CVar belongs to a category number.