MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_SetActiveMenu

Function UI_SetActiveMenu

code/ui/ui_atoms.cpp:66–116  ·  view source on GitHub ↗

================= UI_SetActiveMenu - this should be the ONLY way the menu system is brought up ================= */

Source from the content-addressed store, hash-verified

64=================
65*/
66void 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/*

Callers 7

CL_GenericMenu_fFunction · 0.50
CL_DataPad_fFunction · 0.50
SCR_DrawScreenFieldFunction · 0.50
CL_KeyDownEventFunction · 0.50
CL_DisconnectFunction · 0.50
CL_FrameFunction · 0.50
CL_CgameSystemCallsFunction · 0.50

Calls 10

UI_ForceMenuOffFunction · 0.85
UI_Cursor_ShowFunction · 0.85
Menu_CacheFunction · 0.85
Q_stricmpFunction · 0.85
UI_MainMenuFunction · 0.85
UI_InGameMenuFunction · 0.85
UI_DataPadMenuFunction · 0.85
Menus_CloseAllFunction · 0.70
Menus_ActivateByNameFunction · 0.70
Cvar_SetValueFunction · 0.50

Tested by

no test coverage detected