]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/gamecommand.qc
first attempt at teamselect dialog... not good yet (need a better way to implement...
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / gamecommand.qc
1 void GameCommand_Init()
2 {
3         // make gg call menu QC theCommands
4         localcmd("alias qc_cmd \"menu_cmd $*\"\n");
5 }
6
7 void GameCommand(string theCommand)
8 {
9         float argc;
10         argc = tokenize(theCommand);
11
12         if(argv(0) == "help" || argc == 0)
13         {
14                 print("Usage: menu_cmd theCommand..., where possible theCommands 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(theCommand))
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                 m_goto(argv(1));
34                 return;
35         }
36
37         print("Invalid theCommand. For a list of supported theCommands, try menu_cmd help.\n");
38 }