11.void(
entity me,
int argsbuf) readInputArgs;
17 string s = me.toString(me);
18 if (s ==
"") s = me.classname;
19 else s =
strcat(me.classname,
": ", s);
48 if (
argv(0) ==
"help" || argc == 0)
50 LOG_HELP(
"Usage:^3 menu_cmd <command> [<item>], where possible commands are:");
51 LOG_HELP(
" 'sync' reloads all cvars on the current menu page");
52 LOG_HELP(
" 'directmenu' shows the menu window named <item> (or the menu window containing an item named <item>)");
53 LOG_HELP(
" 'closemenu' closes the menu window named <item> (or the menu window containing an item named <item>)");
54 LOG_HELP(
" if <item> is not specified it shows the list of available items in the console");
55 LOG_HELP(
" 'dumptree' dumps the state of the menu as a tree to the console");
56 LOG_HELP(
" 'isdemo' checks if engine is currently running a demo. If given an <item> then 1 / 0 is placed");
57 LOG_HELP(
" in the cvar with that name. Otherwise without an argument the result is printed to console.");
59 LOG_HELP(
"\nGeneric commands shared by all programs:");
67 if (
argv(0) ==
"sync")
73 if (
argv(0) ==
"update_conwidths_before_vid_restart")
79 string argcmd =
argv(0);
81 bool close_mode =
false;
82 if (argcmd ==
"closemenu")
85 argcmd =
"directmenu";
87 else if (argcmd ==
"directpanelhudmenu")
90 argcmd =
"directmenu";
93 if (argcmd ==
"directmenu")
97 LOG_HELP(
"Available items (* = closable):");
100 if (it.classname ==
"vtbl") continue;
104 if (!startsWith(s, filter)) continue;
105 s = substring(s, strlen(filter), strlen(s) - strlen(filter));
107 if (it.instanceOfContainer && it.closable)
113 else if (argc == 2 && !close_mode && (!
isdemo() ||
argv(1) ==
"Welcome"))
118 else if(argc > 2 && (!
isdemo() ||
argv(1) ==
"Welcome"))
123 for(
int i = 0; (e =
nextent(e)); )
124 if(e.classname !=
"vtbl" && e.name ==
strcat(filter, s))
130 for(i = 2; i < argc; ++i)
131 bufstr_add(argsbuf,
argv(i), 1);
132 e.readInputArgs(e, argsbuf);
142 if (e.instanceOfContainer && e.closable && e.focused)
153 case "nexposee":
m_goto(
"nexposee",
false);
return;
154 case "servers":
m_goto(
"servers",
false);
return;
155 case "profile":
m_goto(
"profile",
false);
return;
156 case "skinselect":
m_goto(
"skinselector",
false);
return;
157 case "languageselect":
m_goto(
"languageselector",
false);
return;
158 case "settings":
m_goto(
"settings",
false);
return;
159 case "inputsettings":
m_goto(
"inputsettings",
false);
return;
160 case "videosettings":
m_goto(
"videosettings",
false);
return;
163 if (
argv(0) ==
"dumptree")
170 if (
argv(0) ==
"isdemo")
180 print(sprintf(
"%d\n", value));
189 LOG_INFO(
"Invalid command. For a list of supported commands, try menu_cmd help.");
#define MUTATOR_CALLHOOK(id,...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void depthfirst(entity start,.entity up,.entity downleft,.entity right, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
string strtolower(string s)
#define pass(name, colormin, colormax)
void GenericCommand_macro_help()
float GenericCommand(string command)
#define FOREACH_ENTITY_ORDERED(cond, body)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
if(frag_attacker.flagcarried)