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"));
39 print("\nGeneric commands shared by all programs:\n");
40 GenericCommand_macro_help();
45 if(GenericCommand(theCommand))
54 if(argv(0) == "update_conwidths_before_vid_restart")
56 updateConwidths(cvar("vid_width"), cvar("vid_height"), cvar("vid_pixelheight"));
60 if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
62 string filter = string_null;
63 if(argv(0) == "directpanelhudmenu")
64 filter = strzone("HUD");
68 print(_("Available options:\n"));
73 for(i = 0, e = world; (e = nextent(e)); )
74 if(e.classname != "vtbl" && e.name != "")
79 if(substring(s, 0, strlen(filter)) != filter)
81 s = substring(s, strlen(filter), strlen(s) - strlen(filter));
83 print(strcat(" ", s ,"\n"));
87 else if(argc == 2 && !isdemo()) // don't allow this command in demos
88 m_goto(strcat(filter, argv(1))); // switch to a menu item
94 if(argv(0) == "skinselect")
96 m_goto("skinselector");
100 if(argv(0) == "languageselect")
102 m_goto("languageselector");
106 if(argv(0) == "videosettings")
108 m_goto("videosettings");
112 if(argv(0) == "dumptree")
114 _dumptree_space = "";
115 depthfirst(main, parent, firstChild, nextSibling, _dumptree_open, _dumptree_close, NULL);
119 print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));