X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fcommand%2Fmenu_cmd.qc;h=93825cd56098d73e2ebe53aa0aee97041fcaf03c;hb=bb80a6aba067167c6ef8d5f3465f03bd34142fa2;hp=f6312931f6a11c4117c159433c2361c949ec22c0;hpb=2c5bebce47736537b1a2311fb52db41a481f27f1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/command/menu_cmd.qc b/qcsrc/menu/command/menu_cmd.qc index f6312931f..93825cd56 100644 --- a/qcsrc/menu/command/menu_cmd.qc +++ b/qcsrc/menu/command/menu_cmd.qc @@ -1,3 +1,7 @@ +#include "menu_cmd.qh" + +#include "../../common/command/generic.qh" + string _dumptree_space; void _dumptree_open(entity pass, entity me) { @@ -35,7 +39,10 @@ void GameCommand(string theCommand) print(_("Usage: menu_cmd command..., where possible commands are:\n")); print(_(" sync - reloads all cvars on the current menu page\n")); print(_(" directmenu ITEM - select a menu item as main item\n")); - GenericCommand("help"); + + print("\nGeneric commands shared by all programs:\n"); + GenericCommand_macro_help(); + return; } @@ -48,18 +55,46 @@ void GameCommand(string theCommand) return; } - if(argv(0) == "directmenu") if(argc == 2) + if(argv(0) == "update_conwidths_before_vid_restart") { - // switch to a menu item - if(!isdemo()) // don't allow this command in demos - m_goto(argv(1)); + updateConwidths(cvar("vid_width"), cvar("vid_height"), cvar("vid_pixelheight")); return; } - if(argv(0) == "directpanelhudmenu") + if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu") { - // switch to a menu item - m_goto(strcat("HUD", argv(1))); + string filter = string_null; + if(argv(0) == "directpanelhudmenu") + filter = strzone("HUD"); + + if(argc == 1) + { + print(_("Available options:\n")); + float i; + entity e; + string s; + + for(i = 0, e = world; (e = nextent(e)); ) + if(e.classname != "vtbl" && e.name != "") + { + s = e.name; + if(filter) + { + if(substring(s, 0, strlen(filter)) != filter) + continue; + s = substring(s, strlen(filter), strlen(s) - strlen(filter)); + } + print(strcat(" ", s ,"\n")); + ++i; + } + } + else if(argc == 2 && !isdemo()) // don't allow this command in demos + { + m_play_click_sound(MENU_SOUND_OPEN); + m_goto(strcat(filter, argv(1))); // switch to a menu item + } + if(filter) + strunzone(filter); return; } @@ -88,9 +123,5 @@ void GameCommand(string theCommand) return; } - if(argv(0) == "curl") - { - } - print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n")); }