Exemplo n.º 1
0
/*
* CG_SC_MenuCustom
*/
static void CG_SC_MenuCustom( void )
{
	char request[MAX_STRING_CHARS];
	int i, c;

	if( cgs.demoPlaying || cgs.tv )
		return;

	if( trap_Cmd_Argc() < 2 )
		return;

	Q_strncpyz( request, va( "menu_open custom title \"%s\" ", trap_Cmd_Argv( 1 ) ), sizeof( request ) );
	
	for( i = 2, c = 1; i < trap_Cmd_Argc() - 1; i += 2, c++ )
	{
		Q_strncatz( request, va( "btn%i \"%s\" ", c, trap_Cmd_Argv( i ) ), sizeof( request ) );
		Q_strncatz( request, va( "cmd%i \"%s\" ", c, trap_Cmd_Argv( i + 1 ) ), sizeof( request ) );
	}

	trap_Cmd_ExecuteText( EXEC_APPEND, va( "%s\n", request ) );
}
Exemplo n.º 2
0
/*
=================
Main_MenuEvent
=================
*/
void Main_MenuEvent (void* ptr, int event) {
	if( event != QM_ACTIVATED ) {
		return;
	}

	switch( ((menucommon_s*)ptr)->id ) {
	case ID_SINGLEPLAYER:
		UI_SPLevelMenu();
		break;

	case ID_MULTIPLAYER:
		UI_ArenaServersMenu();
		break;

	case ID_SETUP:
		UI_SetupMenu();
		break;

	case ID_DEMOS:
		UI_DemosMenu();
		break;

	case ID_CINEMATICS:
		UI_CinematicsMenu();
		break;

	case ID_MODS:
		UI_ModsMenu();
		break;

	case ID_TEAMARENA:
		trap_Cvar_Set( "fs_game", "missionpack");
		trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
		break;

	case ID_EXIT:
		UI_ConfirmMenu( "EXIT GAME?", 0, MainMenu_ExitAction );
		break;
	}
}
Exemplo n.º 3
0
/*
* CG_UseItem
*/
void CG_UseItem( const char *name )
{
	gsitem_t *item;

	if( !cg.frame.valid || cgs.demoPlaying )
		return;

	if( !name )
		return;

	item = GS_Cmd_UseItem( &cg.frame.playerState, name, 0 );
	if( item )
	{
		if( item->type & IT_WEAPON )
		{
			CG_Predict_ChangeWeapon( item->tag );
			cg.lastWeapon = cg.predictedPlayerState.stats[STAT_PENDING_WEAPON];
		}

		trap_Cmd_ExecuteText( EXEC_NOW, va( "cmd use %i", item->tag ) );
	}
}
Exemplo n.º 4
0
/*
===============
UI_TeamOrdersMenu_ListEvent
===============
*/
static void UI_TeamOrdersMenu_ListEvent(void *ptr, int event)
{
	int		id;
	int		selection;
	char	message[256];

	if (event != QM_ACTIVATED)
		return;

	id = ((menulist_s *)ptr)->generic.id;
	selection = ((menulist_s *)ptr)->curvalue;

	if (id == ID_LIST_BOTS)
	{
		teamOrdersMenuInfo.selectedBot = selection;
		if (teamOrdersMenuInfo.gametype == GT_CTF || teamOrdersMenuInfo.gametype == GT_INVASION)
		{
			UI_TeamOrdersMenu_SetList(ID_LIST_CTF_ORDERS);
		}
		else
		{
			UI_TeamOrdersMenu_SetList(ID_LIST_TEAM_ORDERS);
		}
		return;
	}

	if (id == ID_LIST_CTF_ORDERS)
	{
		Com_sprintf(message, sizeof(message), ctfMessages[selection], teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.selectedBot]);
	}
	else
	{
		Com_sprintf(message, sizeof(message), teamMessages[selection], teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.selectedBot]);
	}

	trap_Cmd_ExecuteText(EXEC_APPEND, va("say_team \"%s\"\n", message));
	UI_PopMenu();
}
Exemplo n.º 5
0
/*
=================
SpecifyPassword_Event
=================
*/
static void SpecifyPassword_Event( void* ptr, int event ) 
{
	switch (((menucommon_s*)ptr)->id)
	{
		case ID_SPECIFYPASSWORDGO:
			if (event != QM_ACTIVATED)
				break;

			if (s_specifypassword.password.field.buffer[0])
			{
				trap_Cvar_Set("password",s_specifypassword.password.field.buffer);
				trap_Cmd_ExecuteText( EXEC_APPEND, s_specifypassword.connectstring );
			}
			break;

		case ID_SPECIFYPASSWORDBACK:
			if (event != QM_ACTIVATED)
				break;

			UI_PopMenu();
			break;
	}
}
Exemplo n.º 6
0
static void SoundQualityAction( qboolean result ) 
{
	if ( result ) 
	{
		soundOptionsInfo.holdSoundQuality = soundOptionsInfo.quality.curvalue; 
		if( soundOptionsInfo.quality.curvalue ) 
		{
			trap_Cvar_SetValue( "s_khz", 22 );
//			trap_Cvar_SetValue( "s_compression", 0 );
		}
		else 
		{
			trap_Cvar_SetValue( "s_khz", 11 );
//			trap_Cvar_SetValue( "s_compression", 1 );
		}
		//UI_ForceMenuOff();
		trap_Cmd_ExecuteText( EXEC_APPEND, "snd_restart\n" );
	}
	else
	{
		soundOptionsInfo.quality.curvalue =	soundOptionsInfo.holdSoundQuality; 
	}
}
Exemplo n.º 7
0
/*
=================
Controls_SetConfig
=================
*/
static void Controls_SetConfig(void)
{
	int		i;
	bind_t*	bindptr;

	// set the bindings from the local store
	bindptr = g_bindings;

	// iterate each command, get its numeric binding
	for (i=0;;i++,bindptr++)
	{
		if (!bindptr->label)
			break;

		if (bindptr->bind1 != -1)
		{
			trap_Key_SetBinding(bindptr->bind1, bindptr->command);

			if (bindptr->bind2 != -1)
				trap_Key_SetBinding(bindptr->bind2, bindptr->command);
		}
	}

	if (s_controls.invertmouse.curvalue)
		trap_Cvar_SetValue("m_pitch", -fabs(trap_Cvar_VariableValue("m_pitch")));
	else
		trap_Cvar_SetValue("m_pitch", fabs(trap_Cvar_VariableValue("m_pitch")));

	trap_Cvar_SetValue("m_filter", s_controls.smoothmouse.curvalue);
	trap_Cvar_SetValue("cl_run", s_controls.alwaysrun.curvalue);
	trap_Cvar_SetValue("cg_autoswitch", s_controls.autoswitch.curvalue);
	trap_Cvar_SetValue("sensitivity", s_controls.sensitivity.curvalue);
	trap_Cvar_SetValue("in_joystick", s_controls.joyenable.curvalue);
	trap_Cvar_SetValue("joy_threshold", s_controls.joythreshold.curvalue);
	trap_Cvar_SetValue("cl_freelook", s_controls.freelook.curvalue);
	trap_Cmd_ExecuteText(EXEC_APPEND, "in_restart\n");
}
Exemplo n.º 8
0
/*
===============
LoadConfig_MenuEvent
===============
*/
static void LoadConfig_MenuEvent( void *ptr, int event ) {
	if( event != QM_ACTIVATED ) {
		return;
	}

	switch ( ((menucommon_s*)ptr)->id ) {
	case ID_GO:
		trap_Cmd_ExecuteText( EXEC_APPEND, va( "exec %s\n", s_configs.list.itemnames[s_configs.list.curvalue] ) );
		UI_PopMenu();
		break;

	case ID_BACK:
		UI_PopMenu();
		break;

	case ID_LEFT:
		ScrollList_Key( &s_configs.list, K_LEFTARROW );
		break;

	case ID_RIGHT:
		ScrollList_Key( &s_configs.list, K_RIGHTARROW );
		break;
	}
}
Exemplo n.º 9
0
/*
* G_Match_Autorecord_Start
*/
void G_Match_Autorecord_Start( void )
{
	int team, i, playerCount;

	G_Match_SetAutorecordState( "start" );

	// do not start autorecording if all playing clients are bots
	for( playerCount = 0, team = TEAM_PLAYERS; team < GS_MAX_TEAMS; team++ )
	{
		// add our team info to the string
		for( i = 0; i < teamlist[team].numplayers; i++ )
		{
			if( game.edicts[ teamlist[team].playerIndices[i] ].r.svflags & SVF_FAKECLIENT )
				continue;

			playerCount++;
			break; // we only need one for this check
		}
	}

	if( playerCount && g_autorecord->integer )
	{
		char datetime[17], players[MAX_STRING_CHARS];
		time_t long_time;
		struct tm *newtime;

		// date & time
		time( &long_time );
		newtime = localtime( &long_time );

		Q_snprintfz( datetime, sizeof( datetime ), "%04d-%02d-%02d_%02d-%02d", newtime->tm_year + 1900,
			newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min );

		// list of players
		Q_strncpyz( players, trap_GetConfigString( CS_MATCHNAME ), sizeof( players ) );
		if( players[0] == '\0' )
		{
			if( GS_InvidualGameType() )
			{
				const char *netname;
				int team;
				edict_t *ent;

				for( team = TEAM_ALPHA; team < GS_MAX_TEAMS; team++ )
				{
					if( !teamlist[team].numplayers )
						continue;
					ent = game.edicts + teamlist[team].playerIndices[0];
					netname = ent->r.client->netname;
					Q_strncatz( players, netname, sizeof( players ) );
					if( team != GS_MAX_TEAMS - 1 )
						Q_strncatz( players, " vs ", sizeof( players ) );
				}
			}
		}

		if( players[0] != '\0' )
		{
			char *t = strstr( players, " vs " );
			if( t )
				memcpy( t, "_vs_", strlen( "_vs_" ) );
			Q_strncpyz( players, COM_RemoveJunkChars( COM_RemoveColorTokens( players ) ), sizeof( players ) );
		}

		// combine
		Q_snprintfz( level.autorecord_name, sizeof( level.autorecord_name ), "%s_%s_%s%s%s_auto%04i", 
			datetime, gs.gametypeName, level.mapname, players[0] == '\0' ? "" : "_", players, (int)brandom( 1, 9999 ) );

		trap_Cmd_ExecuteText( EXEC_APPEND, va( "serverrecord %s\n", level.autorecord_name ) );
	}
}
Exemplo n.º 10
0
/*
=================
Menu_DefaultKey
=================
*/
sfxHandle_t Menu_DefaultKey( menuframework_s *m, int key )
{
	sfxHandle_t		sound = 0;
	menucommon_s	*item;
	int				cursor_prev;

	// menu system keys
	switch ( key )
	{
		case K_JOY_B:
		case K_2JOY_B:
		case K_3JOY_B:
		case K_4JOY_B:
#ifndef TA_MISC // MENU: Right Mouse button = left arrow
		case K_MOUSE2:
#endif
		case K_ESCAPE:
#ifdef IOQ3ZTM
			if (uis.activemenu->noEscape)
			{
				return sound;
			}
			else
			{
#endif
			UI_PopMenu();
			return menu_out_sound;
#ifdef IOQ3ZTM
			}
#endif
	}

	if (!m || !m->nitems)
		return 0;

	// route key stimulus to widget
	item = Menu_ItemAtCursor( m );
	if (item && !(item->flags & (QMF_GRAYED|QMF_INACTIVE)))
	{
		switch (item->type)
		{
			case MTYPE_SPINCONTROL:
				sound = SpinControl_Key( (menulist_s*)item, key );
				break;

			case MTYPE_RADIOBUTTON:
				sound = RadioButton_Key( (menuradiobutton_s*)item, key );
				break;

			case MTYPE_SLIDER:
				sound = Slider_Key( (menuslider_s*)item, key );
				break;

			case MTYPE_SCROLLLIST:
				sound = ScrollList_Key( (menulist_s*)item, key );
				break;

			case MTYPE_FIELD:
				sound = MenuField_Key( (menufield_s*)item, &key );
				break;
		}

		if (sound) {
			// key was handled
			return sound;		
		}
	}

	// default handling
	switch ( key )
	{
		case K_F11:
			if ( trap_Cvar_VariableValue( "developer" ) ) {
				uis.debug ^= 1;
			}
			break;

		case K_F12:
			if ( trap_Cvar_VariableValue( "developer" ) ) {
				trap_Cmd_ExecuteText( EXEC_APPEND, "screenshot\n" );
			}
			break;

		case K_JOY_DPAD_UP:
		case K_JOY_LEFTSTICK_UP:
		case K_2JOY_DPAD_UP:
		case K_2JOY_LEFTSTICK_UP:
		case K_3JOY_DPAD_UP:
		case K_3JOY_LEFTSTICK_UP:
		case K_4JOY_DPAD_UP:
		case K_4JOY_LEFTSTICK_UP:
		case K_KP_UPARROW:
		case K_UPARROW:
			cursor_prev    = m->cursor;
			m->cursor_prev = m->cursor;
			m->cursor--;
			Menu_AdjustCursor( m, -1 );
			if ( cursor_prev != m->cursor ) {
				Menu_CursorMoved( m );
				sound = menu_move_sound;
			}
			break;

		case K_TAB:
		case K_JOY_DPAD_DOWN:
		case K_JOY_LEFTSTICK_DOWN:
		case K_2JOY_DPAD_DOWN:
		case K_2JOY_LEFTSTICK_DOWN:
		case K_3JOY_DPAD_DOWN:
		case K_3JOY_LEFTSTICK_DOWN:
		case K_4JOY_DPAD_DOWN:
		case K_4JOY_LEFTSTICK_DOWN:
		case K_KP_DOWNARROW:
		case K_DOWNARROW:
			cursor_prev    = m->cursor;
			m->cursor_prev = m->cursor;
			m->cursor++;
			Menu_AdjustCursor( m, 1 );
			if ( cursor_prev != m->cursor ) {
				Menu_CursorMoved( m );
				sound = menu_move_sound;
			}
			break;

		case K_MOUSE1:
		case K_MOUSE3:
			if (item)
				if ((item->flags & QMF_HASMOUSEFOCUS) && !(item->flags & (QMF_GRAYED|QMF_INACTIVE)))
					return (Menu_ActivateItem( m, item ));
			break;

		case K_JOY_A:
		case K_2JOY_A:
		case K_3JOY_A:
		case K_4JOY_A:
		case K_AUX1:
		case K_AUX2:
		case K_AUX3:
		case K_AUX4:
		case K_AUX5:
		case K_AUX6:
		case K_AUX7:
		case K_AUX8:
		case K_AUX9:
		case K_AUX10:
		case K_AUX11:
		case K_AUX12:
		case K_AUX13:
		case K_AUX14:
		case K_AUX15:
		case K_AUX16:
		case K_KP_ENTER:
		case K_ENTER:
			if (item)
				if (!(item->flags & (QMF_MOUSEONLY|QMF_GRAYED|QMF_INACTIVE)))
					return (Menu_ActivateItem( m, item ));
			break;
	}

	return sound;
}
Exemplo n.º 11
0
/*
=================
GraphicsOptions_ApplyChanges
=================
*/
static void GraphicsOptions_ApplyChanges(void *unused, int notification)
{
	if (notification != QM_ACTIVATED)
		return;

	switch (s_graphicsoptions.texturebits.curvalue)
	{
	case 0:
		trap_Cvar_SetValue("r_texturebits", 0);
		break;
	case 1:
		trap_Cvar_SetValue("r_texturebits", 16);
		break;
	case 2:
		trap_Cvar_SetValue("r_texturebits", 32);
		break;
	}
	trap_Cvar_SetValue("r_picmip", 3 - s_graphicsoptions.tq.curvalue);
	trap_Cvar_SetValue("r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue);
	trap_Cvar_SetValue("r_mode", s_graphicsoptions.mode.curvalue);
	trap_Cvar_SetValue("r_fullscreen", s_graphicsoptions.fs.curvalue);
	trap_Cvar_Set("r_glDriver", (char *) s_drivers[s_graphicsoptions.driver.curvalue]);
	switch (s_graphicsoptions.colordepth.curvalue)
	{
	case 0:
		trap_Cvar_SetValue("r_colorbits", 0);
		trap_Cvar_SetValue("r_depthbits", 0);
		trap_Cvar_SetValue("r_stencilbits", 0);
		break;
	case 1:
		trap_Cvar_SetValue("r_colorbits", 16);
		trap_Cvar_SetValue("r_depthbits", 16);
		trap_Cvar_SetValue("r_stencilbits", 0);
		break;
	case 2:
		trap_Cvar_SetValue("r_colorbits", 32);
		trap_Cvar_SetValue("r_depthbits", 24);
		break;
	}
	trap_Cvar_SetValue("r_vertexLight", s_graphicsoptions.lighting.curvalue);

	if (s_graphicsoptions.geometry.curvalue == 2)
	{
		trap_Cvar_SetValue("r_lodBias", 0);
		trap_Cvar_SetValue("r_subdivisions", 4);
	}
	else if (s_graphicsoptions.geometry.curvalue == 1)
	{
		trap_Cvar_SetValue("r_lodBias", 1);
		trap_Cvar_SetValue("r_subdivisions", 12);
	}
	else
	{
		trap_Cvar_SetValue("r_lodBias", 1);
		trap_Cvar_SetValue("r_subdivisions", 20);
	}

	if (s_graphicsoptions.filter.curvalue)
	{
		trap_Cvar_Set("r_textureMode", "GL_LINEAR_MIPMAP_LINEAR");
	}
	else
	{
		trap_Cvar_Set("r_textureMode", "GL_LINEAR_MIPMAP_NEAREST");
	}

	trap_Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
}
Exemplo n.º 12
0
static void ModsMenuFunc( menucommon_t *unused )
{
	trap_Cmd_ExecuteText( EXEC_APPEND, "menu_mods\n" );
}
Exemplo n.º 13
0
static void SetUpMenuFunc( menucommon_t *unused )
{
	trap_Cmd_ExecuteText( EXEC_APPEND, "menu_setup\n" );
}
Exemplo n.º 14
0
/*
====================
Console_Key

Handles history and console scrollback
====================
*/
void Console_Key ( int key, qboolean down ) {

	if ( !down ) {
		return;
	}

	if ( key & K_CHAR_FLAG ) {
		key &= ~K_CHAR_FLAG;
		MField_CharEvent( &g_consoleField, key );
		return;
	}

	// ctrl-L clears screen
	if ( key == 'l' && trap_Key_IsDown( K_CTRL ) ) {
		trap_Cmd_ExecuteText( EXEC_APPEND, "clear\n" );
		return;
	}

	// enter finishes the line
	if ( key == K_ENTER || key == K_KP_ENTER ) {
		uiClientState_t cls;

		trap_GetClientState( &cls );

		// if not in the game explicitly prepend a slash if needed
		if ( cls.connState != CA_ACTIVE && con_autochat.integer &&
				g_consoleField.buffer[0] &&
				g_consoleField.buffer[0] != '\\' &&
				g_consoleField.buffer[0] != '/' ) {
			char	temp[MAX_EDIT_LINE-1];

			Q_strncpyz( temp, g_consoleField.buffer, sizeof( temp ) );
			Com_sprintf( g_consoleField.buffer, sizeof( g_consoleField.buffer ), "\\%s", temp );
			g_consoleField.cursor++;
		}

		Com_Printf ( "]%s\n", g_consoleField.buffer );

		// leading slash is an explicit command
		if ( g_consoleField.buffer[0] == '\\' || g_consoleField.buffer[0] == '/' ) {
			trap_Cmd_ExecuteText( EXEC_APPEND, g_consoleField.buffer+1 );	// valid command
			trap_Cmd_ExecuteText( EXEC_APPEND, "\n" );
		} else {
			// other text will be chat messages
			if ( !g_consoleField.buffer[0] ) {
				return;	// empty lines just scroll the console without adding to history
			} else {
				if ( con_autochat.integer ) {
					trap_Cmd_ExecuteText( EXEC_APPEND, "cmd say " );
				}
				trap_Cmd_ExecuteText( EXEC_APPEND, g_consoleField.buffer );
				trap_Cmd_ExecuteText( EXEC_APPEND, "\n" );
			}
		}

		// copy line to history buffer
		historyEditLines[nextHistoryLine % COMMAND_HISTORY] = g_consoleField;
		nextHistoryLine++;
		historyLine = nextHistoryLine;

		MField_Clear( &g_consoleField );

		g_consoleField.widthInChars = g_console_field_width;

		CG_SaveConsoleHistory( );

		if ( cls.connState == CA_DISCONNECTED ) {
			trap_UpdateScreen();	// force an update, because the command
		}							// may take some time
		return;
	}

	// command completion

	if (key == K_TAB) {
		char newbuf[MAX_EDIT_LINE];

		trap_Cmd_AutoComplete( g_consoleField.buffer, newbuf, sizeof ( newbuf ) );

		if ( strcmp( newbuf, g_consoleField.buffer ) != 0 ) {
			Q_strncpyz( g_consoleField.buffer, newbuf, sizeof ( g_consoleField.buffer ) );
			g_consoleField.cursor = strlen( g_consoleField.buffer );
		}
		return;
	}

	// command history (ctrl-p ctrl-n for unix style)

	if ( ( key == K_MWHEELUP && trap_Key_IsDown( K_SHIFT ) ) || ( key == K_UPARROW ) || ( key == K_KP_UPARROW ) ||
		 ( ( tolower(key) == 'p' ) && trap_Key_IsDown( K_CTRL ) ) ) {
		if ( nextHistoryLine - historyLine < COMMAND_HISTORY 
			&& historyLine > 0 ) {
			historyLine--;
		}
		g_consoleField = historyEditLines[ historyLine % COMMAND_HISTORY ];
		return;
	}

	if ( ( key == K_MWHEELDOWN && trap_Key_IsDown( K_SHIFT ) ) || ( key == K_DOWNARROW ) || ( key == K_KP_DOWNARROW ) ||
		 ( ( tolower(key) == 'n' ) && trap_Key_IsDown( K_CTRL ) ) ) {
		historyLine++;
		if (historyLine >= nextHistoryLine) {
			historyLine = nextHistoryLine;
			MField_Clear( &g_consoleField );
			g_consoleField.widthInChars = g_console_field_width;
			return;
		}
		g_consoleField = historyEditLines[ historyLine % COMMAND_HISTORY ];
		return;
	}

	// console scrolling
	if ( key == K_PGUP || key == K_KP_PGUP ) {
		Con_PageUp();
		return;
	}

	if ( key == K_PGDN || key == K_KP_PGDN ) {
		Con_PageDown();
		return;
	}

	if ( key == K_MWHEELUP) {	//----(SA)	added some mousewheel functionality to the console
		Con_PageUp();
		if ( trap_Key_IsDown( K_CTRL ) ) {	// hold <ctrl> to accelerate scrolling
			Con_PageUp();
			Con_PageUp();
		}
		return;
	}

	if ( key == K_MWHEELDOWN) {	//----(SA)	added some mousewheel functionality to the console
		Con_PageDown();
		if ( trap_Key_IsDown( K_CTRL ) ) {	// hold <ctrl> to accelerate scrolling
			Con_PageDown();
			Con_PageDown();
		}
		return;
	}

	// ctrl-home = top of console
	if ( ( key == K_HOME || key == K_KP_HOME ) && trap_Key_IsDown( K_CTRL ) ) {
		Con_Top();
		return;
	}

	// ctrl-end = bottom of console
	if ( ( key == K_END || key == K_KP_END ) && trap_Key_IsDown( K_CTRL ) ) {
		Con_Bottom();
		return;
	}

	// pass to the normal editline routine
	MField_KeyDownEvent( &g_consoleField, key );
}
Exemplo n.º 15
0
/*
 * UI_SoundOptionsMenu_Event
 */
static void
UI_SoundOptionsMenu_Event(void* ptr, int event)
{
	if(event != QM_ACTIVATED)
		return;

	switch(((menucommon_s*)ptr)->id){
	case ID_GRAPHICS:
		UI_PopMenu();
		UI_GraphicsOptionsMenu();
		break;

	case ID_DISPLAY:
		UI_PopMenu();
		UI_DisplayOptionsMenu();
		break;

	case ID_SOUND:
		break;

	case ID_NETWORK:
		UI_PopMenu();
		UI_NetworkOptionsMenu();
		break;

	case ID_BACK:
		UI_PopMenu();
		break;

	case ID_APPLY:
		trap_cvarsetf("s_volume",
			soundOptionsInfo.sfxvolume.curvalue / 10);
		soundOptionsInfo.sfxvolume_original =
			soundOptionsInfo.sfxvolume.curvalue;

		trap_cvarsetf("s_musicvolume",
			soundOptionsInfo.musicvolume.curvalue / 10);
		soundOptionsInfo.musicvolume_original =
			soundOptionsInfo.musicvolume.curvalue;

		/* Check if something changed that requires the sound system to be restarted. */
		if(soundOptionsInfo.quality_original !=
		   soundOptionsInfo.quality.curvalue
		   || soundOptionsInfo.soundSystem_original !=
		   soundOptionsInfo.soundSystem.curvalue){
			int speed;

			switch(soundOptionsInfo.quality.curvalue){
			default:
			case 0:
				speed = 11025;
				break;
			case 1:
				speed = 22050;
				break;
			case 2:
				speed = 44100;
				break;
			}

			if(speed == DEFAULT_SDL_SND_SPEED)
				speed = 0;

			trap_cvarsetf("s_sdlSpeed", speed);
			soundOptionsInfo.quality_original =
				soundOptionsInfo.quality.curvalue;

			soundOptionsInfo.soundSystem_original =
				soundOptionsInfo.soundSystem.curvalue;

			UI_ForceMenuOff();
			trap_Cmd_ExecuteText(EXEC_APPEND, "snd_restart\n");
		}
		break;
	}
}
Exemplo n.º 16
0
static void TutorialsFunc( menucommon_t *unused )
{
	trap_Cmd_ExecuteText( EXEC_APPEND, "menu_tutorials\n" );
}
Exemplo n.º 17
0
static void StartNetworkServerFunc( menucommon_t *unused )
{
	trap_Cmd_ExecuteText( EXEC_APPEND, "menu_startserver\n" );
}
Exemplo n.º 18
0
/*
=================
M_Turbolift_Event
=================
*/
static void M_Turbolift_Event (void* ptr, int notification)
{
	int	id;
	menubitmap_s	*holdDeck;

	id = ((menucommon_s*)ptr)->id;

	/*if ( notification != QM_ACTIVATED )
	{
		return;
	}*/

	switch (id)
	{
		case ID_QUIT:
			if ( notification == QM_ACTIVATED )
				UI_PopMenu();
			break;
		case ID_DECK1:
		case ID_DECK2:
		case ID_DECK3:
		case ID_DECK4:
		case ID_DECK5:
		case ID_DECK6:
		case ID_DECK7:
		case ID_DECK8:
		case ID_DECK9:
		case ID_DECK10:
		case ID_DECK11:
		case ID_DECK12:
		case ID_DECK13:
		case ID_DECK14:
		case ID_DECK15:
		case ID_DECK16:

			if ( notification == QM_ACTIVATED )
			{
				if (s_turbolift.chosenDeck >= 0)
				{
					holdDeck = &s_turbolift.deck1;
					holdDeck += s_turbolift.chosenDeck;
					holdDeck->textcolor	= CT_BLACK;
				}

				s_turbolift.chosenDeck	= id - ID_DECK1;
				s_turbolift.engage.generic.flags = QMF_HIGHLIGHT_IF_FOCUS;

				holdDeck = &s_turbolift.deck1;
				holdDeck += s_turbolift.chosenDeck;
				//holdDeck->textcolor	= CT_WHITE;//CT_LTGOLD1;
			}
			else if ( notification == QM_GOTFOCUS )
			{
				s_turbolift.highLightedDeck = id - ID_DECK1;
			}
			break;
		case ID_ENGAGE:		// Active only if a deck has been chosen
			if ( notification == QM_ACTIVATED ) {
				UI_ForceMenuOff();
				trap_Cmd_ExecuteText( EXEC_APPEND, va( "deck %i %i", s_turbolift.liftNum, s_turbolift.deckData[s_turbolift.chosenDeck].deckNum ) );
			}
			break;
	}
}
Exemplo n.º 19
0
static void ConsoleFunc( menucommon_t *unused )
{
	if( uis.clientState > CA_DISCONNECTED )
		M_ForceMenuOff();
	trap_Cmd_ExecuteText( EXEC_APPEND, "toggleconsole\n" );
}
Exemplo n.º 20
0
/*
=================
ArenaServers_StartRefresh
=================
*/
static void ArenaServers_StartRefresh( void )
{
	int		i;
	char	myargs[32], protocol[32];

	memset( g_arenaservers.serverlist, 0, g_arenaservers.maxservers*sizeof(table_t) );

	for (i=0; i<MAX_PINGREQUESTS; i++)
	{
		g_arenaservers.pinglist[i].adrstr[0] = '\0';
		trap_LAN_ClearPing( i );
	}

	g_arenaservers.refreshservers    = qtrue;
	g_arenaservers.currentping       = 0;
	g_arenaservers.nextpingtime      = 0;
	*g_arenaservers.numservers       = 0;
	g_arenaservers.numqueriedservers = 0;

	// allow max 5 seconds for responses
	g_arenaservers.refreshtime = uis.realtime + 5000;

	// place menu in zeroed state
	ArenaServers_UpdateMenu();

	if( g_servertype == UIAS_LOCAL ) {
		trap_Cmd_ExecuteText( EXEC_APPEND, "localservers\n" );
		return;
	}

	if( g_servertype >= UIAS_GLOBAL1 && g_servertype <= UIAS_GLOBAL5 ) {
		switch( g_arenaservers.gametype.curvalue ) {
		default:
		case GAMES_ALL:
			myargs[0] = 0;
			break;

		case GAMES_FFA:
			strcpy( myargs, " ffa" );
			break;

		case GAMES_TEAMPLAY:
			strcpy( myargs, " team" );
			break;

		case GAMES_TOURNEY:
			strcpy( myargs, " tourney" );
			break;

		case GAMES_CTF:
			strcpy( myargs, " ctf" );
			break;
		}


		if (g_emptyservers) {
			strcat(myargs, " empty");
		}

		if (g_fullservers) {
			strcat(myargs, " full");
		}

		protocol[0] = '\0';
		trap_Cvar_VariableStringBuffer( "debug_protocol", protocol, sizeof(protocol) );
		if (strlen(protocol)) {
			trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %s%s\n", g_servertype - 1, protocol, myargs ));
		}
		else {
			trap_Cmd_ExecuteText( EXEC_APPEND, va( "globalservers %d %d%s\n", g_servertype - 1, (int)trap_Cvar_VariableValue( "protocol" ), myargs ) );
		}
	}
}
Exemplo n.º 21
0
static void QuitMenuFunc( menucommon_t *unused )
{
	trap_Cmd_ExecuteText( EXEC_APPEND, "menu_quit\n" );
}
Exemplo n.º 22
0
/*
=================
ArenaServers_DoRefresh
=================
*/
static void ArenaServers_DoRefresh( void )
{
	int		i;
	int		j;
	int		time;
	int		maxPing;
	char	adrstr[MAX_ADDRESSLENGTH];
	char	info[MAX_INFO_STRING];

	if (uis.realtime < g_arenaservers.refreshtime)
	{
	  if (g_servertype != UIAS_FAVORITES) {
			if (g_servertype == UIAS_LOCAL) {
				if (!trap_LAN_GetServerCount(AS_LOCAL)) {
					return;
				}
			}
			if (trap_LAN_GetServerCount(ArenaServers_SourceForLAN()) < 0) {
			  // still waiting for response
			  return;
			}
	  }
	}

	if (uis.realtime < g_arenaservers.nextpingtime)
	{
		// wait for time trigger
		return;
	}

	// trigger at 10Hz intervals
	g_arenaservers.nextpingtime = uis.realtime + 10;

	// process ping results
	maxPing = ArenaServers_MaxPing();
	for (i=0; i<MAX_PINGREQUESTS; i++)
	{
		trap_LAN_GetPing( i, adrstr, MAX_ADDRESSLENGTH, &time );
		if (!adrstr[0])
		{
			// ignore empty or pending pings
			continue;
		}

		// find ping result in our local list
		for (j=0; j<MAX_PINGREQUESTS; j++)
			if (!Q_stricmp( adrstr, g_arenaservers.pinglist[j].adrstr ))
				break;

		if (j < MAX_PINGREQUESTS)
		{
			// found it
			if (!time)
			{
				time = uis.realtime - g_arenaservers.pinglist[j].start;
				if (time < maxPing)
				{
					// still waiting
					continue;
				}
			}

			if (time > maxPing)
			{
				// stale it out
				info[0] = '\0';
				time    = maxPing;
			}
			else
			{
				trap_LAN_GetPingInfo( i, info, MAX_INFO_STRING );
			}

			// insert ping results
			ArenaServers_Insert( adrstr, info, time );

			// clear this query from internal list
			g_arenaservers.pinglist[j].adrstr[0] = '\0';
   		}

		// clear this query from external list
		trap_LAN_ClearPing( i );
	}

	// get results of servers query
	// counts can increase as servers respond
	if (g_servertype == UIAS_FAVORITES) {
	  g_arenaservers.numqueriedservers = g_arenaservers.numfavoriteaddresses;
	} else {
	  g_arenaservers.numqueriedservers = trap_LAN_GetServerCount(ArenaServers_SourceForLAN());
	}

//	if (g_arenaservers.numqueriedservers > g_arenaservers.maxservers)
//		g_arenaservers.numqueriedservers = g_arenaservers.maxservers;

	// send ping requests in reasonable bursts
	// iterate ping through all found servers
	for (i=0; i<MAX_PINGREQUESTS && g_arenaservers.currentping < g_arenaservers.numqueriedservers; i++)
	{
		if (trap_LAN_GetPingQueueCount() >= MAX_PINGREQUESTS)
		{
			// ping queue is full
			break;
		}

		// find empty slot
		for (j=0; j<MAX_PINGREQUESTS; j++)
			if (!g_arenaservers.pinglist[j].adrstr[0])
				break;

		if (j >= MAX_PINGREQUESTS)
			// no empty slots available yet - wait for timeout
			break;

		// get an address to ping

		if (g_servertype == UIAS_FAVORITES) {
		  strcpy( adrstr, g_arenaservers.favoriteaddresses[g_arenaservers.currentping] ); 		
		} else {
		  trap_LAN_GetServerAddressString(ArenaServers_SourceForLAN(), g_arenaservers.currentping, adrstr, MAX_ADDRESSLENGTH );
		}

		strcpy( g_arenaservers.pinglist[j].adrstr, adrstr );
		g_arenaservers.pinglist[j].start = uis.realtime;

		trap_Cmd_ExecuteText( EXEC_NOW, va( "ping %s\n", adrstr )  );
		
		// advance to next server
		g_arenaservers.currentping++;
	}

	if (!trap_LAN_GetPingQueueCount())
	{
		// all pings completed
		ArenaServers_StopRefresh();
		return;
	}

	// update the user interface with ping status
	ArenaServers_UpdateMenu();
}
Exemplo n.º 23
0
/*
=================
GraphicsOptions_ApplyChanges
=================
*/
static void GraphicsOptions_ApplyChanges( void *unused, int notification )
{
	if (notification != QM_ACTIVATED)
		return;

	switch ( s_graphicsoptions.texturebits.curvalue  )
	{
	case 0:
		trap_Cvar_SetValue( "r_texturebits", 0 );
		break;
	case 1:
		trap_Cvar_SetValue( "r_texturebits", 16 );
		break;
	case 2:
		trap_Cvar_SetValue( "r_texturebits", 32 );
		break;
	}
	trap_Cvar_SetValue( "r_picmip", 3 - s_graphicsoptions.tq.curvalue );
	trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );

	if( resolutionsDetected )
	{
		// search for builtin mode that matches the detected mode
		int mode = GraphicsOptions_FindBuiltinResolution( s_graphicsoptions.mode.curvalue );
		if( mode == -1 )
		{
			char w[ 16 ], h[ 16 ];
			Q_strncpyz( w, detectedResolutions[ s_graphicsoptions.mode.curvalue ], sizeof( w ) );
			*strchr( w, 'x' ) = 0;
			Q_strncpyz( h,
					strchr( detectedResolutions[ s_graphicsoptions.mode.curvalue ], 'x' ) + 1, sizeof( h ) );
			trap_Cvar_Set( "r_customwidth", w );
			trap_Cvar_Set( "r_customheight", h );
		}

		trap_Cvar_SetValue( "r_mode", mode );
	}
	else
		trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );

	trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
	trap_Cvar_SetValue( "r_colorbits", 0 );
	trap_Cvar_SetValue( "r_depthbits", 0 );
	trap_Cvar_SetValue( "r_stencilbits", 0 );
	trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue );

	if ( s_graphicsoptions.geometry.curvalue == 2 )
	{
		trap_Cvar_SetValue( "r_lodBias", 0 );
		trap_Cvar_SetValue( "r_subdivisions", 4 );
	}
	else if ( s_graphicsoptions.geometry.curvalue == 1 )
	{
		trap_Cvar_SetValue( "r_lodBias", 1 );
		trap_Cvar_SetValue( "r_subdivisions", 12 );
	}
	else
	{
		trap_Cvar_SetValue( "r_lodBias", 1 );
		trap_Cvar_SetValue( "r_subdivisions", 20 );
	}

	if ( s_graphicsoptions.filter.curvalue )
	{
		trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR" );
	}
	else
	{
		trap_Cvar_Set( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST" );
	}

	trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" );
}
Exemplo n.º 24
0
/*
* SV_ReadIPList
*/
void SV_ReadIPList( void )
{
	SV_ResetPacketFiltersTimeouts ();

	trap_Cmd_ExecuteText( EXEC_APPEND, "exec listip.cfg silent\n" );
}
Exemplo n.º 25
0
/*
=================
UI_StartDemoLoop
=================
*/
void UI_StartDemoLoop( void ) {
	trap_Cmd_ExecuteText( EXEC_APPEND, "d1\n" );
}
Exemplo n.º 26
0
/*
=================
UI_SoundOptionsMenu_Event
=================
*/
static void UI_SoundOptionsMenu_Event(void* ptr, int event) {
    if (event != QM_ACTIVATED) {
        return;
    }

    switch (((menucommon_s*)ptr)->id) {
        case ID_GRAPHICS:
            UI_PopMenu();
            UI_GraphicsOptionsMenu();
            break;

        case ID_DISPLAY:
            UI_PopMenu();
            UI_DisplayOptionsMenu();
            break;

        case ID_SOUND:
            break;

        case ID_NETWORK:
            UI_PopMenu();
            UI_NetworkOptionsMenu();
            break;
            /*
                case ID_A3D:
                    if( soundOptionsInfo.a3d.curvalue ) {
                        trap_Cmd_ExecuteText( EXEC_NOW, "s_enable_a3d\n" );
                    }
                    else {
                        trap_Cmd_ExecuteText( EXEC_NOW, "s_disable_a3d\n" );
                    }
                    soundOptionsInfo.a3d.curvalue = (int)trap_Cvar_VariableValue( "s_usingA3D" );
                    break;
            */
        case ID_BACK:
            UI_PopMenu();
            break;

        case ID_APPLY:
            trap_Cvar_SetValue("s_volume", soundOptionsInfo.sfxvolume.curvalue / 10);
            soundOptionsInfo.sfxvolume_original = soundOptionsInfo.sfxvolume.curvalue;

            trap_Cvar_SetValue("s_musicvolume", soundOptionsInfo.musicvolume.curvalue / 10);
            soundOptionsInfo.musicvolume_original = soundOptionsInfo.musicvolume.curvalue;

            // Check if something changed that requires the sound system to be restarted.
            if (soundOptionsInfo.quality_original != soundOptionsInfo.quality.curvalue
                    || soundOptionsInfo.soundSystem_original != soundOptionsInfo.soundSystem.curvalue) {
                int speed;

                switch (soundOptionsInfo.quality.curvalue) {
                    default:
                    case 0:
                        speed = 11025;
                        break;
                    case 1:
                        speed = 22050;
                        break;
                    case 2:
                        speed = 44100;
                        break;
                }

                if (speed == DEFAULT_SDL_SND_SPEED)
                    speed = 0;

                trap_Cvar_SetValue("s_sdlSpeed", speed);
                soundOptionsInfo.quality_original = soundOptionsInfo.quality.curvalue;

                trap_Cvar_SetValue("s_useOpenAL", (soundOptionsInfo.soundSystem.curvalue == UISND_OPENAL));
                soundOptionsInfo.soundSystem_original = soundOptionsInfo.soundSystem.curvalue;

                UI_ForceMenuOff();
                trap_Cmd_ExecuteText(EXEC_APPEND, "snd_restart\n");
            }
            break;
    }
}
Exemplo n.º 27
0
/*
* G_Gametype_Init
*/
void G_Gametype_Init( void )
{
	bool changed = false;
	const char *mapGametype;

	g_gametypes_list = trap_Cvar_Get( "g_gametypes_list", "", CVAR_NOSET|CVAR_ARCHIVE );
	G_Gametype_GenerateGametypesList(); // fill the g_gametypes_list cvar

	// empty string to allow all
	g_votable_gametypes = trap_Cvar_Get( "g_votable_gametypes", "", CVAR_ARCHIVE );

	if( !g_gametype ) // first time initialized
		changed = true;

	g_gametype = trap_Cvar_Get( "g_gametype", "dm", CVAR_SERVERINFO|CVAR_ARCHIVE|CVAR_LATCH );

	//get the match cvars too
	g_warmup_timelimit = trap_Cvar_Get( "g_warmup_timelimit", "5", CVAR_ARCHIVE );
	g_postmatch_timelimit = trap_Cvar_Get( "g_postmatch_timelimit", "4", CVAR_ARCHIVE );
	g_countdown_time = trap_Cvar_Get( "g_countdown_time", "5", CVAR_ARCHIVE );
	g_match_extendedtime = trap_Cvar_Get( "g_match_extendedtime", "2", CVAR_ARCHIVE );

	// game settings
	g_timelimit = trap_Cvar_Get( "g_timelimit", "10", CVAR_ARCHIVE );
	g_scorelimit = trap_Cvar_Get( "g_scorelimit", "0", CVAR_ARCHIVE );
	g_allow_falldamage = trap_Cvar_Get( "g_allow_falldamage", "1", CVAR_ARCHIVE );
	g_allow_selfdamage = trap_Cvar_Get( "g_allow_selfdamage", "1", CVAR_ARCHIVE );
	g_allow_teamdamage = trap_Cvar_Get( "g_allow_teamdamage", "1", CVAR_ARCHIVE );
	g_allow_bunny = trap_Cvar_Get( "g_allow_bunny", "1", CVAR_ARCHIVE|CVAR_READONLY );

	// map-specific gametype
	mapGametype = G_asCallMapGametype();
	if( mapGametype[0] && G_Gametype_Exists( mapGametype ) )
		trap_Cvar_Set( g_gametype->name, mapGametype );

	// update latched gametype change
	if( g_gametype->latched_string )
	{
		if( G_Gametype_Exists( g_gametype->latched_string ) )
		{
			trap_Cvar_ForceSet( "g_gametype", va( "%s", g_gametype->latched_string ) );
			changed = true;
		}
		else
		{
			G_Printf( "G_Gametype: Invalid new gametype, change ignored\n" );
			trap_Cvar_ForceSet( "g_gametype", va( "%s", g_gametype->string ) );
		}
	}

	if( !G_Gametype_Exists( g_gametype->string ) )
	{
		G_Printf( "G_Gametype: Wrong value: '%s'. Setting up with default (dm)\n", g_gametype->string );
		trap_Cvar_ForceSet( "g_gametype", "dm" );
		changed = true;
	}

	G_Printf( "-------------------------------------\n" );
	G_Printf( "Initalizing '%s' gametype\n", g_gametype->string );

	if( changed )
	{
		const char *configs_path = "configs/server/gametypes/";

		G_InitChallengersQueue();

		// print a hint for admins so they know there's a chance to execute a
		// config here, but don't show it as an error, because it isn't
		G_Printf( "loading %s%s.cfg\n", configs_path, g_gametype->string );
		trap_Cmd_ExecuteText( EXEC_NOW, va( "exec %s%s.cfg silent\n", configs_path, g_gametype->string ) );
		trap_Cbuf_Execute();

		// on a listen server, override gametype-specific settings in config
		trap_Cmd_ExecuteText( EXEC_NOW, "vstr ui_startservercmd\n" );
		trap_Cbuf_Execute();
	}

	// fixme: we are doing this twice because the gametype may check for GS_Instagib
	G_CheckCvars(); // update GS_Instagib, GS_FallDamage, etc

	G_Gametype_SetDefaults();

	// Init the current gametype
	if( !GT_asLoadScript( g_gametype->string ) )
		G_Gametype_GENERIC_Init();

	GS_SetGametypeName( g_gametype->string );

	trap_ConfigString( CS_GAMETYPENAME, g_gametype->string );

	G_CheckCvars(); // update GS_Instagib, GS_FallDamage, etc

	// ch : if new gametype has been initialized, transfer the
	// client-specific ratings to gametype-specific list
	if( changed )
		G_TransferRatings();
}
Exemplo n.º 28
0
/*
===================
UI_KeyConnect
===================
*/
void UI_KeyConnect( int key ) {
	if ( key == K_ESCAPE ) {
		trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" );
		return;
	}
}
Exemplo n.º 29
0
sfxHandle_t Menu_DefaultKey(menuframework_s *m, int key)
{
	sfxHandle_t		sound = 0;
	menucommon_s	*item;
	int				cursor_prev;

	// menu system keys
	switch (key) {
	case K_MOUSE2:
	case K_ESCAPE:
		UI_PopMenu();
		return menu_out_sound;
	}

	if (!m || !m->nitems) {
		return 0;
	}

	// route key stimulus to widget
	item = Menu_ItemAtCursor(m);
	if (item && !(item->flags & (QMF_GRAYED|QMF_INACTIVE))) {
		switch (item->type) {
		case MTYPE_SPINCONTROL:
			sound = SpinControl_Key((menulist_s*)item, key);
			break;

		case MTYPE_RADIOBUTTON:
			sound = RadioButton_Key((menuradiobutton_s*)item, key);
			break;

		case MTYPE_SLIDER:
			sound = Slider_Key((menuslider_s*)item, key);
			break;

		case MTYPE_SCROLLLIST:
			sound = ScrollList_Key((menulist_s*)item, key);
			break;

		case MTYPE_FIELD:
			sound = MenuField_Key((menufield_s*)item, &key);
			break;
		}

		if (sound) {
			// key was handled
			return sound;
		}
	}

	// default handling
	switch (key) {
#ifndef NDEBUG
	case K_F11:
		uis.debug ^= 1;
		break;

	case K_F12:
		trap_Cmd_ExecuteText(EXEC_APPEND, "screenshot\n");
		break;
#endif
	case K_KP_UPARROW:
	case K_UPARROW:
		cursor_prev    = m->cursor;
		m->cursor_prev = m->cursor;
		m->cursor--;
		Menu_AdjustCursor(m, -1);
		if (cursor_prev != m->cursor) {
			Menu_CursorMoved(m);
			sound = menu_move_sound;
		}
		break;

	case K_TAB:
	case K_KP_DOWNARROW:
	case K_DOWNARROW:
		cursor_prev    = m->cursor;
		m->cursor_prev = m->cursor;
		m->cursor++;
		Menu_AdjustCursor(m, 1);
		if (cursor_prev != m->cursor) {
			Menu_CursorMoved(m);
			sound = menu_move_sound;
		}
		break;

	case K_MOUSE1:
	case K_MOUSE3:
		if (item)
			if ((item->flags & QMF_HASMOUSEFOCUS) && !(item->flags & (QMF_GRAYED|QMF_INACTIVE)))
				return (Menu_ActivateItem(m, item));
		break;

	case K_JOY1:
	case K_JOY2:
	case K_JOY3:
	case K_JOY4:
	case K_AUX1:
	case K_AUX2:
	case K_AUX3:
	case K_AUX4:
	case K_AUX5:
	case K_AUX6:
	case K_AUX7:
	case K_AUX8:
	case K_AUX9:
	case K_AUX10:
	case K_AUX11:
	case K_AUX12:
	case K_AUX13:
	case K_AUX14:
	case K_AUX15:
	case K_AUX16:
	case K_KP_ENTER:
	case K_ENTER:
		if (item && !(item->flags & (QMF_MOUSEONLY|QMF_GRAYED|QMF_INACTIVE))) {
			return (Menu_ActivateItem(m, item));
		}
		break;
	}

	return sound;
}
Exemplo n.º 30
0
static void MatchMakerFunc( menucommon_t *unused )
{
	trap_Cmd_ExecuteText( EXEC_APPEND, "menu_matchmaker\n" );
}