Crossfire Client, Trunk
|
Go to the source code of this file.
Data Structures | |
struct | ConsoleCommand |
Typedefs | |
typedef void(* | CommFunc) (const char *params) |
Enumerations | |
enum | CommCat { COMM_CAT_MISC = 0, COMM_CAT_INFO = 2, COMM_CAT_SETUP = 3, COMM_CAT_SCRIPT = 4, COMM_CAT_DEBUG = 5 } |
Functions | |
const char * | complete_command (const char *ocommand) |
void | extended_command (const char *ocommand) |
const ConsoleCommand * | find_command (const char *cmd) |
ConsoleCommand ** | get_cat_sorted_commands (void) |
const char * | get_category_name (CommCat cat) |
int | handle_local_command (const char *cp, const char *cpnext) |
void | init_commands (void) |
Variables | |
const typedef char *(* | CommHelpFunc )(void) |
Includes and prototypes for p_cmd.c for player-commands like '/magicmap'. Basically stolen piecemeal from the server branch.
Definition in file p_cmd.h.
enum CommCat |
const char* complete_command | ( | const char * | command | ) |
Player has entered 'command' and hit tab to complete it. See if we can find a completion. Returns matching command. Returns NULL if no command matches.
command |
Definition at line 614 of file p_cmd.c.
References commands, CommonCommands, draw_ext_info(), MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_NOTICE, ConsoleCommand::name, NDI_BLACK, num_commands, and num_server_commands.
Referenced by gtk_complete_command().
void extended_command | ( | const char * | ocommand | ) |
This is an extended command (ie, 'who, 'whatever, etc). In general, we just send the command to the server, but there are a few that we care about (bind, unbind)
The command passed to us can not be modified - if it is a keybinding, we get passed the string that is that binding - modifying it effectively changes the binding.
ocommand |
Definition at line 515 of file p_cmd.c.
References Player_Struct::count, cpl, handle_local_command(), MAX_BUF, script_lua_command(), send_command(), and Player_Struct::title.
Referenced by menu_quit_character(), on_entry_commands_activate(), and parse_key().
const ConsoleCommand* find_command | ( | const char * | cmd | ) |
Definition at line 428 of file p_cmd.c.
References name_sorted_commands, num_commands, and sort_by_name().
Referenced by command_help(), and handle_local_command().
ConsoleCommand** get_cat_sorted_commands | ( | void | ) |
Returns a pointer to the head of an array of ConsoleCommands sorted by category, then by name.
It's num_commands long.
Definition at line 468 of file p_cmd.c.
References cat_sorted_commands.
Referenced by do_clienthelp_list().
const char* get_category_name | ( | CommCat | cat | ) |
Definition at line 166 of file p_cmd.c.
References COMM_CAT_DEBUG, COMM_CAT_INFO, COMM_CAT_MISC, COMM_CAT_SCRIPT, and COMM_CAT_SETUP.
Referenced by do_clienthelp_list().
int handle_local_command | ( | const char * | cp, |
const char * | cpnext | ||
) |
Tries to handle command cp (with optional params in cpnext, which may be null) as a local command. If this was a local command, returns true to indicate command was handled. This code was moved from extended_command so scripts ca issue local commands to handle keybindings or anything else.
cp | |
cpnext |
Definition at line 481 of file p_cmd.c.
References ConsoleCommand::dofunc, draw_ext_info(), find_command(), MAX_BUF, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_NOTICE, ConsoleCommand::name, and NDI_RED.
Referenced by extended_command(), and script_process_cmd().
void init_commands | ( | void | ) |
Fills some internal arrays. Run this on startup, but not before filling in ToolkitCommands and ToolkitCommandsSize.
Definition at line 407 of file p_cmd.c.
References cat_sorted_commands, CommonCommands, name_sorted_commands, num_commands, sort_by_category(), and sort_by_name().
Referenced by client_init().