这篇教程C++ trap_Cvar_VariableValue函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中trap_Cvar_VariableValue函数的典型用法代码示例。如果您正苦于以下问题:C++ trap_Cvar_VariableValue函数的具体用法?C++ trap_Cvar_VariableValue怎么用?C++ trap_Cvar_VariableValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了trap_Cvar_VariableValue函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: UI_DrawLoadPanelvoid UI_DrawLoadPanel( qboolean forcerefresh, qboolean ownerdraw, qboolean uihack ) { static qboolean inside = qfalse; if ( inside ) { if ( !uihack && trap_Cvar_VariableValue( "ui_connecting" ) ) { trap_Cvar_Set( "ui_connecting", "0" ); } return; } connect_ownerdraw = ownerdraw; inside = qtrue; if ( !bg_loadscreeninited ) { trap_R_RegisterFont( "ariblk", 27, &bg_loadscreenfont1 ); trap_R_RegisterFont( "courbd", 30, &bg_loadscreenfont2 ); BG_PanelButtonsSetup( loadpanelButtons ); bg_loadscreeninited = qtrue; } BG_PanelButtonsRender( loadpanelButtons ); if ( forcerefresh ) { //trap_UpdateScreen(); } if ( !uihack && trap_Cvar_VariableValue( "ui_connecting" ) ) { trap_Cvar_Set( "ui_connecting", "0" ); } inside = qfalse;}
开发者ID:AdrienJaguenet,项目名称:Enemy-Territory,代码行数:35,
示例2: ArenaServers_StopRefresh/*=================ArenaServers_StopRefresh=================*/static void ArenaServers_StopRefresh( void ){ int count; if (!serverStatus.refreshActive) { // not currently refreshing return; } serverStatus.refreshActive = qfalse; Com_Printf("%d servers listed in browser with %d players./n", serverStatus.numDisplayServers, serverStatus.numPlayersOnServers); count = trap_LAN_GetServerCount(g_arenaservers.master.curvalue); if (count - serverStatus.numDisplayServers > 0) { if ( ui_browserShowAwOnly.integer ) { Com_Printf("%d servers not listed because they aren't running Afterwards or have pings over %d/n", count - serverStatus.numDisplayServers, (int) trap_Cvar_VariableValue("cl_maxPing")); } else { Com_Printf("%d servers not listed due to packet loss or pings over %d/n", count - serverStatus.numDisplayServers, (int) trap_Cvar_VariableValue("cl_maxPing")); } } ArenaServers_UpdateMenu( qtrue );}
开发者ID:ElderPlayerX,项目名称:Afterwards,代码行数:32,
示例3: FirstConnect_SetMenuItems/*=================FirstConnect_SetMenuItems=================*/static void FirstConnect_SetMenuItems( void ) { int rate; // name Q_strncpyz( s_firstconnect.name.field.buffer, UI_Cvar_VariableString("name"), sizeof(s_firstconnect.name.field.buffer) ); rate = trap_Cvar_VariableValue( "rate" ); if( rate <= 2500 ) { s_firstconnect.rate.curvalue = 0; } else if( rate <= 3000 ) { s_firstconnect.rate.curvalue = 1; } else if( rate <= 4000 ) { s_firstconnect.rate.curvalue = 2; } else if( rate <= 5000 ) { s_firstconnect.rate.curvalue = 3; } else { s_firstconnect.rate.curvalue = 4; } s_firstconnect.allowdownload.curvalue = trap_Cvar_VariableValue( "cl_allowDownload" ) != 0; s_firstconnect.delaghitscan.curvalue = trap_Cvar_VariableValue( "cg_delag" ) != 0;}
开发者ID:OpenArena,项目名称:legacy,代码行数:30,
示例4: Controls_SetConfig/*=================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( "cg_autoswitch", s_controls.autoswitch.curvalue ); trap_Cvar_SetValue( "sensitivity", s_controls.sensitivity.curvalue ); trap_Cmd_ExecuteText( EXEC_APPEND, "in_restart/n" );}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:38,
示例5: UI_SPSkillMenu_SkillEvent/*=================UI_SPSkillMenu_SkillEvent=================*/static void UI_SPSkillMenu_SkillEvent( void *ptr, int notification ) { int id; int skill; if (notification != QM_ACTIVATED) return; SetSkillColor( (int)trap_Cvar_VariableValue( "g_spSkill" ), text_big_color ); id = ((menucommon_s*)ptr)->id; skill = id - ID_BABY + 1; trap_Cvar_SetValue( "g_spSkill", skill );#ifdef TURTLEARENA SetSkillColor( skill, color_orange );#else SetSkillColor( skill, color_white );#endif#ifndef TA_MISC // SRB2_SKILLS skillMenuInfo.art_skillPic.shader = skillMenuInfo.skillpics[skill - 1]; if( id == ID_NIGHTMARE ) { trap_S_StartLocalSound( skillMenuInfo.nightmareSound, CHAN_ANNOUNCER ); } else { trap_S_StartLocalSound( skillMenuInfo.silenceSound, CHAN_ANNOUNCER ); }#endif}
开发者ID:Extraordinary-Beat-X,项目名称:ebx-code,代码行数:34,
示例6: InServer_Event/*=================InServer_Event=================*/void InServer_Event( void *ptr, int notification ) { if( notification != QM_ACTIVATED ) { return; } switch( ((menucommon_s*)ptr)->id ) { case ID_CHANGEMAP:#ifdef TA_SP // ARCADE UI_StartServerMenu( !ui_singlePlayerActive.integer );#else UI_StartServerMenu( trap_Cvar_VariableValue("g_gametype") != GT_SINGLE_PLAYER );#endif break; case ID_RESTART: UI_ConfirmMenu( "Restart Level?", 0, InServer_RestartAction ); break; case ID_ADDBOTS: UI_AddBotsMenu(); break; case ID_REMOVEBOTS: UI_RemoveBotsMenu(); break; case ID_BACK: UI_PopMenu(); break; }}
开发者ID:Extraordinary-Beat-X,项目名称:ebx-code,代码行数:37,
示例7: Punkbuster_ConfirmEnable/*=================PunkBuster_Confirm=================*/static void Punkbuster_ConfirmEnable( qboolean result ) { if (result) { trap_SetPbClStatus(1); } g_arenaservers.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "cl_punkbuster" ) );}
开发者ID:ghostmod,项目名称:ioquake3_sql_log,代码行数:12,
示例8: UI_LoadBestScoresvoid UI_LoadBestScores(const char *map, int game) {#ifndef _XBOX char fileName[MAX_QPATH]; fileHandle_t f; postGameInfo_t newInfo; memset(&newInfo, 0, sizeof(postGameInfo_t)); Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game); if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { int size = 0; trap_FS_Read(&size, sizeof(int), f); if (size == sizeof(postGameInfo_t)) { trap_FS_Read(&newInfo, sizeof(postGameInfo_t), f); } trap_FS_FCloseFile(f); } UI_SetBestScores(&newInfo, qfalse); Com_sprintf(fileName, MAX_QPATH, "demos/%s_%d.dm_%d", map, game, (int)trap_Cvar_VariableValue("protocol")); uiInfo.demoAvailable = qfalse; if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { uiInfo.demoAvailable = qtrue; trap_FS_FCloseFile(f); } #endif}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:25,
示例9: UI_SPSkillMenu_SkillEvent/*=================UI_SPSkillMenu_SkillEvent=================*/static void UI_SPSkillMenu_SkillEvent(void *ptr, int notification){ int id; int skill; if (notification != QM_ACTIVATED) return; SetSkillColor((int)trap_Cvar_VariableValue("g_spSkill"), color_red); id = ((menucommon_s*)ptr)->id; skill = id - ID_BABY + 1; trap_Cvar_SetValue("g_spSkill", skill); SetSkillColor(skill, color_white); skillMenuInfo.art_skillPic.shader = skillMenuInfo.skillpics[skill - 1]; if (id == ID_NIGHTMARE) { trap_S_StartLocalSound(skillMenuInfo.nightmareSound, CHAN_ANNOUNCER); } else { trap_S_StartLocalSound(skillMenuInfo.silenceSound, CHAN_ANNOUNCER); }}
开发者ID:ElderPlayerX,项目名称:Invasion,代码行数:31,
示例10: PlayerModel_BuildList/*=======================================================================================================================================PlayerModel_BuildList=======================================================================================================================================*/static void PlayerModel_BuildList(void) { int numdirs; int numfiles; char dirlist[2048]; char filelist[2048]; char skinname[MAX_QPATH]; char *dirptr; char *fileptr; int i; int j; int dirlen; int filelen; qboolean precache; precache = trap_Cvar_VariableValue("com_buildscript"); s_playermodel.modelpage = 0; s_playermodel.nummodels = 0; // iterate directory of all player models numdirs = trap_FS_GetFileList("models/players", "/", dirlist, 2048); dirptr = dirlist; for (i = 0; i < numdirs && s_playermodel.nummodels < MAX_PLAYERMODELS; i++, dirptr += dirlen + 1) { dirlen = strlen(dirptr); if (dirlen && dirptr[dirlen - 1] == '/') { dirptr[dirlen - 1] = '/0'; } if (!strcmp(dirptr, ".") || !strcmp(dirptr, "..")) { continue; } // iterate all skin files in directory numfiles = trap_FS_GetFileList(va("models/players/%s", dirptr), "tga", filelist, 2048); fileptr = filelist; for (j = 0; j < numfiles && s_playermodel.nummodels < MAX_PLAYERMODELS; j++, fileptr += filelen + 1) { filelen = strlen(fileptr); COM_StripExtension(fileptr, skinname, sizeof(skinname)); // look for icon_???? if (!Q_stricmpn(skinname, "icon_", 5)) { Com_sprintf(s_playermodel.modelnames[s_playermodel.nummodels++], sizeof(s_playermodel.modelnames[s_playermodel.nummodels]), "models/players/%s/%s", dirptr, skinname); //if (s_playermodel.nummodels >= MAX_PLAYERMODELS) { // return; //} } if (precache) { trap_S_RegisterSound(va("sound/player/announce/%s_wins.wav", skinname), qfalse); } } } // APSFIXME - Degenerate no models case s_playermodel.numpages = s_playermodel.nummodels / MAX_MODELSPERPAGE; if (s_playermodel.nummodels % MAX_MODELSPERPAGE) { s_playermodel.numpages++; }}
开发者ID:ioid3-games,项目名称:ioid3-q3,代码行数:65,
示例11: UI_SPArena_Startvoid UI_SPArena_Start( const char *arenaInfo ) { char *map; int level; int n; char *txt; n = (int)trap_Cvar_VariableValue( "sv_maxclients" ); if ( n < 8 ) { trap_Cvar_SetValue( "sv_maxclients", 8 ); } level = atoi( Info_ValueForKey( arenaInfo, "num" ) ); txt = Info_ValueForKey( arenaInfo, "special" ); if( txt[0] ) { if( Q_stricmp( txt, "training" ) == 0 ) { level = -4; } else if( Q_stricmp( txt, "final" ) == 0 ) { level = UI_GetNumSPTiers() * ARENAS_PER_TIER; } } trap_Cvar_SetValue( "ui_spSelection", level ); map = Info_ValueForKey( arenaInfo, "map" ); trap_Cmd_ExecuteText( EXEC_APPEND, va( "spmap %s/n", map ) );}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:26,
示例12: G_SpawnBots/*===============G_SpawnBots===============*/static void G_SpawnBots(char *botList, int baseDelay){ char *bot; char *p; float skill; int delay; char bots[MAX_INFO_VALUE]; podium1 = NULL; podium2 = NULL; podium3 = NULL; skill = trap_Cvar_VariableValue("g_spSkill"); if(skill < 1) { trap_Cvar_Set("g_spSkill", "1"); skill = 1; } else if(skill > 5) { trap_Cvar_Set("g_spSkill", "5"); skill = 5; } Q_strncpyz(bots, botList, sizeof(bots)); p = &bots[0]; delay = baseDelay; while(*p) { //skip spaces while(*p && *p == ' ') { p++; } if(!p) { break; } // mark start of bot name bot = p; // skip until space of null while(*p && *p != ' ') { p++; } if(*p) { *p++ = 0; } // we must add the bot this way, calling G_AddBot directly at this stage // does "Bad Things" trap_SendConsoleCommand(EXEC_INSERT, va("addbot %s %f free %i/n", bot, skill, delay)); delay += BOT_BEGIN_DELAY_INCREMENT; }}
开发者ID:otty,项目名称:cake3,代码行数:64,
示例13: StartServer_InGame_Old_Init/*=================StartServer_InGame_Old_Init=================*/static void StartServer_InGame_Old_Init( void ){ int i, j; qboolean disabled; qboolean init; groupinfo_t* group; int type, t; s_itemcontrols_old.enabled = ingame_enabled_old; s_itemcontrols_old.grouptype = ingame_grouptype_old; // get the cvars currently set for (i = 0; i < ITEM_COUNT; i++) { disabled = (int)Com_Clamp(0, 1, trap_Cvar_VariableValue(va("disable_%s", server_itemlist[i].mapitem))); if (disabled) s_itemcontrols_old.enabled[i] = qfalse; else s_itemcontrols_old.enabled[i] = qtrue; } // all groups are custom by default, just in case a group // doesn't have a master control (we want the control visible and editable) for (i = 0; i < ITEMGROUP_COUNT; i++) { s_itemcontrols_old.grouptype[i] = ALLGROUPS_CUSTOM; } // now scan through the master controls to see how they should be setup for (i = 0; i < masterControl_old_Size; i++) { if (!masterControl_old[i].control) continue; // check each group for a contrary enable state init = qfalse; for (j = 0; j < groupInfo_Size; j++) { group = groupInfo[j].group; if (group->ident != masterControl_old[i].ident) continue; t = StartServer_InGame_Old_FindGroupType(group->itemlist, group->size); if (init) { type = t; init = qfalse; } else { if (t != type) type = ALLGROUPS_CUSTOM; } } s_itemcontrols_old.grouptype[ masterControl_old[i].ident ] = type; } StartServer_BothItemPage_Old_InitControls();}
开发者ID:themuffinator,项目名称:fnq3,代码行数:64,
示例14: UI_SPPostgameMenu_Cache/*=================UI_SPPostgameMenu_Cache=================*/void UI_SPPostgameMenu_Cache( void ) { qboolean buildscript; buildscript = trap_Cvar_VariableValue("com_buildscript"); if( buildscript ) { //cache these for the pack file! trap_Cmd_ExecuteText( EXEC_APPEND, "music music/win/n" ); trap_Cmd_ExecuteText( EXEC_APPEND, "music music/loss/n" ); }}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:13,
示例15: UI_DrawLoadPanelvoid UI_DrawLoadPanel(qboolean ownerdraw, qboolean uihack){ static qboolean inside = qfalse; // to avoid a flickering screen on widescreens, we erase it before drawing onto it.. if (((float)(DC->glconfig.vidWidth) / DC->glconfig.vidHeight) != RATIO43) { float xoffset = Cui_WideXoffset() * DC->xscale; trap_R_DrawStretchPic(0, 0, xoffset, DC->glconfig.vidHeight, 0, 0, 1, 1, DC->registerShaderNoMip("gfx/2d/backtile")); trap_R_DrawStretchPic(DC->glconfig.vidWidth - xoffset, 0, xoffset, DC->glconfig.vidHeight, 0, 0, 1, 1, DC->registerShaderNoMip("gfx/2d/backtile")); } if (inside) { if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } return; } connect_ownerdraw = ownerdraw; inside = qtrue; if (!bg_loadscreeninited) { trap_R_RegisterFont("ariblk", 27, &bg_loadscreenfont1); trap_R_RegisterFont("courbd", 30, &bg_loadscreenfont2); BG_PanelButtonsSetup(loadpanelButtons); C_PanelButtonsSetup(loadpanelButtons, Cui_WideXoffset()); // convert to possible widescreen coordinates.. bg_loadscreeninited = qtrue; } BG_PanelButtonsRender(loadpanelButtons); if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } inside = qfalse;}
开发者ID:Classixz,项目名称:etlegacy,代码行数:46,
示例16: UI_LoadBestScoresvoid UI_LoadBestScores(const char *map, int game){ char fileName[MAX_QPATH]; fileHandle_t f; postGameInfo_t newInfo; int protocol, protocolLegacy; memset(&newInfo, 0, sizeof(postGameInfo_t)); Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game); if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { int size = 0; trap_FS_Read(&size, sizeof(int), f); if (size == sizeof(postGameInfo_t)) { trap_FS_Read(&newInfo, sizeof(postGameInfo_t), f); } trap_FS_FCloseFile(f); } UI_SetBestScores(&newInfo, qfalse); uiInfo.demoAvailable = qfalse; protocolLegacy = trap_Cvar_VariableValue("com_legacyprotocol"); protocol = trap_Cvar_VariableValue("com_protocol"); if(!protocol) protocol = trap_Cvar_VariableValue("protocol"); if(protocolLegacy == protocol) protocolLegacy = 0; Com_sprintf(fileName, MAX_QPATH, "demos/%s_%d.%s%d", map, game, DEMOEXT, protocol); if(trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { uiInfo.demoAvailable = qtrue; trap_FS_FCloseFile(f); } else if(protocolLegacy > 0) { Com_sprintf(fileName, MAX_QPATH, "demos/%s_%d.%s%d", map, game, DEMOEXT, protocolLegacy); if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) { uiInfo.demoAvailable = qtrue; trap_FS_FCloseFile(f); } }}
开发者ID:Zekom,项目名称:reaction,代码行数:45,
示例17: ArenaServers_MaxPing/*=================ArenaServers_MaxPing=================*/static int ArenaServers_MaxPing( void ) { int maxPing; maxPing = (int)trap_Cvar_VariableValue( "cl_maxPing" ); if( maxPing < 100 ) { maxPing = 100; } return maxPing;}
开发者ID:ghostmod,项目名称:ioquake3_sql_log,代码行数:14,
示例18: ArenaServers_StartRefresh/*=================ArenaServers_StartRefresh=================*/static void ArenaServers_StartRefresh(qboolean full){ int i; char *ptr;// qtime_t q;// trap_RealTime(&q);// trap_Cvar_Set( va("ui_lastServerRefresh_%i", g_arenaservers.master.curvalue), va("%s-%i, %i at %i:%i", MonthAbbrev[q.tm_mon],q.tm_mday, 1900+q.tm_year,q.tm_hour,q.tm_min)); if (!full) { UI_UpdatePendingPings(); return; } serverStatus.refreshActive = qtrue; serverStatus.nextDisplayRefresh = uis.realtime + 1000; // clear number of displayed servers serverStatus.numDisplayServers = 0; serverStatus.numRefreshedServers = 0; serverStatus.numPlayersOnServers = 0; // reset list g_arenaservers.list.numitems = serverStatus.numDisplayServers; g_arenaservers.list.curvalue = 0; g_arenaservers.list.top = 0; // mark all servers as visible so we store ping updates for them trap_LAN_MarkServerVisible(g_arenaservers.master.curvalue, -1, qtrue); // reset all the pings trap_LAN_ResetPings(g_arenaservers.master.curvalue); // serverStatus.refreshtime = uis.realtime + 1000; if( g_arenaservers.master.curvalue == AS_LOCAL ) { trap_Cmd_ExecuteText( EXEC_NOW, "localservers/n" ); // update menu ArenaServers_UpdateMenu( qfalse ); return; } if( g_arenaservers.master.curvalue == AS_GLOBAL || g_arenaservers.master.curvalue == AS_MPLAYER ) { serverStatus.refreshtime = uis.realtime + 4000; if( g_arenaservers.master.curvalue == AS_GLOBAL ) { i = 0; } else { i = 1; } ptr = UI_Cvar_VariableString("debug_protocol"); if (strlen(ptr)) { trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %s full empty/n", i, ptr)); } else { trap_Cmd_ExecuteText( EXEC_NOW, va( "globalservers %d %d full empty/n", i, (int)trap_Cvar_VariableValue( "protocol" ) ) ); } } // update menu ArenaServers_UpdateMenu( qfalse );}
开发者ID:ElderPlayerX,项目名称:Afterwards,代码行数:62,
示例19: G_AddRandomBot/*===============G_AddRandomBot===============*/void G_AddRandomBot( int team ) { char *teamstr; float skill; skill = trap_Cvar_VariableValue( "g_spSkill" ); if (team == TEAM_RED) teamstr = "red"; else if (team == TEAM_BLUE) teamstr = "blue"; else teamstr = "free"; trap_SendConsoleCommand( EXEC_INSERT, va("addbot random %f %s %i/n", skill, teamstr, 0) );}
开发者ID:eserozvataf,项目名称:q3now,代码行数:15,
示例20: UI_InitGameinfo/*===============UI_InitGameinfo===============*/void UI_InitGameinfo( void ) { UI_InitMemory(); UI_LoadArenas(); UI_LoadBots(); if( (trap_Cvar_VariableValue( "fs_restrict" )) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 2) ) { uis.demoversion = qtrue; } else { uis.demoversion = qfalse; }}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:18,
示例21: Controls_InitCvars/*=================Controls_InitCvars=================*/static void Controls_InitCvars( void ){ int i; configcvar_t* cvarptr; cvarptr = g_configcvars; for (i=0; ;i++,cvarptr++) { if (!cvarptr->name) break; // get current value cvarptr->value = trap_Cvar_VariableValue( cvarptr->name ); // get default value trap_Cvar_Reset( cvarptr->name ); cvarptr->defaultvalue = trap_Cvar_VariableValue( cvarptr->name ); // restore current value trap_Cvar_SetValue( cvarptr->name, cvarptr->value ); }}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:27,
示例22: UI_DrawLoadPanelvoid UI_DrawLoadPanel(qboolean ownerdraw, qboolean uihack){ static qboolean inside = qfalse; if (inside) { if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } return; } connect_ownerdraw = ownerdraw; inside = qtrue; if (!bg_loadscreeninited) { trap_R_RegisterFont("ariblk", 27, &bg_loadscreenfont1); trap_R_RegisterFont("courbd", 30, &bg_loadscreenfont2); BG_PanelButtonsSetup(loadpanelButtons); C_PanelButtonsSetup(loadpanelButtons, Cui_WideXoffset()); // convert to possible widescreen coordinates.. bg_loadscreeninited = qtrue; } BG_PanelButtonsRender(loadpanelButtons); if (!uihack && trap_Cvar_VariableValue("ui_connecting")) { trap_Cvar_Set("ui_connecting", "0"); } inside = qfalse;}
开发者ID:BulldogDrummond,项目名称:etlegacy,代码行数:37,
示例23: UI_RankStatusMenu/*===============UI_RankStatusMenu===============*/void UI_RankStatusMenu(void){ s_status = (grank_status_t)trap_Cvar_VariableValue("client_status"); switch (s_status) { case QGR_STATUS_NEW: return; case QGR_STATUS_PENDING: // GRANK_FIXME return; case QGR_STATUS_NO_USER: // GRANK_FIXME - get this when user exists s_rankstatus_message = "Username unavailable"; break; case QGR_STATUS_BAD_PASSWORD: s_rankstatus_message = "Invalid password"; break; case QGR_STATUS_TIMEOUT: s_rankstatus_message = "Timed out"; break; case QGR_STATUS_NO_MEMBERSHIP: s_rankstatus_message = "No membership"; break; case QGR_STATUS_INVALIDUSER: s_rankstatus_message = "Validation failed"; break; case QGR_STATUS_ERROR: s_rankstatus_message = "Error"; break; case QGR_STATUS_SPECTATOR: case QGR_STATUS_ACTIVE: UI_ForceMenuOff(); return; default: return; } RankStatus_MenuInit(); trap_CL_UI_RankUserReset(); UI_PushMenu (&s_rankstatus.menu);}
开发者ID:ElderPlayerX,项目名称:Invasion,代码行数:47,
示例24: PlayerSettings_SetMenuItems/*=================PlayerSettings_SetMenuItems=================*/static void PlayerSettings_SetMenuItems( void ) { vec3_t viewangles; int c1, c2, c3; int h; char temp[6]; // name Q_strncpyz( s_playersettings.name.field.buffer, UI_Cvar_VariableString("name"), sizeof(s_playersettings.name.field.buffer) ); // effects color trap_Cvar_VariableStringBuffer( "color1", temp, sizeof(temp) ); c1 = atoi( va( "%c", temp[0] ) ) - 1; c2 = atoi( va( "%c", temp[2] ) ) - 1; c3 = atoi( va( "%c", temp[4] ) ) - 1; if ( c1 > 6 || c1 < 0 ) c1 = 6; if ( c2 > 6 || c2 < 0 ) c2 = 6; if ( c3 > 6 || c3 < 0 ) c3 = 6; s_playersettings.effects.curvalue = gamecodetoui[c1]; s_playersettings.effects2.curvalue = gamecodetoui[c2]; s_playersettings.effects3.curvalue = gamecodetoui[c3]; // model/skin memset( &s_playersettings.playerinfo, 0, sizeof(playerInfo_t) ); viewangles[YAW] = 180 - 30; viewangles[PITCH] = 0; viewangles[ROLL] = 0; UI_PlayerInfo_SetModel( &s_playersettings.playerinfo, UI_Cvar_VariableString( "model" ) ); UI_PlayerInfo_SetInfo( &s_playersettings.playerinfo, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_RAILGUN, qfalse ); // handicap h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") ); s_playersettings.handicap.curvalue = 20 - h / 5;}
开发者ID:linux26,项目名称:corkscrew,代码行数:44,
示例25: UI_SPPostgameMenu_Cache/*=================UI_SPPostgameMenu_Cache=================*/void UI_SPPostgameMenu_Cache( void ) { int n; qboolean buildscript; buildscript = trap_Cvar_VariableValue("com_buildscript"); trap_R_RegisterShaderNoMip( ART_MENU0 ); trap_R_RegisterShaderNoMip( ART_MENU1 ); trap_R_RegisterShaderNoMip( ART_REPLAY0 ); trap_R_RegisterShaderNoMip( ART_REPLAY1 ); trap_R_RegisterShaderNoMip( ART_NEXT0 ); trap_R_RegisterShaderNoMip( ART_NEXT1 ); for( n = 0; n < 6; n++ ) { trap_R_RegisterShaderNoMip( ui_medalPicNames[n] ); trap_S_RegisterSound( ui_medalSounds[n], qfalse ); } if( buildscript ) { trap_S_RegisterSound( "music/loss.wav", qfalse ); trap_S_RegisterSound( "music/win.wav", qfalse ); trap_S_RegisterSound( "sound/player/announce/youwin.wav", qfalse ); }}
开发者ID:GregMacPherson,项目名称:Quake-III-Arena,代码行数:28,
注:本文中的trap_Cvar_VariableValue函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ trap_DropClient函数代码示例 C++ trap_Cvar_VariableStringBuffer函数代码示例 |