3 #include <common/mutators/base.qh>
5 // register all possible hooks here
7 // to use a hook, first register your mutator using REGISTER_MUTATOR
8 // then create your function using MUTATOR_HOOKFUNCTION
17 * Called when a menu command is parsed
18 * NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
19 * NOTE: return true if you handled the command, return false to continue handling
20 * NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
22 * MUTATOR_HOOKFUNCTION(foo, Menu_ConsoleCommand) {
23 * if (MUTATOR_RETURNVALUE) return false; // command was already handled
24 * if (cmd_name == "echocvar" && cmd_argc >= 2) {
25 * print(cvar_string(argv(1)), "\n");
28 * if (cmd_name == "echostring" && cmd_argc >= 2) {
29 * print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
35 #define EV_Menu_ConsoleCommand(i, o) \
36 /** command name */ i(string, cmd_name) \
37 /** also, argv() can be used */ i(int, cmd_argc) \
38 /** whole command, use only if you really have to */ i(string, cmd_string) \
40 MUTATOR_HOOKABLE(Menu_ConsoleCommand, EV_Menu_ConsoleCommand);
42 #define EV_ConfigureDialogs(i, o) \
43 /** main window entity */ i(entity, MUTATOR_ARGV_0_entity) \
45 MUTATOR_HOOKABLE(ConfigureDialogs, EV_ConfigureDialogs);