1 string _dumptree_space;
2 void _dumptree_open(entity pass, entity me)
9 s = strcat(me.classname, ": ", s);
10 print(_dumptree_space, etos(me), " (", s, ")");
14 _dumptree_space = strcat(_dumptree_space, " ");
19 void _dumptree_close(entity pass, entity me)
23 _dumptree_space = substring(_dumptree_space, 0, strlen(_dumptree_space) - 2);
24 print(_dumptree_space, "}\n");
28 void GameCommand(string theCommand)
31 argc = tokenize_console(theCommand);
33 if(argv(0) == "help" || argc == 0)
35 print(_("Usage: menu_cmd command..., where possible commands are:\n"));
36 print(_(" sync - reloads all cvars on the current menu page\n"));
37 print(_(" directmenu ITEM - select a menu item as main item\n"));
38 GenericCommand("help");
42 if(GenericCommand(theCommand))
51 if(argv(0) == "directmenu") if(argc == 2)
53 // switch to a menu item
54 if(!isdemo()) // don't allow this command in demos
59 if(argv(0) == "directpanelhudmenu")
61 // switch to a menu item
62 m_goto(strcat("HUD", argv(1)));
66 if(argv(0) == "skinselect")
68 m_goto_skin_selector();
72 if(argv(0) == "languageselect")
74 m_goto_language_selector();
78 if(argv(0) == "videosettings")
80 m_goto_video_settings();
84 if(argv(0) == "dumptree")
87 depthfirst(main, parent, firstChild, nextSibling, _dumptree_open, _dumptree_close, NULL);
95 print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));