11.void(
entity me,
int argsbuf) readInputArgs;
19 if (s ==
"") s = me.classname;
20 else s =
strcat(me.classname,
": ", s);
49 if (
argv(0) ==
"help" || argc == 0)
51 LOG_HELP(
"Usage:^3 menu_cmd <command> [<item>], where possible commands are:");
52 LOG_HELP(
" 'sync' reloads all cvars on the current menu page");
53 LOG_HELP(
" 'directmenu' shows the menu window named <item> (or the menu window containing an item named <item>)");
54 LOG_HELP(
" 'closemenu' closes the menu window named <item> (or the menu window containing an item named <item>)");
55 LOG_HELP(
" if <item> is not specified it shows the list of available items in the console");
56 LOG_HELP(
" 'dumptree' dumps the state of the menu as a tree to the console");
57 LOG_HELP(
" 'isdemo' checks if engine is currently running a demo. If given an <item> then 1 / 0 is placed");
58 LOG_HELP(
" in the cvar with that name. Otherwise without an argument the result is printed to console.");
60 LOG_HELP(
"\nGeneric commands shared by all programs:");
68 if (
argv(0) ==
"sync")
74 if (
argv(0) ==
"update_conwidths_before_vid_restart")
80 string argcmd =
argv(0);
82 bool close_mode =
false;
83 if (argcmd ==
"closemenu")
86 argcmd =
"directmenu";
88 else if (argcmd ==
"directpanelhudmenu")
91 argcmd =
"directmenu";
94 if (argcmd ==
"directmenu")
98 LOG_HELP(
"Available items (* = closable):");
101 if (it.classname ==
"vtbl") continue;
105 if (!startsWith(s, filter)) continue;
106 s = substring(s, strlen(filter), strlen(s) - strlen(filter));
108 if (it.instanceOfContainer && it.closable)
114 else if (argc == 2 && !close_mode && (!
isdemo() ||
argv(1) ==
"Welcome"))
119 else if(argc > 2 && (!
isdemo() ||
argv(1) ==
"Welcome"))
124 for(
int i = 0; (e =
nextent(e)); )
125 if(e.classname !=
"vtbl" && e.name ==
strcat(filter, s))
131 for(i = 2; i < argc; ++i)
132 bufstr_add(argsbuf,
argv(i), 1);
133 e.readInputArgs(e, argsbuf);
143 if (e.instanceOfContainer && e.closable && e.focused)
154 case "nexposee":
m_goto(
"nexposee",
false);
return;
155 case "servers":
m_goto(
"servers",
false);
return;
156 case "profile":
m_goto(
"profile",
false);
return;
157 case "skinselect":
m_goto(
"skinselector",
false);
return;
158 case "languageselect":
m_goto(
"languageselector",
false);
return;
159 case "settings":
m_goto(
"settings",
false);
return;
160 case "inputsettings":
m_goto(
"inputsettings",
false);
return;
161 case "videosettings":
m_goto(
"videosettings",
false);
return;
164 if (
argv(0) ==
"dumptree")
171 if (
argv(0) ==
"isdemo")
181 print(sprintf(
"%d\n", value));
190 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)