]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/gamecommand.qc
Morphed's graphics; checkbox, radiobutton
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / gamecommand.qc
1 void GameCommand_Init()
2 {
3         // make gg call menu QC commands
4         localcmd("alias qc_cmd \"menu_cmd $*\"\n");
5 }
6
7 void GameCommand(string command)
8 {
9         float argc;
10         argc = tokenize(command);
11
12         if(argv(0) == "help" || argc == 0)
13         {
14                 print("Usage: menu_cmd COMMAND..., where possible commands are:\n");
15                 print("  sync - reloads all cvars on the current menu page\n");
16                 print("  directmenu ITEM - select a menu item as main item\n");
17                 GameCommand_Generic("help");
18                 return;
19         }
20
21         if(GameCommand_Generic(command))
22                 return;
23
24         if(argv(0) == "sync")
25         {
26                 // make changes in cvars known to the system
27                 return;
28         }
29
30         if(argv(0) == "directmenu") if(argc == 2)
31         {
32                 // switch to a menu item
33                 return;
34         }
35
36         print("Invalid command. For a list of supported commands, try menu_cmd help.\n");
37 }