/* ================= UI_SetActiveMenu - this should be the ONLY way the menu system is brought up ================= */ void UI_SetActiveMenu( const char* menuname,const char *menuID ) { // this should be the ONLY way the menu system is brought up (besides the UI_ConsoleCommand below) if (cls.state != CA_DISCONNECTED && !ui.SG_GameAllowedToSaveHere(qtrue)) //don't check full sytem, only if incamera { return; } if ( !menuname ) { UI_ForceMenuOff(); return; } //make sure force-speed and slowmodeath doesn't slow down menus - NOTE: they should reset the timescale when the game un-pauses Cvar_SetValue( "timescale", 1.0f ); UI_Cursor_Show(qtrue); // enusure minumum menu data is cached Menu_Cache(); if ( Q_stricmp (menuname, "mainMenu") == 0 ) { UI_MainMenu(); return; } if ( Q_stricmp (menuname, "ingame") == 0 ) { ui.Cvar_Set( "cl_paused", "1" ); UI_InGameMenu(menuID); return; } if ( Q_stricmp (menuname, "datapad") == 0 ) { ui.Cvar_Set( "cl_paused", "1" ); UI_DataPadMenu(); return; } #ifndef JK2_MODE if ( Q_stricmp (menuname, "missionfailed_menu") == 0 ) { Menus_CloseAll(); Menus_ActivateByName("missionfailed_menu"); ui.Key_SetCatcher( KEYCATCH_UI ); return; } #endif }
qboolean UI_ConsoleCommand( void ) { char *cmd; if (!ui.SG_GameAllowedToSaveHere(qtrue)) //only check if incamera { return qfalse; } cmd = UI_Argv( 0 ); // ensure minimum menu data is available Menu_Cache(); if ( Q_stricmp (cmd, "ui_cache") == 0 ) { UI_Cache_f(); return qtrue; } if ( Q_stricmp (cmd, "levelselect") == 0 ) { UI_LoadMenu_f(); return qtrue; } if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) { UI_SaveMenu_f(); return qtrue; } if ( Q_stricmp (cmd, "ui_report") == 0 ) { UI_Report(); return qtrue; } #ifndef JK2_MODE if ( Q_stricmp (cmd, "ui_load") == 0 ) { UI_Load(); return qtrue; } #endif return qfalse; }