コード例 #1
0
ファイル: ui_atoms.cpp プロジェクト: AlexXT/OpenJK
/*
=================
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
}
コード例 #2
0
ファイル: ui_init.cpp プロジェクト: kingtiger01/openmohaa-1
void UI_SetCvarInt( const char *cvar, int value )
{
	char s[ 16 ];

	sprintf( s, "%d", value );
	uii.Cvar_Set( cvar, s );
}
コード例 #3
0
ファイル: ui_init.cpp プロジェクト: kingtiger01/openmohaa-1
void UI_SetCvarFloat( const char *cvar, float value )
{
	char s[ 16 ];

	sprintf( s, "%f", value );
	uii.Cvar_Set( cvar, s );
}
コード例 #4
0
ファイル: ui_atoms.cpp プロジェクト: blaenk/jedioutcast
/*
=================
UI_ForceMenuOff
=================
*/
void UI_ForceMenuOff (void)
{
	ui.Key_SetCatcher( ui.Key_GetCatcher() & ~KEYCATCH_UI );
	ui.Key_ClearStates();
	ui.Cvar_Set( "cl_paused", "0" );
}