示例#1
0
const char *PlayerConfig_MenuKey (int key)
{
	if ( key == K_ESCAPE )
		PConfigAccept();

	return Default_MenuKey( &s_player_config_menu, key );
}
示例#2
0
const char *M_Quit_Key (int key)
{
#ifdef QUITMENU_NOKEY
	return Default_MenuKey( &s_quit_menu, key );
#else // QUITMENU_NOKEY
	switch (key)
	{
	case K_ESCAPE:
	case 'n':
	case 'N':
		UI_PopMenu ();
		break;

	case 'Y':
	case 'y':
		cls.key_dest = key_console;
		CL_Quit_f ();
		break;

	default:
		break;
	}
	return NULL;
#endif // QUITMENU_NOKEY
}
示例#3
0
文件: ui_keys.c 项目: chrisnew/quake2
static const char *Keys_MenuKey( menuframework_s *self, int key )
{
	menuaction_s *item = ( menuaction_s * ) Menu_ItemAtCursor( &s_keys_menu );

	if ( bind_grab )
	{	
		if ( key != K_ESCAPE && key != '`' )
		{
			char cmd[1024];

			Com_sprintf (cmd, sizeof(cmd), "bind \"%s\" \"%s\"", Key_KeynumToString(key), bindnames[item->generic.localdata[0]][0]);
			Cbuf_InsertText (cmd);
		}
		
		Menu_SetStatusBar( &s_keys_menu, "enter to change, backspace to clear" );
		bind_grab = false;
		return menu_out_sound;
	}

	switch ( key )
	{
	case K_KP_ENTER:
	case K_ENTER:
	case K_MOUSE1:
		KeyBindingFunc( item );
		return menu_in_sound;
	case K_BACKSPACE:		// delete bindings
	case K_DEL:				// delete bindings
	case K_KP_DEL:
		M_UnbindCommand( bindnames[item->generic.localdata[0]][0] );
		return menu_out_sound;
	default:
		return Default_MenuKey( self, key );
	}
}
示例#4
0
const char *Options_VR_OVR_MenuKey( int32_t key )
{
	if ( key == K_ESCAPE		|| key == K_GAMEPAD_B
		|| key == K_GAMEPAD_BACK	|| key == K_GAMEPAD_START
		)
		VROVRConfigAccept();
	return Default_MenuKey( &s_options_vr_ovr_menu, key );
}
示例#5
0
const char *StartServer_MenuKey( menuframework_s *self, int key )
{
	if ( key == K_ESCAPE )
	{
		Maps_Free();
	}

	return Default_MenuKey( self, key );
}
示例#6
0
const char *LoadGame_MenuKey( menuframework_s *self, int key )
{
	if ( key == K_ESCAPE || key == K_ENTER )
	{
		s_savegame_menu.cursor = s_loadgame_menu.cursor - 1;
		if ( s_savegame_menu.cursor < 0 )
			s_savegame_menu.cursor = 0;
	}
	return Default_MenuKey( self, key );
}
示例#7
0
const char *SaveGame_MenuKey(int key)
{
    if ((key == K_ENTER) || (key == K_ESCAPE))
    {
        s_loadgame_menu.cursor = s_savegame_menu.cursor - 1;
        if (s_loadgame_menu.cursor < 0)
        {
            s_loadgame_menu.cursor = 0;
        }
    }
    return Default_MenuKey(&s_savegame_menu, key);
}
示例#8
0
static const char *StartServer_MenuKey( int key )
{
    menucommon_t *item;

    item = Menu_ItemAtCursor( &s_startserver_menu );

    if( key == K_ESCAPE || ( ( key == K_MOUSE2 ) && ( item->type != MTYPE_SPINCONTROL ) &&
                             ( item->type != MTYPE_SLIDER ) ) )
    {
        UI_FreeScrollItemList( &mapList );
    }

    return Default_MenuKey( &s_startserver_menu, key );
}
示例#9
0
static const char *TeamConfig_MenuKey( int key )
{
	menucommon_t *item;

	item = Menu_ItemAtCursor( &s_team_config_menu );

	if( key == K_ESCAPE || ( ( key == K_MOUSE2 ) && ( item->type != MTYPE_SPINCONTROL ) &&
	                        ( item->type != MTYPE_SLIDER ) ) )
	{
		M_TeamConfig_SaveAndClose( NULL );
		return menu_out_sound;
	}

	return Default_MenuKey( &s_team_config_menu, key );
}
static const char *Keys_MenuKey( int key )
{
	menuaction_s *item = ( menuaction_s * ) Menu_ItemAtCursor( &s_keys_menu );

	//pressing mouse1 to pick a new bind wont force bind/unbind itself - spaz
	if ( bind_grab && !(cursor.buttonused[MOUSEBUTTON1]&&key==K_MOUSE1))
	{	
		if ( key != K_ESCAPE && key != '`' )
		{
			char cmd[1024];

			Com_sprintf (cmd, sizeof(cmd), "bind \"%s\" \"%s\"\n", Key_KeynumToString(key), bindnames[item->generic.localdata[0]][0]);
			Cbuf_InsertText (cmd);
		}
		
		// Knightmare- added Psychospaz's mouse support
		//dont let selecting with mouse buttons screw everything up
		UI_RefreshCursorButtons();
		if (key==K_MOUSE1)
			cursor.buttonclicks[MOUSEBUTTON1] = -1;

		//Menu_SetStatusBar( &s_keys_menu, "enter to change, backspace to clear" );
		Menu_SetStatusBar( &s_keys_menu, "Press ENTER or LEFT CLICK to change the key. Press BACKSPACE to clear." );
		bind_grab = false;
		return menu_out_sound;
	}

	switch ( key )
	{
	case K_KP_ENTER:
	case K_ENTER:
		if (item == &s_keys_back_action) { // back action hack
			UI_BackMenu(item); return NULL; }
		KeyBindingFunc( item );
		return menu_in_sound;
	case K_BACKSPACE:		// delete bindings
	case K_DEL:				// delete bindings
	case K_KP_DEL:
		M_UnbindCommand( bindnames[item->generic.localdata[0]][0] );
		return menu_out_sound;
	default:
		return Default_MenuKey( &s_keys_menu, key );
	}
}
示例#11
0
文件: vid_menu.c 项目: qbism/qbq2
/*
================
VID_MenuKey
================
*/
const char *VID_MenuKey( int key )
{
	return Default_MenuKey (s_current_menu, key);
}
示例#12
0
const char *Options_Screen_MenuKey( int key )
{
	return Default_MenuKey( &s_options_screen_menu, key );
}
示例#13
0
const char *DMOptions_MenuKey( int32_t key )
{
	return Default_MenuKey( &s_dmoptions_menu, key );
}
示例#14
0
文件: ui_main.c 项目: Racenet/racesow
static const char *M_Main_Key( int key )
{
	return Default_MenuKey( &s_main_menu, key );
}
示例#15
0
static const char *M_Custom_Key( int key )
{
	return Default_MenuKey( &s_custom_menu, key );
}
示例#16
0
/*
================
Video_MenuKey
================
*/
const char *Video_MenuKey( int32_t key )
{
	return Default_MenuKey( &s_video_menu, key );
}
const char *Options_Sound_MenuKey( int key )
{
	return Default_MenuKey( &s_options_sound_menu, key );
}
示例#18
0
const char *Options_VR_MenuKey( int32_t key )
{
	return Default_MenuKey( &s_options_vr_menu, key );
}
示例#19
0
/*
================
Video_Advanced_MenuKey
================
*/
const char *Video_Advanced_MenuKey( int key )
{
	return Default_MenuKey( &s_video_advanced_menu, key );

}
示例#20
0
static const char *M_Msgbox_Key( int key )
{
	return Default_MenuKey( &s_msgbox_menu, key );
}
示例#21
0
const char *Options_Interface_MenuKey( int32_t key )
{
	return Default_MenuKey( &s_options_interface_menu, key );
}
示例#22
0
const char *JoinServer_MenuKey( int32_t key )
{
	return Default_MenuKey( &s_joinserver_menu, key );
}
const char *Options_Ingame_MenuKey( int key )
{
	return Default_MenuKey( &s_options_ingame_menu, key );
}
示例#24
0
static const char *Performance_MenuKey( int key )
{
    return Default_MenuKey( &s_performance_menu, key );
}
示例#25
0
const char *Options_Effects_MenuKey(int key)
{
    return Default_MenuKey(&s_options_effects_menu, key);
}
示例#26
0
const char *Multiplayer_MenuKey( int key )
{
	return Default_MenuKey( &s_multiplayer_menu, key );
}
示例#27
0
文件: ui_tv.c 项目: Racenet/racesow
static const char *M_TV_Key( int key )
{
	return Default_MenuKey( &s_tv_menu, key );
}