+#include "menu_cmd.qh"
+
+#include "../../common/command/generic.qh"
+
string _dumptree_space;
void _dumptree_open(entity pass, entity me)
{
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_goto(strcat(filter, argv(1))); // switch to a menu item
+ if(filter)
+ strunzone(filter);
return;
}
return;
}
- if(argv(0) == "curl")
- {
- }
-
print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
}