alias menu_showquitdialog "menu_cmd directmenu Quit"
alias menu_showgamemenudialog "menu_cmd directmenu GameMenu"
alias menu_showmonstertools "menu_cmd directmenu MonsterTools"
+alias menu_isdemo "menu_cmd isdemo ${* ?}"
// command executed before loading a map by the menu
// makes sure maxplayers is at least minplayers or minplayers_per_team * 4 or bot_number + 1
LOG_HELP(" 'closemenu' closes the menu window named <item> (or the menu window containing an item named <item>)");
LOG_HELP(" if <item> is not specified it shows the list of available items in the console");
LOG_HELP(" 'dumptree' dumps the state of the menu as a tree to the console");
+ LOG_HELP(" 'isdemo' checks if engine is currently running a demo. If given an <item> then 1 / 0 is placed");
+ LOG_HELP(" in a cvar with that name. Otherwise _menu_isdemo cvar is written to.");
LOG_HELP("\nGeneric commands shared by all programs:");
GenericCommand_macro_help();
return;
}
- string cmd = argv(0);
+ string argcmd = argv(0);
string filter = string_null;
bool close_mode = false;
- if (cmd == "closemenu")
+ if (argcmd == "closemenu")
{
close_mode = true;
- cmd = "directmenu";
+ argcmd = "directmenu";
}
- else if (cmd == "directpanelhudmenu")
+ else if (argcmd == "directpanelhudmenu")
{
filter = "HUD";
- cmd = "directmenu";
+ argcmd = "directmenu";
}
- if (cmd == "directmenu")
+ if (argcmd == "directmenu")
{
if (argc == 1)
{
return;
}
+ if (argv(0) == "isdemo")
+ {
+ if (isdemo())
+ {
+ if (argv(1) != "")
+ cvar_set(argv(1), "1");
+ else
+ localcmd("\nset _menu_isdemo 1\n");
+ }
+ else
+ {
+ if (argv(1) != "")
+ cvar_set(argv(1), "0");
+ else
+ localcmd("\nset _menu_isdemo 0\n");
+ }
+ return;
+ }
+
if(MUTATOR_CALLHOOK(Menu_ConsoleCommand, ss, argc, theCommand)) // handled by a mutator
return;