]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/commands/cl_cmd.qc
Add a quickmenu example file with syntax description
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / commands / cl_cmd.qc
1 // ==============================================
2 //  CSQC client commands code, written by Samual
3 //  Last updated: December 28th, 2011
4 // ==============================================
5
6 #include "../../common/command/command.qh"
7 #include "cl_cmd.qh"
8
9 #include "../autocvars.qh"
10 #include "../defs.qh"
11 #include "../hud.qh"
12 #include "../hud_config.qh"
13 #include "../main.qh"
14 #include "../mapvoting.qh"
15 #include "../miscfunctions.qh"
16
17 #include "../mutators/events.qh"
18
19 #include "../../common/mapinfo.qh"
20
21 #include "../../common/command/generic.qh"
22
23 void DrawDebugModel(entity this)
24 {
25         if (time - floor(time) > 0.5)
26         {
27                 PolyDrawModel(self);
28                 self.drawmask = 0;
29         }
30         else
31         {
32                 self.renderflags = 0;
33                 self.drawmask = MASK_NORMAL;
34         }
35 }
36
37
38 // =======================
39 //  Command Sub-Functions
40 // =======================
41
42 void LocalCommand_blurtest(int request)
43 {
44         // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
45         // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
46
47         #ifdef BLURTEST
48         switch (request)
49         {
50                 case CMD_REQUEST_COMMAND:
51                 {
52                         blurtest_time0 = time;
53                         blurtest_time1 = time + stof(argv(1));
54                         blurtest_radius = stof(argv(2));
55                         blurtest_power = stof(argv(3));
56                         LOG_INFO("Enabled blurtest\n");
57                         return;
58                 }
59
60                 default:
61                 case CMD_REQUEST_USAGE:
62                 {
63                         LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
64                         LOG_INFO("  No arguments required.\n");
65                         return;
66                 }
67         }
68         #else
69         if (request)
70         {
71                 LOG_INFO("Blurtest is not enabled on this client.\n");
72                 return;
73         }
74         #endif
75 }
76
77 void LocalCommand_boxparticles(int request, int argc)
78 {
79         switch (request)
80         {
81                 case CMD_REQUEST_COMMAND:
82                 {
83                         if (argc == 9)
84                         {
85                                 int effect = _particleeffectnum(argv(1));
86                                 if (effect >= 0)
87                                 {
88                                         int index = stoi(argv(2));
89                                         entity own;
90                                         if (index <= 0)
91                                                 own = entitybyindex(-index);
92                                         else
93                                                 own = findfloat(world, entnum, index);
94                                         vector org_from = stov(argv(3));
95                                         vector org_to = stov(argv(4));
96                                         vector dir_from = stov(argv(5));
97                                         vector dir_to = stov(argv(6));
98                                         int countmultiplier = stoi(argv(7));
99                                         int flags = stoi(argv(8));
100                                         boxparticles(effect, own, org_from, org_to, dir_from, dir_to, countmultiplier, flags);
101                                         return;
102                                 }
103                         }
104                 }
105
106                 default:
107                 {
108                         LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
109                 }
110                 case CMD_REQUEST_USAGE:
111                 {
112                         LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
113                         LOG_INFO("  'effectname' is the name of a particle effect in effectinfo.txt\n");
114                         LOG_INFO("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
115                         LOG_INFO("  'org_from' is the starting origin of the box\n");
116                         LOG_INFO("  'org_to' is the ending origin of the box\n");
117                         LOG_INFO("  'dir_from' is the minimum velocity\n");
118                         LOG_INFO("  'dir_to' is the maximum velocity\n");
119                         LOG_INFO("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
120                         LOG_INFO("  'flags' can contain:\n");
121                         LOG_INFO("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
122                         LOG_INFO("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
123                         LOG_INFO("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
124                         LOG_INFO("    128 to draw a trail, not a box\n");
125                         return;
126                 }
127         }
128 }
129
130 void LocalCommand_create_scrshot_ent(int request)
131 {
132         switch (request)
133         {
134                 case CMD_REQUEST_COMMAND:
135                 {
136                         string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
137                         int fh = fopen(filename, FILE_WRITE);
138
139                         if (fh >= 0)
140                         {
141                                 fputs(fh, "{\n");
142                                 fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
143                                 fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin.x), " ", ftos(view_origin.y), " ", ftos(view_origin.z)), "\"\n"));
144                                 fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
145                                 fputs(fh, "}\n");
146
147                                 LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
148
149                                 fclose(fh);
150                         }
151                         else
152                         {
153                                 LOG_INFO("^1Error: ^7Could not dump to file!\n");
154                         }
155                         return;
156                 }
157
158                 default:
159                 case CMD_REQUEST_USAGE:
160                 {
161                         LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
162                         LOG_INFO("  No arguments required.\n");
163                         return;
164                 }
165         }
166 }
167
168 void LocalCommand_debugmodel(int request, int argc)
169 {
170         switch (request)
171         {
172                 case CMD_REQUEST_COMMAND:
173                 {
174                         string modelname = argv(1);
175                         entity debugmodel_entity;
176
177                         debugmodel_entity = spawn();
178                         precache_model(modelname);
179                         _setmodel(debugmodel_entity, modelname);
180                         setorigin(debugmodel_entity, view_origin);
181                         debugmodel_entity.angles = view_angles;
182                         debugmodel_entity.draw = DrawDebugModel;
183                         debugmodel_entity.classname = "debugmodel";
184
185                         return;
186                 }
187
188                 default:
189                 case CMD_REQUEST_USAGE:
190                 {
191                         LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
192                         LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.\n");
193                         return;
194                 }
195         }
196 }
197
198 void LocalCommand_handlevote(int request, int argc)
199 {
200         switch (request)
201         {
202                 case CMD_REQUEST_COMMAND:
203                 {
204                         int vote_selection;
205                         string vote_string;
206
207                         if (InterpretBoolean(argv(1)))
208                         {
209                                 vote_selection = 2;
210                                 vote_string = "yes";
211                         }
212                         else
213                         {
214                                 vote_selection = 1;
215                                 vote_string = "no";
216                         }
217
218                         if (vote_selection)
219                         {
220                                 if (uid2name_dialog)  // handled by "uid2name" option
221                                 {
222                                         vote_active = 0;
223                                         vote_prev = 0;
224                                         vote_change = -9999;
225                                         localcmd(strcat("setreport cl_allow_uid2name ", ftos(vote_selection - 1), "\n"));
226                                         uid2name_dialog = 0;
227                                 }
228                                 else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
229
230                                 return;
231                         }
232                 }
233
234                 default:
235                 {
236                         LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
237                 }
238                 case CMD_REQUEST_USAGE:
239                 {
240                         LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
241                         LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
242                         return;
243                 }
244         }
245 }
246
247 bool QuickMenu_IsOpened();
248 void QuickMenu_Close();
249 bool QuickMenu_Open(string mode, string submenu);
250
251 bool HUD_MinigameMenu_IsOpened();
252 void HUD_MinigameMenu_Close();
253 void HUD_MinigameMenu_Open();
254
255 void HUD_Radar_Show_Maximized(bool doshow, bool clickable);
256
257 void LocalCommand_hud(int request, int argc)
258 {
259         switch (request)
260         {
261                 case CMD_REQUEST_COMMAND:
262                 {
263                         switch (argv(1))
264                         {
265                                 case "configure":
266                                 {
267                                         cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
268                                         return;
269                                 }
270
271                                 case "quickmenu":
272                                 {
273                                         if (argv(2) == "help")
274                                         {
275                                                 LOG_INFO(" quickmenu [[default | file | \"\"] submenu]\n");
276                                                 LOG_INFO("Called without options (or with \"\") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
277                                                 LOG_INFO("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.\n");
278                                                 return;
279                                         }
280                                         if (QuickMenu_IsOpened())
281                                                 QuickMenu_Close();
282                                         else
283                                                 QuickMenu_Open(argv(2), argv(3));  // mode, submenu
284                                         return;
285                                 }
286
287                                 case "minigame":
288                                 {
289                                         if (HUD_MinigameMenu_IsOpened())
290                                                 HUD_MinigameMenu_Close();
291                                         else
292                                                 HUD_MinigameMenu_Open();
293                                         return;
294                                 }
295
296                                 case "save":
297                                 {
298                                         if (argv(2))
299                                         {
300                                                 HUD_Panel_ExportCfg(argv(2));
301                                                 return;
302                                         }
303                                         else
304                                         {
305                                                 break;  // go to usage, we're missing the paramater needed here.
306                                         }
307                                 }
308
309                                 case "scoreboard_columns_set":
310                                 {
311                                         Cmd_HUD_SetFields(argc);
312                                         return;
313                                 }
314
315                                 case "scoreboard_columns_help":
316                                 {
317                                         Cmd_HUD_Help();
318                                         return;
319                                 }
320
321                                 case "radar":
322                                 {
323                                         if (argv(2))
324                                                 HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)), 0);
325                                         else
326                                                 HUD_Radar_Show_Maximized(!hud_panel_radar_maximized, 0);
327                                         return;
328                                 }
329
330                                 case "clickradar":
331                                 {
332                                         HUD_Radar_Show_Maximized(!hud_panel_radar_mouse, 1);
333                                         return;
334                                 }
335                         }
336                 }
337
338                 default:
339                 {
340                         LOG_INFO("Incorrect parameters for ^2hud^7\n");
341                 }
342                 case CMD_REQUEST_USAGE:
343                 {
344                         LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
345                         LOG_INFO("  Where 'action' is the command to complete,\n");
346                         LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
347                         LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
348                         LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
349                         LOG_INFO("  Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
350                         return;
351                 }
352         }
353 }
354
355 void LocalCommand_localprint(int request, int argc)
356 {
357         switch (request)
358         {
359                 case CMD_REQUEST_COMMAND:
360                 {
361                         if (argv(1))
362                         {
363                                 centerprint_hud(argv(1));
364                                 return;
365                         }
366                 }
367
368                 default:
369                 {
370                         LOG_INFO("Incorrect parameters for ^2localprint^7\n");
371                 }
372                 case CMD_REQUEST_USAGE:
373                 {
374                         LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
375                         LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
376                         return;
377                 }
378         }
379 }
380
381 void LocalCommand_mv_download(int request, int argc)
382 {
383         switch (request)
384         {
385                 case CMD_REQUEST_COMMAND:
386                 {
387                         if (argv(1))
388                         {
389                                 Cmd_MapVote_MapDownload(argc);
390                                 return;
391                         }
392                 }
393
394                 default:
395                 {
396                         LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
397                 }
398                 case CMD_REQUEST_USAGE:
399                 {
400                         LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
401                         LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
402                         return;
403                 }
404         }
405 }
406
407 void LocalCommand_find(int request, int argc)
408 {
409         switch (request)
410         {
411                 case CMD_REQUEST_COMMAND:
412                 {
413                         entity client;
414
415                         for (client = world; (client = find(client, classname, argv(1))); )
416                                 LOG_INFO(etos(client), "\n");
417
418                         return;
419                 }
420
421                 default:
422                 {
423                         LOG_INFO("Incorrect parameters for ^2find^7\n");
424                 }
425                 case CMD_REQUEST_USAGE:
426                 {
427                         LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
428                         LOG_INFO("  Where 'classname' is the classname to search for.\n");
429                         return;
430                 }
431         }
432 }
433
434 void LocalCommand_sendcvar(int request, int argc)
435 {
436         switch (request)
437         {
438                 case CMD_REQUEST_COMMAND:
439                 {
440                         if (argv(1))
441                         {
442                                 // W_FixWeaponOrder will trash argv, so save what we need.
443                                 string thiscvar = strzone(argv(1));
444                                 string s = cvar_string(thiscvar);
445
446                                 if (thiscvar == "cl_weaponpriority")
447                                         s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
448                                 else if (substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
449                                         s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
450
451                                 localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
452                                 strunzone(thiscvar);
453                                 return;
454                         }
455                 }
456
457                 default:
458                 {
459                         LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
460                 }
461                 case CMD_REQUEST_USAGE:
462                 {
463                         LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
464                         LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
465                         return;
466                 }
467         }
468 }
469
470 /* use this when creating a new command, making sure to place it in alphabetical order... also,
471 ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
472 void LocalCommand_(int request)
473 {
474     switch(request)
475     {
476         case CMD_REQUEST_COMMAND:
477         {
478
479             return;
480         }
481
482         default:
483         case CMD_REQUEST_USAGE:
484         {
485             print("\nUsage:^3 cl_cmd \n");
486             print("  No arguments required.\n");
487             return;
488         }
489     }
490 }
491 */
492
493
494 // ==================================
495 //  Macro system for client commands
496 // ==================================
497
498 // Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
499 #define CLIENT_COMMANDS(request, arguments) \
500         CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
501         CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
502         CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
503         CLIENT_COMMAND("debugmodel", LocalCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
504         CLIENT_COMMAND("handlevote", LocalCommand_handlevote(request, arguments), "System to handle selecting a vote or option") \
505         CLIENT_COMMAND("hud", LocalCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
506         CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
507         CLIENT_COMMAND("find", LocalCommand_find(request, arguments), "Search through entities for matching classname") \
508         CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
509         CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
510         /* nothing */
511
512 void LocalCommand_macro_help()
513 {
514         #define CLIENT_COMMAND(name, function, description) \
515                 { if (strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
516
517         CLIENT_COMMANDS(0, 0);
518         #undef CLIENT_COMMAND
519 }
520
521 bool LocalCommand_macro_command(int argc)
522 {
523         #define CLIENT_COMMAND(name, function, description) \
524                 { if (name == strtolower(argv(0))) { function; return true; } }
525
526         CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
527         #undef CLIENT_COMMAND
528
529         return false;
530 }
531
532 bool LocalCommand_macro_usage(int argc)
533 {
534         #define CLIENT_COMMAND(name, function, description) \
535                 { if (name == strtolower(argv(1))) { function; return true; } }
536
537         CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
538         #undef CLIENT_COMMAND
539
540         return false;
541 }
542
543 void LocalCommand_macro_write_aliases(int fh)
544 {
545         #define CLIENT_COMMAND(name, function, description) \
546                 { if (strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
547
548         CLIENT_COMMANDS(0, 0);
549         #undef CLIENT_COMMAND
550 }
551
552
553 // =========================================
554 //  Main Function Called By Engine (cl_cmd)
555 // =========================================
556 // If this function exists, client code handles gamecommand instead of the engine code.
557
558 void GameCommand(string command)
559 {
560         int argc = tokenize_console(command);
561
562         // Guide for working with argc arguments by example:
563         // argc:   1    - 2      - 3     - 4
564         // argv:   0    - 1      - 2     - 3
565         // cmd     vote - master - login - password
566         string s = strtolower(argv(0));
567         if (s == "help")
568         {
569                 if (argc == 1)
570                 {
571                         LOG_INFO("\nClient console commands:\n");
572                         LocalCommand_macro_help();
573
574                         LOG_INFO("\nGeneric commands shared by all programs:\n");
575                         GenericCommand_macro_help();
576
577                         LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
578                         LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
579
580                         return;
581                 }
582                 else if (GenericCommand_macro_usage(argc))  // Instead of trying to call a command, we're going to see detailed information about it
583                 {
584                         return;
585                 }
586                 else if (LocalCommand_macro_usage(argc))  // now try for normal commands too
587                 {
588                         return;
589                 }
590         }
591         // continue as usual and scan for normal commands
592         if (GenericCommand(command)                                    // handled by common/command/generic.qc
593             || LocalCommand_macro_command(argc)                        // handled by one of the above LocalCommand_* functions
594             || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
595            ) return;
596
597         // nothing above caught the command, must be invalid
598         LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
599 }
600
601
602 // ===================================
603 //  Macro system for console commands
604 // ===================================
605
606 // These functions are here specifically to add special + - commands to the game, and are not really normal commands.
607 // Please add client commands to the function above this, as this is only for special reasons.
608 #define CONSOLE_COMMANDS_NORMAL() \
609         CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
610         CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
611         CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \
612         CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \
613         /* nothing */
614
615 #define CONSOLE_COMMANDS_MOVEMENT() \
616         CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
617         CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
618         CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
619         CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
620         CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
621         CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
622         CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
623         CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
624         CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
625         CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
626         CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
627         CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
628         CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
629         CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
630         CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
631         CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
632         /* nothing */
633
634 void ConsoleCommand_macro_init()
635 {
636         // first init normal commands
637         #define CONSOLE_COMMAND(name, execution) \
638                 { registercommand(name); }
639
640         CONSOLE_COMMANDS_NORMAL();
641         #undef CONSOLE_COMMAND
642
643         // then init movement commands
644         #ifndef CAMERATEST
645         if (isdemo())
646         {
647         #endif
648         #define CONSOLE_COMMAND(name, execution) \
649                 registercommand(name);
650
651         CONSOLE_COMMANDS_MOVEMENT();
652                 #undef CONSOLE_COMMAND
653         #ifndef CAMERATEST
654 }
655         #endif
656 }
657
658 bool ConsoleCommand_macro_normal(string s, int argc)
659 {
660         #define CONSOLE_COMMAND(name, execution) \
661                 { if (name == s) { { execution } return true; } }
662
663         CONSOLE_COMMANDS_NORMAL();
664         #undef CONSOLE_COMMAND
665
666         return false;
667 }
668
669 bool ConsoleCommand_macro_movement(string s, int argc)
670 {
671         if (camera_active)
672         {
673                 #define CONSOLE_COMMAND(name, execution) \
674                         { if (name == s) { { execution } return true; } }
675
676                 CONSOLE_COMMANDS_MOVEMENT();
677                 #undef CONSOLE_COMMAND
678         }
679
680         return false;
681 }
682
683
684 // ======================================================
685 //  Main Function Called By Engine (registered commands)
686 // ======================================================
687 // Used to parse commands in the console that have been registered with the "registercommand" function
688
689 bool CSQC_ConsoleCommand(string command)
690 {
691         int argc = tokenize_console(command);
692         string s = strtolower(argv(0));
693         // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
694         return ConsoleCommand_macro_normal(s, argc)
695                || ConsoleCommand_macro_movement(s, argc)
696         ;
697 }