/* ================= 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 }
/* ================= UI_ForceMenuOff ================= */ void UI_ForceMenuOff (void) { ui.Key_SetCatcher( ui.Key_GetCatcher() & ~KEYCATCH_UI ); ui.Key_ClearStates(); ui.Cvar_Set( "cl_paused", "0" ); }