]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/gamecommand.qc
fix broken teamselect in scmenu (no idea why it was broken, though, it once worked)
[divverent/nexuiz.git] / data / qcsrc / menu / 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                 for(self = null_entity; (self = nextent(self)); )
27                         Raise_DataEvent(self, ITEM_DATA_SYNC);
28                 /*
29                 for(self = null_entity; (self = findstring(self, type, "Item_Data_Cvar")); )
30                         Raise_DataEvent(self, ITEM_DATA_SYNC);
31                 for(self = null_entity; (self = findstring(self, type, "Item_Data_ServerCvar")); )
32                         Raise_DataEvent(self, ITEM_DATA_SYNC);
33                 */
34                 return;
35         }
36
37         if(argv(0) == "directmenu") if(argc == 2)
38         {
39                 entity newitem;
40                 cvar_set("scmenu_directmenu", argv(1));
41                 m_display();
42                 return;
43         }
44
45         print("Invalid command. For a list of supported commands, try menu_cmd help.\n");
46 }