================= UI_SetActiveMenu - this should be the ONLY way the menu system is brought up ================= */
| 64 | ================= |
| 65 | */ |
| 66 | void UI_SetActiveMenu( const char* menuname,const char *menuID ) |
| 67 | { |
| 68 | // this should be the ONLY way the menu system is brought up (besides the UI_ConsoleCommand below) |
| 69 | |
| 70 | if (cls.state != CA_DISCONNECTED && !ui.SG_GameAllowedToSaveHere(qtrue)) //don't check full sytem, only if incamera |
| 71 | { |
| 72 | return; |
| 73 | } |
| 74 | |
| 75 | if ( !menuname ) { |
| 76 | UI_ForceMenuOff(); |
| 77 | return; |
| 78 | } |
| 79 | |
| 80 | //make sure force-speed and slowmodeath doesn't slow down menus - NOTE: they should reset the timescale when the game un-pauses |
| 81 | Cvar_SetValue( "timescale", 1.0f ); |
| 82 | |
| 83 | UI_Cursor_Show(qtrue); |
| 84 | |
| 85 | // enusure minumum menu data is cached |
| 86 | Menu_Cache(); |
| 87 | |
| 88 | if ( Q_stricmp (menuname, "mainMenu") == 0 ) |
| 89 | { |
| 90 | UI_MainMenu(); |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | if ( Q_stricmp (menuname, "ingame") == 0 ) |
| 95 | { |
| 96 | ui.Cvar_Set( "cl_paused", "1" ); |
| 97 | UI_InGameMenu(menuID); |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | if ( Q_stricmp (menuname, "datapad") == 0 ) |
| 102 | { |
| 103 | ui.Cvar_Set( "cl_paused", "1" ); |
| 104 | UI_DataPadMenu(); |
| 105 | return; |
| 106 | } |
| 107 | #ifndef JK2_MODE |
| 108 | if ( Q_stricmp (menuname, "missionfailed_menu") == 0 ) |
| 109 | { |
| 110 | Menus_CloseAll(); |
| 111 | Menus_ActivateByName("missionfailed_menu"); |
| 112 | ui.Key_SetCatcher( KEYCATCH_UI ); |
| 113 | return; |
| 114 | } |
| 115 | #endif |
| 116 | } |
| 117 | |
| 118 | |
| 119 | /* |
no test coverage detected