本文整理汇总了C++中UI_PopMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ UI_PopMenu函数的具体用法?C++ UI_PopMenu怎么用?C++ UI_PopMenu使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UI_PopMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UI_SaveConfigMenu_SaveEvent
/*
===============
UI_SaveConfigMenu_SaveEvent
===============
*/
static void UI_SaveConfigMenu_SaveEvent( void *ptr, int event )
{
char configname[MAX_QPATH];
if( event != QM_ACTIVATED )
{
return;
}
if( !saveConfig.savename.field.buffer[0] )
{
return;
}
COM_StripExtension(saveConfig.savename.field.buffer, configname );
Cbuf_ExecuteText( EXEC_APPEND, va( "writeconfig config\\%s.cfg\n", configname ) );
UI_PopMenu();
}
示例2: PlayerSettings_MenuEvent
/*
=================
PlayerSettings_MenuEvent
=================
*/
static void PlayerSettings_MenuEvent( void* ptr, int event ) {
if( event != QM_ACTIVATED ) {
return;
}
switch( ((menucommon_s*)ptr)->id ) {
case ID_MODEL:
PlayerSettings_SaveChanges();
UI_PlayerModelMenu();
break;
case ID_BACK:
PlayerSettings_SaveChanges();
UI_PopMenu();
break;
}
}
示例3: RankStatus_MenuEvent
/*
===============
RankStatus_MenuEvent
===============
*/
static void RankStatus_MenuEvent(void* ptr, int event)
{
if (event != QM_ACTIVATED)
{
return;
}
switch (((menucommon_s*)ptr)->id)
{
case ID_OK:
UI_PopMenu();
switch (s_status)
{
case QGR_STATUS_NO_USER:
UI_RankingsMenu();
break;
case QGR_STATUS_BAD_PASSWORD:
UI_RankingsMenu();
UI_LoginMenu();
break;
case QGR_STATUS_USER_EXISTS:
UI_RankingsMenu();
UI_SignupMenu();
break;
case QGR_STATUS_NO_MEMBERSHIP:
UI_RankingsMenu();
break;
case QGR_STATUS_TIMEOUT:
UI_RankingsMenu();
break;
case QGR_STATUS_INVALIDUSER:
UI_RankingsMenu();
break;
case QGR_STATUS_ERROR:
UI_RankingsMenu();
break;
default:
break;
}
break;
}
}
示例4: UI_SetupMenu_Event
/*
===============
UI_SetupMenu_Event
===============
*/
static void UI_SetupMenu_Event( void *ptr, int event ) {
if( event != QM_ACTIVATED ) {
return;
}
switch( ((menucommon_s*)ptr)->id ) {
case ID_CUSTOMIZEPLAYER:
UI_PlayerSettingsMenu();
break;
case ID_CUSTOMIZECONTROLS:
UI_ControlsMenu();
break;
case ID_SYSTEMCONFIG:
UI_GraphicsOptionsMenu();
break;
case ID_GAME:
UI_PreferencesMenu();
break;
case ID_CDKEY:
UI_CDKeyMenu();
break;
// case ID_LOAD:
// UI_LoadConfigMenu();
// break;
// case ID_SAVE:
// UI_SaveConfigMenu();
// break;
case ID_DEFAULTS:
UI_ConfirmMenu( "SET TO DEFAULTS?", Setup_ResetDefaults_Draw, Setup_ResetDefaults_Action );
break;
case ID_BACK:
UI_PopMenu();
break;
}
}
示例5: UI_Performance_Callback
/*
==================
UI_Performance_Callback
==================
*/
static void UI_Performance_Callback (void *self, int event){
menuCommon_t *item = (menuCommon_t *)self;
if (event == QM_CHANGED){
UI_Performance_UpdateConfig();
UI_Performance_SetConfig();
return;
}
if (event != QM_ACTIVATED)
return;
switch (item->id){
case ID_BACK:
UI_PopMenu();
break;
}
}
示例6: Signup_MenuEvent
/*
===============
Signup_MenuEvent
===============
*/
static void Signup_MenuEvent( void* ptr, int event ) {
//char cmd[1024];
if( event != QM_ACTIVATED ) {
return;
}
switch( ((menucommon_s*)ptr)->id ) {
case ID_SIGNUP:
if( strcmp(s_signup.password_box.field.buffer,
s_signup.again_box.field.buffer) != 0 )
{
// GRANK_FIXME - password mismatch
break;
}
// set name
//trap_Cvar_Set( "name", s_signup.name_box.field.buffer );
/*
trap_Cvar_Set( "rank_name", s_signup.name_box.field.buffer );
trap_Cvar_Set( "rank_pwd", s_signup.password_box.field.buffer );
*/
// create account
/*
sprintf( cmd, "cmd rank_create \"%s\" \"%s\" \"%s\"\n",
s_signup.name_box.field.buffer,
s_signup.password_box.field.buffer,
s_signup.email_box.field.buffer );
trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
*/
trap_CL_UI_RankUserCreate(
s_signup.name_box.field.buffer,
s_signup.password_box.field.buffer,
s_signup.email_box.field.buffer );
UI_ForceMenuOff();
break;
case ID_CANCEL:
UI_PopMenu();
break;
}
}
示例7: SpecifyLeague_Event
/*
=======================================================================================================================================
SpecifyLeague_Event
=======================================================================================================================================
*/
static void SpecifyLeague_Event(void *ptr, int event) {
int id;
id = ((menucommon_s *)ptr)->id;
//if (event != QM_ACTIVATED && id != ID_SPECIFYLEAGUELIST) {
// return;
//}
switch (id) {
case ID_SPECIFYLEAGUELIST:
if (event == QM_GOTFOCUS) {
//ArenaServers_UpdatePicture();
}
break;
case ID_SPECIFYLEAGUEUP:
if (event == QM_ACTIVATED) {
ScrollList_Key(&s_specifyleague.list, K_UPARROW);
}
break;
case ID_SPECIFYLEAGUEDOWN:
if (event == QM_ACTIVATED) {
ScrollList_Key(&s_specifyleague.list, K_DOWNARROW);
}
break;
case ID_SPECIFYLEAGUENAME:
if ((event == QM_LOSTFOCUS) && (Q_strncmp(playername, s_specifyleague.rankname.field.buffer, strlen(s_specifyleague.rankname.field.buffer)) != 0)) {
SpecifyLeague_GetList();
}
break;
case ID_SPECIFYLEAGUEBACK:
if (event == QM_ACTIVATED) {
trap_Cvar_Set("sv_leagueName", league_table[s_specifyleague.list.curvalue].leaguename);
UI_PopMenu();
}
break;
}
}
示例8: UI_PlayRec_Callback
/*
=================
UI_PlayRec_Callback
=================
*/
static void UI_PlayRec_Callback( void *self, int event )
{
menuCommon_s *item = (menuCommon_s *)self;
if( event != QM_ACTIVATED )
return;
switch( item->id )
{
case ID_PLAY:
UI_PlayDemo_Menu();
break;
case ID_RECORD:
UI_RecDemo_Menu();
break;
case ID_DONE:
UI_PopMenu();
break;
}
}
示例9: ConfirmMenu_Event
/*
=================
ConfirmMenu_Event
=================
*/
static void ConfirmMenu_Event( void* ptr, int event ) {
qboolean result;
if( event != QM_ACTIVATED ) {
return;
}
UI_PopMenu();
if( ((menucommon_s*)ptr)->id == ID_CONFIRM_NO ) {
result = qfalse;
}
else {
result = qtrue;
}
if( s_confirm.action ) {
s_confirm.action( result );
}
}
示例10: UI_SPPostgameMenu_NextEvent
/*
=================
UI_SPPostgameMenu_NextEvent
=================
*/
static void UI_SPPostgameMenu_NextEvent( void* ptr, int event ) {
int level;
const char *arenaInfo;
if (event != QM_ACTIVATED) {
return;
}
UI_PopMenu();
// handle specially if we just won the training map
if( postgameMenuInfo.won == 0 ) {
level = 0;
}
else {
level = postgameMenuInfo.level + 1;
}
#if 0
currentLevel = UI_GetCurrentGame();
if( currentLevel == -1 ) {
currentLevel = postgameMenuInfo.level;
}
currentSet = currentLevel / ARENAS_PER_TIER;
if( levelSet > currentSet || levelSet == UI_GetNumSPTiers() ) {
level = currentLevel;
}
#else
level = UI_GetCurrentGame(postgameMenuInfo.level);
if (level == UI_GetNumSPArenas())
{
level = 0;
}
#endif
arenaInfo = UI_GetArenaInfoByNumber( level );
if ( !arenaInfo ) {
return;
}
UI_SPArena_Start( arenaInfo );
}
示例11: UI_Credits_DrawFunc
/*
=================
UI_Credits_DrawFunc
=================
*/
static void UI_Credits_DrawFunc( void )
{
int i, y;
float speed = 32.0f * (768.0f / ScreenHeight);
int w = UI_SMALL_CHAR_WIDTH;
int h = UI_SMALL_CHAR_HEIGHT;
int color = 0x00FFA000;
// draw the background first
UI_FillRect( 0, 0, ScreenWidth, ScreenHeight, uiColorBlack );
// now draw the credits
UI_ScaleCoords( NULL, NULL, &w, &h );
y = ScreenHeight - (((gpGlobals->time * 1000) - uiCredits.startTime ) / speed );
// draw the credits
for ( i = 0; i < uiCredits.numLines && uiCredits.credits[i]; i++, y += h )
{
// skip not visible lines, but always draw end line
if( y <= -h && i != uiCredits.numLines - 1 ) continue;
if(( y < ( ScreenHeight - h ) / 2 ) && i == uiCredits.numLines - 1 )
{
if( !uiCredits.fadeTime ) uiCredits.fadeTime = (gpGlobals->time * 1000);
color = UI_FadeAlpha( uiCredits.fadeTime, uiCredits.showTime );
if( UnpackAlpha( color ))
UI_DrawString( 0, ( ScreenHeight - h ) / 2, ScreenWidth, h, uiCredits.credits[i], color, true, w, h, 1, true );
}
else UI_DrawString( 0, y, ScreenWidth, h, uiCredits.credits[i], uiColorWhite, false, w, h, 1, true );
}
if( y < 0 && UnpackAlpha( color ) == 0 )
{
uiCredits.active = false; // end of credits
}
if( !uiCredits.active )
UI_PopMenu();
}
示例12: UI_Cinematics_Callback
/*
==================
UI_Cinematics_Callback
==================
*/
static void UI_Cinematics_Callback (void *self, int event){
menuCommon_t *item = (menuCommon_t *)self;
if (event == QM_CHANGED){
// if (uiStatic.playingCinematic)
// CIN_StopCinematic();
// uiStatic.playingCinematic = CIN_PlayCinematic(uiCinematics.cinematicFiles[uiCinematics.cinList.curItem], CIN_LOOPING | CIN_SILENT);
return;
}
if (event != QM_ACTIVATED)
return;
switch (item->id){
case ID_BACK:
if (uiStatic.playingCinematic){
uiStatic.playingCinematic = false;
// CIN_StopCinematic();
}
UI_PopMenu();
break;
case ID_PLAY:
case ID_CINPREVIEW:
if (uiStatic.playingCinematic){
uiStatic.playingCinematic = false;
// CIN_StopCinematic();
}
Cmd_ExecuteText(CMD_EXEC_APPEND, Str_VarArgs("playCinematic %s\n", uiCinematics.cinematics[uiCinematics.cinList.curItem]));
break;
}
}
示例13: UI_TeamOrdersMenu_ListEvent
/*
===============
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();
}
示例14: SpecifyPassword_Event
/*
=================
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;
}
}
示例15: UI_Mods_Callback
/*
==================
UI_Mods_Callback
==================
*/
static void UI_Mods_Callback (void *self, int event){
menuCommon_t *item = (menuCommon_t *)self;
if (event == QM_CHANGED){
// See if the load button should be grayed
if (!Str_ICompare(CVar_GetVariableString("fs_game"), uiMods.modsDir[uiMods.modList.curItem]))
uiMods.load.generic.flags |= QMF_GRAYED;
else
uiMods.load.generic.flags &= ~QMF_GRAYED;
return;
}
if (event != QM_ACTIVATED)
return;
switch (item->id){
case ID_BACK:
UI_PopMenu();
break;
case ID_LOAD:
if (cls.state == CA_ACTIVE)
break; // Don't fuck up the game
// Update fs_game
CVar_ForceSet("fs_game", uiMods.modsDir[uiMods.modList.curItem]);
// Restart file system
FS_Restart();
// Flush all data so it will be forced to reload
Cmd_ExecuteText(CMD_EXEC_APPEND, "restartVideo\n");
break;
}
}