#include "../ghoul2/G2.h"#include "ui_local.h"#include "../qcommon/qfiles.h"#include "../qcommon/game_version.h"#include "ui_force.h"#include "../cgame/animtable.h"#include "../game/bg_saga.h"#include "..\cgame\holocronicons.h"#include "../namespace_begin.h"#include "../namespace_end.h"Go to the source code of this file.
|
|
|
|
|
Definition at line 5737 of file ui_main.c. Referenced by UI_SaberGetHiltInfo(). |
|
|
Definition at line 936 of file ui_main.c. Referenced by _UI_Refresh(). |
|
|
Definition at line 49 of file ui_main.c.
00050 {
00051 MDS_NONE = 0,
00052 MDS_FORCE_JUMP,
00053 MDS_ROLL,
00054 MDS_SABER,
00055 MDS_MOVE_SOUNDS_MAX
00056 };
|
|
|
Definition at line 58 of file ui_main.c.
00059 {
00060 MD_ACROBATICS = 0,
00061 MD_SINGLE_FAST,
00062 MD_SINGLE_MEDIUM,
00063 MD_SINGLE_STRONG,
00064 MD_DUAL_SABERS,
00065 MD_SABER_STAFF,
00066 MD_MOVE_TITLE_MAX
00067 };
|
|
||||||||||||||||||||||||||||
|
Definition at line 744 of file ui_main.c. References _UI_DrawSides(), _UI_DrawTopBottom(), NULL, and trap_R_SetColor(). Referenced by _UI_Init().
00744 {
00745 trap_R_SetColor( color );
00746
00747 _UI_DrawTopBottom(x, y, width, height, size);
00748 _UI_DrawSides(x, y, width, height, size);
00749
00750 trap_R_SetColor( NULL );
00751 }
|
|
||||||||||||||||||||||||
|
Definition at line 726 of file ui_main.c. References trap_R_DrawStretchPic(), uiInfo_t::uiDC, uiInfo, displayContextDef_t::whiteShader, and displayContextDef_t::xscale. Referenced by _UI_DrawRect(), and _UI_Init().
00726 {
00727 size *= uiInfo.uiDC.xscale;
00728 trap_R_DrawStretchPic( x, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00729 trap_R_DrawStretchPic( x + w - size, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00730 }
|
|
||||||||||||||||||||||||
|
Definition at line 732 of file ui_main.c. References trap_R_DrawStretchPic(), uiInfo_t::uiDC, uiInfo, displayContextDef_t::whiteShader, and displayContextDef_t::yscale. Referenced by _UI_DrawRect(), and _UI_Init().
00732 {
00733 size *= uiInfo.uiDC.yscale;
00734 trap_R_DrawStretchPic( x, y, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00735 trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00736 }
|
|
|
|
Definition at line 10533 of file ui_main.c. References Menus_AnyFullScreenVisible(), and qboolean. Referenced by vmMain().
10533 {
10534 return Menus_AnyFullScreenVisible();
10535 }
|
|
||||||||||||
|
Definition at line 10340 of file ui_main.c. References A_ESCAPE, KEYCATCH_UI, Menu_Count(), Menu_GetFocused(), Menu_HandleKey(), Menus_AnyFullScreenVisible(), Menus_CloseAll(), trap_Cvar_Set(), trap_Key_ClearStates(), trap_Key_GetCatcher(), and trap_Key_SetCatcher(). Referenced by vmMain().
10340 {
10341
10342 if (Menu_Count() > 0) {
10343 menuDef_t *menu = Menu_GetFocused();
10344 if (menu) {
10345 //JLF
10346 #ifdef _XBOX
10347
10348 UpdateDemoTimer();
10349
10350 #endif
10351 if (key == A_ESCAPE && down && !Menus_AnyFullScreenVisible()) {
10352 Menus_CloseAll();
10353 } else {
10354 Menu_HandleKey(menu, key, down );
10355 }
10356 } else {
10357 trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI );
10358 trap_Key_ClearStates();
10359 trap_Cvar_Set( "cl_paused", "0" );
10360 }
10361 }
10362
10363 //if ((s > 0) && (s != menu_null_sound)) {
10364 // trap_S_StartLocalSound( s, CHAN_LOCAL_SOUND );
10365 //}
10366 }
|
|
||||||||||||
|
Definition at line 10374 of file ui_main.c. References displayContextDef_t::cursorx, displayContextDef_t::cursory, Display_MouseMove(), Menu_Count(), NULL, SCREEN_HEIGHT, SCREEN_WIDTH, uiInfo_t::uiDC, and uiInfo. Referenced by vmMain().
10375 {
10376 // update mouse screen position
10377 uiInfo.uiDC.cursorx += dx;
10378 if (uiInfo.uiDC.cursorx < 0)
10379 uiInfo.uiDC.cursorx = 0;
10380 else if (uiInfo.uiDC.cursorx > SCREEN_WIDTH)
10381 uiInfo.uiDC.cursorx = SCREEN_WIDTH;
10382
10383 uiInfo.uiDC.cursory += dy;
10384 if (uiInfo.uiDC.cursory < 0)
10385 uiInfo.uiDC.cursory = 0;
10386 else if (uiInfo.uiDC.cursory > SCREEN_HEIGHT)
10387 uiInfo.uiDC.cursory = SCREEN_HEIGHT;
10388
10389 if (Menu_Count() > 0) {
10390 //menuDef_t *menu = Menu_GetFocused();
10391 //Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
10392 Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
10393 }
10394
10395 }
|
|
|
Definition at line 937 of file ui_main.c. References displayContextDef_t::Assets, bgForcePowerCost, cachedAssets_t::cursor, displayContextDef_t::cursorx, displayContextDef_t::cursory, displayContextDef_t::debug, FORCE_LEVEL_1, FP_SABER_DEFENSE, FP_SABER_OFFENSE, FPMessageTime, displayContextDef_t::FPS, displayContextDef_t::frameTime, vmCvar_t::integer, Menu_Count(), Menu_PaintAll(), NULL, parsedFPMessage, qfalse, displayContextDef_t::realTime, trap_Cvar_Set(), trap_G2API_SetTime(), UI_DrawHandlePic(), UI_FPS_FRAMES, ui_freeSaber, UI_GetStringEdString(), ui_rankChange, UI_ReadLegalForce(), UI_SetColor(), UI_UpdateCvars(), uiInfo_t::uiDC, uiForcePowersRank, uiForceRank, uiInfo, uiMaxRank, and UpdateForceUsed(). Referenced by vmMain().
00938 {
00939 static int index;
00940 static int previousTimes[UI_FPS_FRAMES];
00941
00942 //if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) {
00943 // return;
00944 //}
00945
00946 trap_G2API_SetTime(realtime, 0);
00947 trap_G2API_SetTime(realtime, 1);
00948 //ghoul2 timer must be explicitly updated during ui rendering.
00949
00950 uiInfo.uiDC.frameTime = realtime - uiInfo.uiDC.realTime;
00951 uiInfo.uiDC.realTime = realtime;
00952
00953 previousTimes[index % UI_FPS_FRAMES] = uiInfo.uiDC.frameTime;
00954 index++;
00955 if ( index > UI_FPS_FRAMES ) {
00956 int i, total;
00957 // average multiple frames together to smooth changes out a bit
00958 total = 0;
00959 for ( i = 0 ; i < UI_FPS_FRAMES ; i++ ) {
00960 total += previousTimes[i];
00961 }
00962 if ( !total ) {
00963 total = 1;
00964 }
00965 uiInfo.uiDC.FPS = 1000 * UI_FPS_FRAMES / total;
00966 }
00967
00968
00969
00970 UI_UpdateCvars();
00971
00972 if (Menu_Count() > 0) {
00973 // paint all the menus
00974 Menu_PaintAll();
00975 // refresh server browser list
00976 UI_DoServerRefresh();
00977 // refresh server status
00978 UI_BuildServerStatus(qfalse);
00979 // refresh find player list
00980 UI_BuildFindPlayerList(qfalse);
00981 }
00982 #ifndef _XBOX
00983 // draw cursor
00984 UI_SetColor( NULL );
00985 if (Menu_Count() > 0) {
00986 UI_DrawHandlePic( uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory, 48, 48, uiInfo.uiDC.Assets.cursor);
00987 }
00988 #endif
00989
00990 #ifndef NDEBUG
00991 if (uiInfo.uiDC.debug)
00992 {
00993 // cursor coordinates
00994 //FIXME
00995 //UI_DrawString( 0, 0, va("(%d,%d)",uis.cursorx,uis.cursory), UI_LEFT|UI_SMALLFONT, colorRed );
00996 }
00997 #endif
00998
00999 if (ui_rankChange.integer)
01000 {
01001 FPMessageTime = realtime + 3000;
01002
01003 if (!parsedFPMessage[0] /*&& uiMaxRank > ui_rankChange.integer*/)
01004 {
01005 const char *printMessage = UI_GetStringEdString("MP_INGAME", "SET_NEW_RANK");
01006
01007 int i = 0;
01008 int p = 0;
01009 int linecount = 0;
01010
01011 while (printMessage[i] && p < 1024)
01012 {
01013 parsedFPMessage[p] = printMessage[i];
01014 p++;
01015 i++;
01016 linecount++;
01017
01018 if (linecount > 64 && printMessage[i] == ' ')
01019 {
01020 parsedFPMessage[p] = '\n';
01021 p++;
01022 linecount = 0;
01023 }
01024 }
01025 parsedFPMessage[p] = '\0';
01026 }
01027
01028 //if (uiMaxRank > ui_rankChange.integer)
01029 {
01030 uiMaxRank = ui_rankChange.integer;
01031 uiForceRank = uiMaxRank;
01032
01033 /*
01034 while (x < NUM_FORCE_POWERS)
01035 {
01036 //For now just go ahead and clear force powers upon rank change
01037 uiForcePowersRank[x] = 0;
01038 x++;
01039 }
01040 uiForcePowersRank[FP_LEVITATION] = 1;
01041 uiForceUsed = 0;
01042 */
01043
01044 //Use BG_LegalizedForcePowers and transfer the result into the UI force settings
01045 UI_ReadLegalForce();
01046 }
01047
01048 if (ui_freeSaber.integer && uiForcePowersRank[FP_SABER_OFFENSE] < 1)
01049 {
01050 uiForcePowersRank[FP_SABER_OFFENSE] = 1;
01051 }
01052 if (ui_freeSaber.integer && uiForcePowersRank[FP_SABER_DEFENSE] < 1)
01053 {
01054 uiForcePowersRank[FP_SABER_DEFENSE] = 1;
01055 }
01056 trap_Cvar_Set("ui_rankChange", "0");
01057
01058 //remember to update the force power count after changing the max rank
01059 UpdateForceUsed();
01060 }
01061
01062 if (ui_freeSaber.integer)
01063 {
01064 bgForcePowerCost[FP_SABER_OFFENSE][FORCE_LEVEL_1] = 0;
01065 bgForcePowerCost[FP_SABER_DEFENSE][FORCE_LEVEL_1] = 0;
01066 }
01067 else
01068 {
01069 bgForcePowerCost[FP_SABER_OFFENSE][FORCE_LEVEL_1] = 1;
01070 bgForcePowerCost[FP_SABER_DEFENSE][FORCE_LEVEL_1] = 1;
01071 }
01072
01073 /*
01074 if (parsedFPMessage[0] && FPMessageTime > realtime)
01075 {
01076 vec4_t txtCol;
01077 int txtStyle = ITEM_TEXTSTYLE_SHADOWED;
01078
01079 if ((FPMessageTime - realtime) < 2000)
01080 {
01081 txtCol[0] = colorWhite[0];
01082 txtCol[1] = colorWhite[1];
01083 txtCol[2] = colorWhite[2];
01084 txtCol[3] = (((float)FPMessageTime - (float)realtime)/2000);
01085
01086 txtStyle = 0;
01087 }
01088 else
01089 {
01090 txtCol[0] = colorWhite[0];
01091 txtCol[1] = colorWhite[1];
01092 txtCol[2] = colorWhite[2];
01093 txtCol[3] = colorWhite[3];
01094 }
01095
01096 Text_Paint(10, 0, 1, txtCol, parsedFPMessage, 0, 1024, txtStyle, FONT_MEDIUM);
01097 }
01098 */
01099 //For now, don't bother.
01100 }
|
|
|
Definition at line 10406 of file ui_main.c. References GT_TEAM, uiInfo_t::inGameLoad, vmCvar_t::integer, KEYCATCH_UI, Menu_Count(), Menus_ActivateByName(), Menus_CloseAll(), qboolean, qfalse, qtrue, trap_Cvar_Set(), trap_Cvar_VariableStringBuffer(), trap_Cvar_VariableValue(), trap_Key_ClearStates(), trap_Key_GetCatcher(), trap_Key_SetCatcher(), ui_singlePlayerActive, uiInfo, UIMENU_CLASSSEL, UIMENU_CLOSEALL, UIMENU_INGAME, UIMENU_MAIN, UIMENU_NONE, UIMENU_PLAYERCONFIG, UIMENU_PLAYERFORCE, UIMENU_POSTGAME, UIMENU_SIEGEMESSAGE, UIMENU_SIEGEOBJECTIVES, UIMENU_TEAM, UIMENU_VOICECHAT, uiMenuCommand_t, UpdateForceUsed(), and vec3_t. Referenced by UI_ShowPostGame(), and vmMain().
10406 {
10407 char buf[256];
10408
10409 // this should be the ONLY way the menu system is brought up
10410 // enusure minumum menu data is cached
10411 if (Menu_Count() > 0) {
10412 vec3_t v;
10413 v[0] = v[1] = v[2] = 0;
10414 switch ( menu ) {
10415 case UIMENU_NONE:
10416 trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI );
10417 trap_Key_ClearStates();
10418 trap_Cvar_Set( "cl_paused", "0" );
10419 Menus_CloseAll();
10420
10421 return;
10422 case UIMENU_MAIN:
10423 {
10424 qboolean active = qfalse;
10425
10426 //trap_Cvar_Set( "sv_killserver", "1" );
10427 trap_Key_SetCatcher( KEYCATCH_UI );
10428 //trap_S_StartLocalSound( trap_S_RegisterSound("sound/misc/menu_background.wav", qfalse) , CHAN_LOCAL_SOUND );
10429 //trap_S_StartBackgroundTrack("sound/misc/menu_background.wav", NULL);
10430 if (uiInfo.inGameLoad)
10431 {
10432 // UI_LoadNonIngame();
10433 }
10434
10435 Menus_CloseAll();
10436 Menus_ActivateByName("main");
10437 trap_Cvar_VariableStringBuffer("com_errorMessage", buf, sizeof(buf));
10438
10439 if (buf[0])
10440 {
10441 if (!ui_singlePlayerActive.integer)
10442 {
10443 #ifdef _XBOX
10444 // Display Xbox popups after an ERR_DROP?
10445 UI_xboxErrorPopup( XB_POPUP_COM_ERROR );
10446 #else
10447 Menus_ActivateByName("error_popmenu");
10448 #endif
10449 active = qtrue;
10450 }
10451 else
10452 {
10453 trap_Cvar_Set("com_errorMessage", "");
10454 }
10455 }
10456 return;
10457 }
10458
10459 case UIMENU_TEAM:
10460 trap_Key_SetCatcher( KEYCATCH_UI );
10461 Menus_ActivateByName("team");
10462 return;
10463 case UIMENU_POSTGAME:
10464 //trap_Cvar_Set( "sv_killserver", "1" );
10465 trap_Key_SetCatcher( KEYCATCH_UI );
10466 if (uiInfo.inGameLoad) {
10467 // UI_LoadNonIngame();
10468 }
10469 Menus_CloseAll();
10470 Menus_ActivateByName("endofgame");
10471 //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction );
10472 return;
10473 case UIMENU_INGAME:
10474 trap_Cvar_Set( "cl_paused", "1" );
10475 trap_Key_SetCatcher( KEYCATCH_UI );
10476 UI_BuildPlayerList();
10477 Menus_CloseAll();
10478 Menus_ActivateByName("ingame");
10479 return;
10480 case UIMENU_PLAYERCONFIG:
10481 // trap_Cvar_Set( "cl_paused", "1" );
10482 trap_Key_SetCatcher( KEYCATCH_UI );
10483 UI_BuildPlayerList();
10484 Menus_CloseAll();
10485 Menus_ActivateByName("ingame_player");
10486 UpdateForceUsed();
10487 return;
10488 case UIMENU_PLAYERFORCE:
10489 // trap_Cvar_Set( "cl_paused", "1" );
10490 trap_Key_SetCatcher( KEYCATCH_UI );
10491 UI_BuildPlayerList();
10492 Menus_CloseAll();
10493 Menus_ActivateByName("ingame_playerforce");
10494 UpdateForceUsed();
10495 return;
10496 case UIMENU_SIEGEMESSAGE:
10497 // trap_Cvar_Set( "cl_paused", "1" );
10498 trap_Key_SetCatcher( KEYCATCH_UI );
10499 Menus_CloseAll();
10500 Menus_ActivateByName("siege_popmenu");
10501 return;
10502 case UIMENU_SIEGEOBJECTIVES:
10503 // trap_Cvar_Set( "cl_paused", "1" );
10504 trap_Key_SetCatcher( KEYCATCH_UI );
10505 Menus_CloseAll();
10506 Menus_ActivateByName("ingame_siegeobjectives");
10507 return;
10508 case UIMENU_VOICECHAT:
10509 // trap_Cvar_Set( "cl_paused", "1" );
10510 // No chatin non-siege games.
10511
10512 if (trap_Cvar_VariableValue( "g_gametype" ) < GT_TEAM)
10513 {
10514 return;
10515 }
10516
10517 trap_Key_SetCatcher( KEYCATCH_UI );
10518 Menus_CloseAll();
10519 Menus_ActivateByName("ingame_voicechat");
10520 return;
10521 case UIMENU_CLOSEALL:
10522 Menus_CloseAll();
10523 return;
10524 case UIMENU_CLASSSEL:
10525 trap_Key_SetCatcher( KEYCATCH_UI );
10526 Menus_CloseAll();
10527 Menus_ActivateByName("ingame_siegeclass");
10528 return;
10529 }
10530 }
10531 }
|
|
|
Definition at line 1111 of file ui_main.c. References trap_LAN_SaveCachedServers(), and UI_CleanupGhoul2(). Referenced by vmMain().
01111 {
01112 trap_LAN_SaveCachedServers();
01113 UI_CleanupGhoul2();
01114 }
|
|
|
Definition at line 1142 of file ui_main.c. References displayContextDef_t::Assets, COM_ParseExt(), Com_Printf(), cachedAssets_t::cursor, cachedAssets_t::cursorStr, cachedAssets_t::datapadmoveSaberSound1, cachedAssets_t::datapadmoveSaberSound2, cachedAssets_t::datapadmoveSaberSound3, cachedAssets_t::datapadmoveSaberSound4, cachedAssets_t::datapadmoveSaberSound5, cachedAssets_t::datapadmoveSaberSound6, cachedAssets_t::fadeAmount, cachedAssets_t::fadeClamp, cachedAssets_t::fadeCycle, cachedAssets_t::fontRegistered, cachedAssets_t::gradientBar, cachedAssets_t::itemFocusSound, memset(), cachedAssets_t::menuBuzzSound, cachedAssets_t::menuEnterSound, cachedAssets_t::menuExitSound, cachedAssets_t::moveJumpSound, cachedAssets_t::moveRollSound, PC_Color_Parse(), PC_Float_Parse(), PC_Int_Parse(), PC_Script_Parse(), PC_String_Parse(), pc_token_t, Q_stricmp(), qboolean, qfalse, cachedAssets_t::qhBigFont, cachedAssets_t::qhMediumFont, cachedAssets_t::qhSmall2Font, cachedAssets_t::qhSmallFont, qtrue, S_COLOR_YELLOW, cachedAssets_t::shadowColor, cachedAssets_t::shadowFadeClamp, cachedAssets_t::shadowX, cachedAssets_t::shadowY, pc_token_s::string, trap_PC_ReadToken(), trap_R_RegisterFont(), trap_R_RegisterShaderNoMip(), trap_S_RegisterSound(), uiInfo_t::uiDC, and uiInfo. Referenced by UI_ParseMenu().
01142 {
01143 pc_token_t token;
01144
01145 if (!trap_PC_ReadToken(handle, &token))
01146 return qfalse;
01147 if (Q_stricmp(token.string, "{") != 0) {
01148 return qfalse;
01149 }
01150
01151 while ( 1 ) {
01152
01153 memset(&token, 0, sizeof(pc_token_t));
01154
01155 if (!trap_PC_ReadToken(handle, &token))
01156 return qfalse;
01157
01158 if (Q_stricmp(token.string, "}") == 0) {
01159 return qtrue;
01160 }
01161
01162 // font
01163 if (Q_stricmp(token.string, "font") == 0) {
01164 int pointSize;
01165 if (!trap_PC_ReadToken(handle, &token) || !PC_Int_Parse(handle,&pointSize)) {
01166 return qfalse;
01167 }
01168 //trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.textFont);
01169 uiInfo.uiDC.Assets.qhMediumFont = trap_R_RegisterFont(token.string);
01170 uiInfo.uiDC.Assets.fontRegistered = qtrue;
01171 continue;
01172 }
01173
01174 if (Q_stricmp(token.string, "smallFont") == 0) {
01175 int pointSize;
01176 if (!trap_PC_ReadToken(handle, &token) || !PC_Int_Parse(handle,&pointSize)) {
01177 return qfalse;
01178 }
01179 //trap_R_RegisterFont(token, pointSize, &uiInfo.uiDC.Assets.smallFont);
01180 uiInfo.uiDC.Assets.qhSmallFont = trap_R_RegisterFont(token.string);
01181 continue;
01182 }
01183
01184 if (Q_stricmp(token.string, "small2Font") == 0) {
01185 int pointSize;
01186 if (!trap_PC_ReadToken(handle, &token) || !PC_Int_Parse(handle,&pointSize)) {
01187 return qfalse;
01188 }
01189 //trap_R_RegisterFont(token, pointSize, &uiInfo.uiDC.Assets.smallFont);
01190 uiInfo.uiDC.Assets.qhSmall2Font = trap_R_RegisterFont(token.string);
01191 continue;
01192 }
01193
01194 if (Q_stricmp(token.string, "bigFont") == 0) {
01195 int pointSize;
01196 if (!trap_PC_ReadToken(handle, &token) || !PC_Int_Parse(handle,&pointSize)) {
01197 return qfalse;
01198 }
01199 //trap_R_RegisterFont(token, pointSize, &uiInfo.uiDC.Assets.bigFont);
01200 uiInfo.uiDC.Assets.qhBigFont = trap_R_RegisterFont(token.string);
01201 continue;
01202 }
01203
01204 if (Q_stricmp(token.string, "cursor") == 0)
01205 {
01206 if (!PC_String_Parse(handle, &uiInfo.uiDC.Assets.cursorStr))
01207 {
01208 Com_Printf(S_COLOR_YELLOW,"Bad 1st parameter for keyword 'cursor'");
01209 return qfalse;
01210 }
01211 uiInfo.uiDC.Assets.cursor = trap_R_RegisterShaderNoMip( uiInfo.uiDC.Assets.cursorStr);
01212 continue;
01213 }
01214
01215 // gradientbar
01216 if (Q_stricmp(token.string, "gradientbar") == 0) {
01217 if (!trap_PC_ReadToken(handle, &token)) {
01218 return qfalse;
01219 }
01220 uiInfo.uiDC.Assets.gradientBar = trap_R_RegisterShaderNoMip(token.string);
01221 continue;
01222 }
01223
01224 // enterMenuSound
01225 if (Q_stricmp(token.string, "menuEnterSound") == 0) {
01226 if (!trap_PC_ReadToken(handle, &token)) {
01227 return qfalse;
01228 }
01229 uiInfo.uiDC.Assets.menuEnterSound = trap_S_RegisterSound( token.string );
01230 continue;
01231 }
01232
01233 // exitMenuSound
01234 if (Q_stricmp(token.string, "menuExitSound") == 0) {
01235 if (!trap_PC_ReadToken(handle, &token)) {
01236 return qfalse;
01237 }
01238 uiInfo.uiDC.Assets.menuExitSound = trap_S_RegisterSound( token.string );
01239 continue;
01240 }
01241
01242 // itemFocusSound
01243 if (Q_stricmp(token.string, "itemFocusSound") == 0) {
01244 if (!trap_PC_ReadToken(handle, &token)) {
01245 return qfalse;
01246 }
01247 uiInfo.uiDC.Assets.itemFocusSound = trap_S_RegisterSound( token.string );
01248 continue;
01249 }
01250
01251 // menuBuzzSound
01252 if (Q_stricmp(token.string, "menuBuzzSound") == 0) {
01253 if (!trap_PC_ReadToken(handle, &token)) {
01254 return qfalse;
01255 }
01256 uiInfo.uiDC.Assets.menuBuzzSound = trap_S_RegisterSound( token.string );
01257 continue;
01258 }
01259
01260 if (Q_stricmp(token.string, "fadeClamp") == 0) {
01261 if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.fadeClamp)) {
01262 return qfalse;
01263 }
01264 continue;
01265 }
01266
01267 if (Q_stricmp(token.string, "fadeCycle") == 0) {
01268 if (!PC_Int_Parse(handle, &uiInfo.uiDC.Assets.fadeCycle)) {
01269 return qfalse;
01270 }
01271 continue;
01272 }
01273
01274 if (Q_stricmp(token.string, "fadeAmount") == 0) {
01275 if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.fadeAmount)) {
01276 return qfalse;
01277 }
01278 continue;
01279 }
01280
01281 if (Q_stricmp(token.string, "shadowX") == 0) {
01282 if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.shadowX)) {
01283 return qfalse;
01284 }
01285 continue;
01286 }
01287
01288 if (Q_stricmp(token.string, "shadowY") == 0) {
01289 if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.shadowY)) {
01290 return qfalse;
01291 }
01292 continue;
01293 }
01294
01295 if (Q_stricmp(token.string, "shadowColor") == 0) {
01296 if (!PC_Color_Parse(handle, &uiInfo.uiDC.Assets.shadowColor)) {
01297 return qfalse;
01298 }
01299 uiInfo.uiDC.Assets.shadowFadeClamp = uiInfo.uiDC.Assets.shadowColor[3];
01300 continue;
01301 }
01302
01303 if (Q_stricmp(token.string, "moveRollSound") == 0)
01304 {
01305 if (trap_PC_ReadToken(handle,&token))
01306 {
01307 uiInfo.uiDC.Assets.moveRollSound = trap_S_RegisterSound( token.string );
01308 }
01309 continue;
01310 }
01311
01312 if (Q_stricmp(token.string, "moveJumpSound") == 0)
01313 {
01314 if (trap_PC_ReadToken(handle,&token))
01315 {
01316 uiInfo.uiDC.Assets.moveJumpSound = trap_S_RegisterSound( token.string );
01317 }
01318
01319 continue;
01320 }
01321 if (Q_stricmp(token.string, "datapadmoveSaberSound1") == 0)
01322 {
01323 if (trap_PC_ReadToken(handle,&token))
01324 {
01325 uiInfo.uiDC.Assets.datapadmoveSaberSound1 = trap_S_RegisterSound( token.string );
01326 }
01327
01328 continue;
01329 }
01330
01331 if (Q_stricmp(token.string, "datapadmoveSaberSound2") == 0)
01332 {
01333 if (trap_PC_ReadToken(handle,&token))
01334 {
01335 uiInfo.uiDC.Assets.datapadmoveSaberSound2 = trap_S_RegisterSound( token.string );
01336 }
01337
01338 continue;
01339 }
01340
01341 if (Q_stricmp(token.string, "datapadmoveSaberSound3") == 0)
01342 {
01343 if (trap_PC_ReadToken(handle,&token))
01344 {
01345 uiInfo.uiDC.Assets.datapadmoveSaberSound3 = trap_S_RegisterSound( token.string );
01346 }
01347
01348 continue;
01349 }
01350
01351 if (Q_stricmp(token.string, "datapadmoveSaberSound4") == 0)
01352 {
01353 if (trap_PC_ReadToken(handle,&token))
01354 {
01355 uiInfo.uiDC.Assets.datapadmoveSaberSound4 = trap_S_RegisterSound( token.string );
01356 }
01357
01358 continue;
01359 }
01360
01361 if (Q_stricmp(token.string, "datapadmoveSaberSound5") == 0)
01362 {
01363 if (trap_PC_ReadToken(handle,&token))
01364 {
01365 uiInfo.uiDC.Assets.datapadmoveSaberSound5 = trap_S_RegisterSound( token.string );
01366 }
01367
01368 continue;
01369 }
01370
01371 if (Q_stricmp(token.string, "datapadmoveSaberSound6") == 0)
01372 {
01373 if (trap_PC_ReadToken(handle,&token))
01374 {
01375 uiInfo.uiDC.Assets.datapadmoveSaberSound6 = trap_S_RegisterSound( token.string );
01376 }
01377
01378 continue;
01379 }
01380
01381
01382 // precaching various sound files used in the menus
01383 if (Q_stricmp(token.string, "precacheSound") == 0)
01384 {
01385 const char *tempStr;
01386 if (PC_Script_Parse(handle, &tempStr))
01387 {
01388 char *soundFile;
01389 do
01390 {
01391 soundFile = COM_ParseExt(&tempStr, qfalse);
01392 if (soundFile[0] != 0 && soundFile[0] != ';') {
01393 trap_S_RegisterSound( soundFile);
01394 }
01395 } while (soundFile[0]);
01396 }
01397 continue;
01398 }
01399 }
01400 return qfalse;
01401 }
|
|
|
||||||||||||||||
|
Definition at line 1153 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, and siegeClass_t::playerClass. Referenced by UI_UpdateCvarsForClass().
01154 {
01155 int count = 0,i;
01156 siegeTeam_t *stm;
01157
01158 stm = BG_SiegeFindThemeForTeam(team);
01159 if (!stm)
01160 {
01161 return(0);
01162 }
01163
01164 // Loop through all the classes for this team
01165 for (i=0;i<stm->numClasses;i++)
01166 {
01167 // does it match the base class?
01168 if (stm->classes[i]->playerClass == classIndex)
01169 {
01170 if (count==cntIndex)
01171 {
01172 return(stm->classes[i]);
01173 }
01174 ++count;
01175 }
01176 }
01177
01178 return(0);
01179 }
|
|
||||||||||||||||
|
Definition at line 1123 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, siegeClass_t::playerClass, and siegeClass_t::uiPortraitShader.
01124 {
01125 int count = 0,i;
01126 siegeTeam_t *stm;
01127
01128 stm = BG_SiegeFindThemeForTeam(team);
01129 if (!stm)
01130 {
01131 return(0);
01132
01133 }
01134
01135 // Loop through all the classes for this team
01136 for (i=0;i<stm->numClasses;i++)
01137 {
01138 // does it match the base class?
01139 if (stm->classes[i]->playerClass == classIndex)
01140 {
01141 if (count==cntIndex)
01142 {
01143 return(stm->classes[i]->uiPortraitShader);
01144 }
01145 ++count;
01146 }
01147 }
01148
01149 return(0);
01150 }
|
|
||||||||||||||||
|
Definition at line 1094 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, siegeClass_t::playerClass, and siegeClass_t::uiPortrait. Referenced by UI_UpdateCvarsForClass().
01095 {
01096 int count = 0,i;
01097 siegeTeam_t *stm;
01098
01099 stm = BG_SiegeFindThemeForTeam(team);
01100 if (!stm)
01101 {
01102 return(0);
01103
01104 }
01105
01106 // Loop through all the classes for this team
01107 for (i=0;i<stm->numClasses;i++)
01108 {
01109 // does it match the base class?
01110 if (stm->classes[i]->playerClass == classIndex)
01111 {
01112 if (count==cntIndex)
01113 {
01114 return(stm->classes[i]->uiPortrait);
01115 }
01116 ++count;
01117 }
01118 }
01119
01120 return(0);
01121 }
|
|
||||||||||||
|
Definition at line 1071 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, and siegeClass_t::playerClass. Referenced by UI_UpdateCvarsForClass().
01072 {
01073 int count = 0,i;
01074 siegeTeam_t *stm;
01075
01076 stm = BG_SiegeFindThemeForTeam(team);
01077 if (!stm)
01078 {
01079 return(0);
01080
01081 }
01082
01083 for (i=0;i<stm->numClasses;i++)
01084 {
01085
01086 if (stm->classes[i]->playerClass == classIndex)
01087 {
01088 count++;
01089 }
01090 }
01091 return(count);
01092 }
|
|
|
Definition at line 1118 of file ui_main.c. References defaultMenu, fileHandle_t, FS_READ, MAX_MENUFILE, S_COLOR_RED, trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), trap_Print(), and va().
01118 {
01119 int len;
01120 fileHandle_t f;
01121 static char buf[MAX_MENUFILE];
01122
01123 len = trap_FS_FOpenFile( filename, &f, FS_READ );
01124 if ( !f ) {
01125 trap_Print( va( S_COLOR_RED "menu file not found: %s, using default\n", filename ) );
01126 return defaultMenu;
01127 }
01128 if ( len >= MAX_MENUFILE ) {
01129 trap_Print( va( S_COLOR_RED "menu file too large: %s is %i, max allowed is %i", filename, len, MAX_MENUFILE ) );
01130 trap_FS_FCloseFile( f );
01131 return defaultMenu;
01132 }
01133
01134 trap_FS_Read( buf, len, f );
01135 buf[len] = 0;
01136 trap_FS_FCloseFile( f );
01137 //COM_Compress(buf);
01138 return buf;
01139
01140 }
|
|
||||||||||||
|
Definition at line 2306 of file ui_shared.c. References commandList, DC, commandDef_t::handler, itemDef_t, name, Q_strcat(), Q_stricmp(), qboolean, qfalse, qtrue, displayContextDef_t::runScript, scriptCommandCount, and String_Parse().
02307 {
02308 char script[2048], *p;
02309 int i;
02310 qboolean bRan;
02311
02312 script[0] = 0;
02313
02314 if (item && s && s[0])
02315 {
02316 Q_strcat(script, 2048, s);
02317 p = script;
02318
02319 while (1)
02320 {
02321 const char *command;
02322
02323 // expect command then arguments, ; ends command, NULL ends script
02324 if (!String_Parse(&p, &command))
02325 {
02326 return;
02327 }
02328
02329 if (command[0] == ';' && command[1] == '\0')
02330 {
02331 continue;
02332 }
02333
02334 bRan = qfalse;
02335 for (i = 0; i < scriptCommandCount; i++)
02336 {
02337 if (Q_stricmp(command, commandList[i].name) == 0)
02338 {
02339 // Allow a script command to stop processing the script
02340 if ( !commandList[i].handler(item, &p) )
02341 {
02342 return;
02343 }
02344
02345 bRan = qtrue;
02346 break;
02347 }
02348 }
02349
02350 // not in our auto list, pass to handler
02351 if (!bRan)
02352 {
02353 DC->runScript(&p);
02354 }
02355 }
02356 }
02357 }
|
|
||||||||||||||||
|
Definition at line 7567 of file ui_shared.c. References animation_t, bgLoadedAnim_t::anims, itemDef_s::asset, bgAllAnims, BONE_ANIM_OVERRIDE_FREEZE, BONE_ANIM_OVERRIDE_LOOP, DC, animation_s::firstFrame, itemDef_s::flags, animation_s::frameLerp, modelDef_s::g2anim, modelDef_s::g2skin, itemDef_s::ghoul2, Item_ValidateTypeData(), itemDef_t, ITF_G2VALID, animation_s::loopFrames, MAX_QPATH, modelDef_t, name, NULL, animation_s::numFrames, Q_stricmp(), Q_strrchr(), qboolean, qfalse, qtrue, displayContextDef_t::realTime, displayContextDef_t::registerModel, strcpy(), strlen(), trap_G2API_CleanGhoul2Models(), trap_G2API_GetGLAName(), trap_G2API_InitGhoul2Model(), trap_G2API_SetBoneAnim(), trap_G2API_SetSkin(), itemDef_s::typeData, UI_ClearG2Pointer(), UI_InsertG2Pointer(), and UI_ParseAnimationFile().
07568 {
07569 #ifndef CGAME
07570 int g2Model;
07571 modelDef_t *modelPtr;
07572 Item_ValidateTypeData(item);
07573 modelPtr = (modelDef_t*)item->typeData;
07574 *runTimeLength =0.0f;
07575
07576 if (!Q_stricmp(&name[strlen(name) - 4], ".glm"))
07577 { //it's a ghoul2 model then
07578 if ( item->ghoul2 )
07579 {
07580 UI_ClearG2Pointer(item->ghoul2); //remove from tracking list
07581 trap_G2API_CleanGhoul2Models(&item->ghoul2); //remove ghoul info
07582 item->flags &= ~ITF_G2VALID;
07583 }
07584
07585 g2Model = trap_G2API_InitGhoul2Model(&item->ghoul2, name, 0, modelPtr->g2skin, 0, 0, 0);
07586 if (g2Model >= 0)
07587 {
07588 UI_InsertG2Pointer(item->ghoul2); //remember it so we can free it when the ui shuts down.
07589 item->flags |= ITF_G2VALID;
07590
07591 if (modelPtr->g2anim)
07592 { //does the menu request this model be playing an animation?
07593 // DC->g2hilev_SetAnim(&item->ghoul2[0], "model_root", modelPtr->g2anim);
07594
07595 char GLAName[MAX_QPATH];
07596
07597 GLAName[0] = 0;
07598 trap_G2API_GetGLAName(item->ghoul2, 0, GLAName);
07599
07600 if (GLAName[0])
07601 {
07602 int animIndex;
07603 char *slash;
07604
07605 slash = Q_strrchr( GLAName, '/' );
07606
07607 if ( slash )
07608 { //If this isn't true the gla path must be messed up somehow.
07609 strcpy(slash, "/animation.cfg");
07610
07611 animIndex = UI_ParseAnimationFile(GLAName, NULL, qfalse);
07612 if (animIndex != -1)
07613 { //We parsed out the animation info for whatever model this is
07614 animation_t *anim = &bgAllAnims[animIndex].anims[modelPtr->g2anim];
07615
07616 int sFrame = anim->firstFrame;
07617 int eFrame = anim->firstFrame + anim->numFrames;
07618 int flags = BONE_ANIM_OVERRIDE_FREEZE;
07619 int time = DC->realTime;
07620 float animSpeed = 50.0f / anim->frameLerp;
07621 int blendTime = 150;
07622
07623 if (anim->loopFrames != -1)
07624 {
07625 flags |= BONE_ANIM_OVERRIDE_LOOP;
07626 }
07627
07628 trap_G2API_SetBoneAnim(item->ghoul2, 0, "model_root", sFrame, eFrame, flags, animSpeed, time, -1, blendTime);
07629 *runTimeLength =((anim->frameLerp * (anim->numFrames-2)));
07630 }
07631 }
07632 }
07633 }
07634
07635 if ( modelPtr->g2skin )
07636 {
07637 // DC->g2_SetSkin( &item->ghoul2[0], 0, modelPtr->g2skin );//this is going to set the surfs on/off matching the skin file
07638 //trap_G2API_InitGhoul2Model(&item->ghoul2, name, 0, modelPtr->g2skin, 0, 0, 0);
07639 //ahh, what are you doing?!
07640 trap_G2API_SetSkin(item->ghoul2, 0, modelPtr->g2skin, modelPtr->g2skin);
07641 }
07642 }
07643 /*
07644 else
07645 {
07646 Com_Error(ERR_FATAL, "%s does not exist.", name);
07647 }
07648 */
07649 }
07650 else if(!(item->asset))
07651 { //guess it's just an md3
07652 item->asset = DC->registerModel(name);
07653 item->flags &= ~ITF_G2VALID;
07654 }
07655 #endif
07656 return qtrue;
07657 }
|
|
||||||||||||
|
Definition at line 7894 of file ui_shared.c. References animTable, Com_Printf(), modelDef_s::g2anim, stringID_table_s::id, Item_ValidateTypeData(), itemDef_t, MAX_ANIMATIONS, modelDef_t, name, Q_stricmp(), qboolean, qtrue, and itemDef_s::typeData.
07895 {
07896 modelDef_t *modelPtr;
07897 int i = 0;
07898
07899 Item_ValidateTypeData(item);
07900 modelPtr = (modelDef_t*)item->typeData;
07901
07902 if (!animName || !animName[0])
07903 { //it was parsed correctly so still return true.
07904 return qtrue;
07905 }
07906
07907 while (i < MAX_ANIMATIONS)
07908 {
07909 if (!Q_stricmp(animName, animTable[i].name))
07910 { //found it
07911 modelPtr->g2anim = animTable[i].id;
07912 return qtrue;
07913 }
07914 i++;
07915 }
07916
07917 Com_Printf("Could not find '%s' in the anim table\n", animName);
07918 return qtrue;
07919 }
|
|
||||||||||||
|
Definition at line 7865 of file ui_shared.c. References modelDef_s::g2skin, itemDef_s::ghoul2, Item_ValidateTypeData(), itemDef_t, modelDef_t, qboolean, qtrue, trap_G2API_SetSkin(), trap_R_RegisterSkin(), and itemDef_s::typeData. Referenced by UI_UpdateCharacterSkin().
07866 {
07867
07868 modelDef_t *modelPtr;
07869 int defSkin;
07870
07871
07872 Item_ValidateTypeData(item);
07873 modelPtr = (modelDef_t*)item->typeData;
07874
07875 if (!skinName || !skinName[0])
07876 { //it was parsed correctly so still return true.
07877 modelPtr->g2skin = 0;
07878 trap_G2API_SetSkin(item->ghoul2, 0, 0, 0);
07879
07880 return qtrue;
07881 }
07882
07883 // set skin
07884 if ( item->ghoul2 )
07885 {
07886 defSkin = trap_R_RegisterSkin(skinName);
07887 trap_G2API_SetSkin(item->ghoul2, 0, defSkin, defSkin);
07888 }
07889
07890 return qtrue;
07891 }
|
|
|
Definition at line 1457 of file ui_main.c. References pc_token_t, qboolean, qfalse, qtrue, pc_token_s::string, trap_PC_ReadToken(), and UI_ParseMenu(). Referenced by UI_LoadMenus().
01457 {
01458 pc_token_t token;
01459
01460 if (!trap_PC_ReadToken(handle, &token))
01461 return qfalse;
01462 if (token.string[0] != '{') {
01463 return qfalse;
01464 }
01465
01466 while ( 1 ) {
01467
01468 if (!trap_PC_ReadToken(handle, &token))
01469 return qfalse;
01470
01471 if ( token.string[0] == 0 ) {
01472 return qfalse;
01473 }
01474
01475 if ( token.string[0] == '}' ) {
01476 return qtrue;
01477 }
01478
01479 UI_ParseMenu(token.string);
01480 }
01481 return qfalse;
01482 }
|
|
||||||||||||||||
|
Definition at line 1049 of file ui_shared.c. References windowDef_t::group, menuDef_t::itemCount, itemDef_t, menuDef_t::items, windowDef_t::name, name, NULL, Q_stricmp(), and itemDef_s::window. Referenced by Menu_FadeItemByName(), Menu_ItemDisable(), Menu_OrbitItemByName(), Menu_SetItemBackground(), Menu_SetItemText(), Menu_ShowGroup(), Menu_ShowItemByName(), Menu_Transition3ItemByName(), Menu_TransitionItemByName(), Script_Scale(), Script_SetItemColor(), Script_SetItemColorCvar(), and Script_SetItemRect().
01049 {
01050 int i;
01051 int count = 0;
01052 for (i = 0; i < menu->itemCount; i++) {
01053 if (Q_stricmp(menu->items[i]->window.name, name) == 0 || (menu->items[i]->window.group && Q_stricmp(menu->items[i]->window.group, name) == 0)) {
01054 if (count == index) {
01055 return menu->items[i];
01056 }
01057 count++;
01058 }
01059 }
01060 return NULL;
01061 }
|
|
||||||||||||||||
|
Definition at line 1845 of file ui_shared.c. References itemDef_s::disabled, windowDef_t::flags, itemDef_t, Menu_GetMatchingItemByNumber(), Menu_ItemsMatchingGroup(), name, NULL, itemDef_s::window, and WINDOW_MOUSEOVER. Referenced by Script_Disable().
01846 {
01847 int j,count;
01848 itemDef_t *itemFound;
01849
01850 count = Menu_ItemsMatchingGroup(menu, name);
01851 // Loop through all items that have this name
01852 for (j = 0; j < count; j++)
01853 {
01854 itemFound = Menu_GetMatchingItemByNumber( menu, j, name);
01855 if (itemFound != NULL)
01856 {
01857 itemFound->disabled = disableFlag;
01858 // Just in case it had focus
01859 itemFound->window.flags &= ~WINDOW_MOUSEOVER;
01860 }
01861 }
01862 }
|
|
||||||||||||
|
||||||||||||||||
|
Definition at line 1444 of file ui_shared.c. References windowDef_t::flags, itemDef_t, Menu_GetMatchingItemByNumber(), Menu_ItemsMatchingGroup(), NULL, itemDef_s::window, WINDOW_HASFOCUS, and WINDOW_VISIBLE. Referenced by UI_UpdateSiegeObjectiveGraphics().
01445 {
01446 itemDef_t *item;
01447 int count,j;
01448
01449 count = Menu_ItemsMatchingGroup( menu, groupName);
01450 for (j = 0; j < count; j++)
01451 {
01452 item = Menu_GetMatchingItemByNumber( menu, j, groupName);
01453 if (item != NULL)
01454 {
01455 if (showFlag)
01456 {
01457 item->window.flags |= WINDOW_VISIBLE;
01458 }
01459 else
01460 {
01461 item->window.flags &= ~(WINDOW_VISIBLE | WINDOW_HASFOCUS);
01462 }
01463 }
01464 }
01465 }
|
|
||||||||||||||||
|
Definition at line 1467 of file ui_shared.c. References windowDef_t::cinematic, DC, windowDef_t::flags, itemDef_t, Menu_GetMatchingItemByNumber(), Menu_ItemsMatchingGroup(), NULL, displayContextDef_t::stopCinematic, itemDef_s::window, and WINDOW_VISIBLE. Referenced by Script_Hide(), Script_Show(), UpdateBotButtons(), UpdateForceStatus(), and UpdateForceUsed().
01467 {
01468 itemDef_t *item;
01469 int i;
01470 int count = Menu_ItemsMatchingGroup(menu, p);
01471 for (i = 0; i < count; i++) {
01472 item = Menu_GetMatchingItemByNumber(menu, i, p);
01473 if (item != NULL) {
01474 if (bShow) {
01475 item->window.flags |= WINDOW_VISIBLE;
01476 } else {
01477 item->window.flags &= ~WINDOW_VISIBLE;
01478 // stop cinematics playing in the window
01479 if (item->window.cinematic >= 0) {
01480 DC->stopCinematic(item->window.cinematic);
01481 item->window.cinematic = -1;
01482 }
01483 }
01484 }
01485 }
01486 }
|
|
|
Definition at line 754 of file ui_main.c. References displayContextDef_t::Assets, cgDC, FONT_LARGE, FONT_MEDIUM, FONT_SMALL, FONT_SMALL2, cachedAssets_t::qhBigFont, cachedAssets_t::qhMediumFont, cachedAssets_t::qhSmall2Font, cachedAssets_t::qhSmallFont, uiInfo_t::uiDC, and uiInfo. Referenced by CG_Text_Height(), CG_Text_Paint(), CG_Text_Width(), Text_Height(), Text_Paint(), Text_PaintWithCursor(), and Text_Width().
00755 {
00756 switch (iMenuFont)
00757 {
00758 case 1: return uiInfo.uiDC.Assets.qhSmallFont;
00759 case 2: return uiInfo.uiDC.Assets.qhMediumFont;
00760 case 3: return uiInfo.uiDC.Assets.qhBigFont;
00761 case 4: return uiInfo.uiDC.Assets.qhSmall2Font;
00762 }
00763
00764 return uiInfo.uiDC.Assets.qhMediumFont; // 0;
00765 }
|
|
||||||||||||||||||||||||||||||||||||
|
|
|
|
Definition at line 507 of file ui_saber.c. References NULL, SABER_BLUE, saber_colors_t, SABER_GREEN, SABER_ORANGE, SABER_PURPLE, SABER_RED, and SABER_YELLOW.
00508 {
00509 if ( color == SABER_RED)
00510 return "red";
00511
00512 if ( color == SABER_ORANGE)
00513 return "orange";
00514
00515 if ( color == SABER_YELLOW)
00516 return "yellow";
00517
00518 if ( color == SABER_GREEN)
00519 return "green";
00520
00521 if (color == SABER_BLUE)
00522 return "blue";
00523
00524 if ( color == SABER_PURPLE)
00525 return "purple";
00526 return NULL;
00527 }
|
|
||||||||||||||||
|
Definition at line 775 of file ui_main.c. References MenuFontToHandle(), and trap_R_Font_HeightPixels(). Referenced by _UI_Init().
00776 {
00777 int iFontIndex = MenuFontToHandle(iMenuFont);
00778
00779 return trap_R_Font_HeightPixels(iFontIndex, scale);
00780 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 782 of file ui_main.c. References ITEM_TEXTSTYLE_BLINK, ITEM_TEXTSTYLE_NORMAL, ITEM_TEXTSTYLE_OUTLINED, ITEM_TEXTSTYLE_OUTLINESHADOWED, ITEM_TEXTSTYLE_PULSE, ITEM_TEXTSTYLE_SHADOWED, ITEM_TEXTSTYLE_SHADOWEDMORE, MenuFontToHandle(), STYLE_BLINK, STYLE_DROPSHADOW, trap_R_Font_DrawString(), and vec4_t. Referenced by _UI_Init(), Text_PaintCenter(), and Text_PaintWithCursor().
00783 {
00784 int iStyleOR = 0;
00785
00786 int iFontIndex = MenuFontToHandle(iMenuFont);
00787 //
00788 // kludge.. convert JK2 menu styles to SOF2 printstring ctrl codes...
00789 //
00790 switch (style)
00791 {
00792 case ITEM_TEXTSTYLE_NORMAL: iStyleOR = 0;break; // JK2 normal text
00793 case ITEM_TEXTSTYLE_BLINK: iStyleOR = (int)STYLE_BLINK;break; // JK2 fast blinking
00794 case ITEM_TEXTSTYLE_PULSE: iStyleOR = (int)STYLE_BLINK;break; // JK2 slow pulsing
00795 case ITEM_TEXTSTYLE_SHADOWED: iStyleOR = (int)STYLE_DROPSHADOW;break; // JK2 drop shadow
00796 case ITEM_TEXTSTYLE_OUTLINED: iStyleOR = (int)STYLE_DROPSHADOW;break; // JK2 drop shadow
00797 case ITEM_TEXTSTYLE_OUTLINESHADOWED: iStyleOR = (int)STYLE_DROPSHADOW;break; // JK2 drop shadow
00798 case ITEM_TEXTSTYLE_SHADOWEDMORE: iStyleOR = (int)STYLE_DROPSHADOW;break; // JK2 drop shadow
00799 }
00800
00801 trap_R_Font_DrawString( x, // int ox
00802 y, // int oy
00803 text, // const char *text
00804 color, // paletteRGBA_c c
00805 iStyleOR | iFontIndex, // const int iFontHandle
00806 !limit?-1:limit, // iCharLimit (-1 = none)
00807 scale // const float scale = 1.0f
00808 );
00809 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 10572 of file ui_main.c. References ITEM_TEXTSTYLE_SHADOWEDMORE, Text_Paint(), Text_Width(), and vec4_t. Referenced by UI_DrawConnectScreen().
10572 {
10573 int len = Text_Width(text, scale, iMenuFont);
10574 Text_Paint(x - len / 2, y, scale, color, text, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE, iMenuFont);
10575 }
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 812 of file ui_main.c. References ITEM_TEXTSTYLE_BLINK, MenuFontToHandle(), min, strlen(), strncpy(), Text_Paint(), trap_R_Font_StrLenPixels(), va(), and vec4_t. Referenced by _UI_Init().
00813 {
00814 Text_Paint(x, y, scale, color, text, 0, limit, style, iMenuFont);
00815
00816 // now print the cursor as well... (excuse the braces, it's for porting C++ to C)
00817 //
00818 {
00819 char sTemp[1024];
00820 int iCopyCount = limit ? min(strlen(text), limit) : strlen(text);
00821 iCopyCount = min(iCopyCount,cursorPos);
00822 iCopyCount = min(iCopyCount,sizeof(sTemp));
00823
00824 // copy text into temp buffer for pixel measure...
00825 //
00826 strncpy(sTemp,text,iCopyCount);
00827 sTemp[iCopyCount] = '\0';
00828
00829 {
00830 int iFontIndex = MenuFontToHandle( iMenuFont );
00831 int iNextXpos = trap_R_Font_StrLenPixels(sTemp, iFontIndex, scale );
00832
00833 Text_Paint(x+iNextXpos, y, scale, color, va("%c",cursor), 0, limit, style|ITEM_TEXTSTYLE_BLINK, iMenuFont);
00834 }
00835 }
00836 }
|
|
||||||||||||||||
|
Definition at line 768 of file ui_main.c. References MenuFontToHandle(), and trap_R_Font_StrLenPixels(). Referenced by _UI_Init(), and Text_PaintCenter().
00769 {
00770 int iFontIndex = MenuFontToHandle(iMenuFont);
00771
00772 return trap_R_Font_StrLenPixels(text, iFontIndex, scale);
00773 }
|
|
|
Definition at line 149 of file bg_saberLoad.c. References name, Q_irand(), Q_stricmp(), SABER_BLUE, saber_colors_t, SABER_GREEN, SABER_ORANGE, SABER_PURPLE, SABER_RED, and SABER_YELLOW. Referenced by NPC_ParseParms(), UI_SaberDrawBlade(), WP_SaberParseParms(), and WP_SaberSetColor().
00150 {
00151 if ( !Q_stricmp( name, "red" ) )
00152 {
00153 return SABER_RED;
00154 }
00155 if ( !Q_stricmp( name, "orange" ) )
00156 {
00157 return SABER_ORANGE;
00158 }
00159 if ( !Q_stricmp( name, "yellow" ) )
00160 {
00161 return SABER_YELLOW;
00162 }
00163 if ( !Q_stricmp( name, "green" ) )
00164 {
00165 return SABER_GREEN;
00166 }
00167 if ( !Q_stricmp( name, "blue" ) )
00168 {
00169 return SABER_BLUE;
00170 }
00171 if ( !Q_stricmp( name, "purple" ) )
00172 {
00173 return SABER_PURPLE;
00174 }
00175 if ( !Q_stricmp( name, "random" ) )
00176 {
00177 return ((saber_colors_t)(Q_irand( SABER_ORANGE, SABER_PURPLE )));
00178 }
00179 return SABER_BLUE;
00180 }
|
|
|
Definition at line 324 of file ui_main.c. References animation_t, BG_Alloc(), bgAllAnims, MAX_ANIM_FILES, MAX_TOTALANIMATIONS, and uiNumAllAnims. Referenced by UI_ParseAnimationFile().
00325 {
00326 assert (uiNumAllAnims < MAX_ANIM_FILES);
00327 bgAllAnims[uiNumAllAnims].anims = (animation_t *) BG_Alloc(sizeof(animation_t)*MAX_TOTALANIMATIONS);
00328
00329 return bgAllAnims[uiNumAllAnims].anims;
00330 }
|
|
|
Definition at line 7032 of file ui_main.c. References uiInfo_t::gameTypes, GT_DUEL, GT_POWERDUEL, vmCvar_t::integer, MAX_CLIENTS, trap_Cvar_Set(), trap_Cvar_VariableValue(), ui_netGameType, and uiInfo.
07033 {
07034 char buf[32];
07035 // min checks
07036 //
07037 if( uiInfo.gameTypes[ui_netGameType.integer].gtEnum == GT_DUEL ) //DUEL
07038 {
07039 if( trap_Cvar_VariableValue("sv_maxClients") < 2 )
07040 {
07041 trap_Cvar_Set("sv_maxClients", "2");
07042 }
07043 }
07044 else if( uiInfo.gameTypes[ui_netGameType.integer].gtEnum == GT_POWERDUEL ) // POWER DUEL
07045 {
07046 if( trap_Cvar_VariableValue("sv_maxClients") < 3 )
07047 {
07048 trap_Cvar_Set("sv_maxClients", "3");
07049 }
07050 }
07051
07052
07053 // max check for all game types
07054 if( trap_Cvar_VariableValue("sv_maxClients") > MAX_CLIENTS )
07055 {
07056 sprintf(buf,"%d",MAX_CLIENTS);
07057 trap_Cvar_Set("sv_maxClients", buf);
07058 }
07059
07060 }
|
|
|
Definition at line 7539 of file ui_shared.c. References uiG2PtrTracker_s::ghoul2, uiG2PtrTracker_s::next, NULL, trap_G2_HaveWeGhoul2Models(), trap_G2API_CleanGhoul2Models(), ui_G2PtrTracker, and uiG2PtrTracker_t.
07540 {
07541 uiG2PtrTracker_t *next = ui_G2PtrTracker;
07542
07543 while (next)
07544 {
07545 if (next->ghoul2 && trap_G2_HaveWeGhoul2Models(next->ghoul2))
07546 { //found a g2 instance, clean it.
07547 trap_G2API_CleanGhoul2Models(&next->ghoul2);
07548 }
07549
07550 next = next->next;
07551 }
07552
07553 #ifdef _XBOX
07554 ui_G2PtrTracker = NULL;
07555 #endif
07556 }
|
|
||||||||||||||||
|
Definition at line 908 of file ui_main.c. References qhandle_t, SCREEN_HEIGHT, SCREEN_WIDTH, and UI_DrawHandlePic().
00908 {
00909 int x, y;
00910 x = (SCREEN_WIDTH - w) / 2;
00911 y = (SCREEN_HEIGHT - h) / 2;
00912 UI_DrawHandlePic(x, y, w, h, image);
00913 }
|
|
|
Definition at line 10676 of file ui_main.c. References CA_CHALLENGING, CA_CONNECTED, CA_CONNECTING, CA_LOADING, CA_PRIMED, colorWhite, uiClientState_t::connectPacketCount, uiClientState_t::connState, CS_SERVERINFO, FONT_MEDIUM, Info_ValueForKey(), ITEM_TEXTSTYLE_SHADOWEDMORE, MAX_INFO_VALUE, Menu_Paint(), Menus_FindByName(), uiClientState_t::messageString, Q_stricmp(), qtrue, uiClientState_t::servername, strcpy(), Text_PaintCenter(), trap_Cvar_VariableStringBuffer(), trap_GetClientState(), trap_GetConfigString(), trap_SP_GetStringTextString(), uiClientState_t::updateInfoString, and va(). Referenced by vmMain().
10676 {
10677 const char *s;
10678 uiClientState_t cstate;
10679 char info[MAX_INFO_VALUE];
10680 char text[256];
10681 float centerPoint, yStart, scale;
10682
10683 char sStringEdTemp[256];
10684
10685 menuDef_t *menu = Menus_FindByName("Connect");
10686
10687
10688 if ( !overlay && menu ) {
10689 Menu_Paint(menu, qtrue);
10690 }
10691
10692 if (!overlay) {
10693 centerPoint = 320;
10694 yStart = 130;
10695 scale = 1.0f; // -ste
10696 } else {
10697 centerPoint = 320;
10698 yStart = 32;
10699 scale = 1.0f; // -ste
10700 return;
10701 }
10702
10703 // see what information we should display
10704 trap_GetClientState( &cstate );
10705
10706
10707 info[0] = '\0';
10708 if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) {
10709 trap_SP_GetStringTextString("MENUS_LOADING_MAPNAME", sStringEdTemp, sizeof(sStringEdTemp));
10710 Text_PaintCenter(centerPoint, yStart, scale, colorWhite, va( /*"Loading %s"*/sStringEdTemp, Info_ValueForKey( info, "mapname" )), 0, FONT_MEDIUM);
10711 }
10712
10713 if (!Q_stricmp(cstate.servername,"localhost")) {
10714 trap_SP_GetStringTextString("MENUS_STARTING_UP", sStringEdTemp, sizeof(sStringEdTemp));
10715 Text_PaintCenter(centerPoint, yStart + 48, scale, colorWhite, sStringEdTemp, ITEM_TEXTSTYLE_SHADOWEDMORE, FONT_MEDIUM);
10716 } else {
10717 trap_SP_GetStringTextString("MENUS_CONNECTING_TO", sStringEdTemp, sizeof(sStringEdTemp));
10718 strcpy(text, va(/*"Connecting to %s"*/sStringEdTemp, cstate.servername));
10719 Text_PaintCenter(centerPoint, yStart + 48, scale, colorWhite,text , ITEM_TEXTSTYLE_SHADOWEDMORE, FONT_MEDIUM);
10720 }
10721
10722 //UI_DrawProportionalString( 320, 96, "Press Esc to abort", UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
10723
10724 // display global MOTD at bottom
10725 Text_PaintCenter(centerPoint, 425, scale, colorWhite, Info_ValueForKey( cstate.updateInfoString, "motd" ), 0, FONT_MEDIUM);
10726 // print any server info (server full, bad version, etc)
10727 if ( cstate.connState < CA_CONNECTED ) {
10728 Text_PaintCenter(centerPoint, yStart + 176, scale, colorWhite, cstate.messageString, 0, FONT_MEDIUM);
10729 }
10730
10731 if ( lastConnState > cstate.connState ) {
10732 lastLoadingText[0] = '\0';
10733 }
10734 lastConnState = cstate.connState;
10735
10736 switch ( cstate.connState ) {
10737 case CA_CONNECTING:
10738 {
10739 trap_SP_GetStringTextString("MENUS_AWAITING_CONNECTION", sStringEdTemp, sizeof(sStringEdTemp));
10740 s = va(/*"Awaiting connection...%i"*/sStringEdTemp, cstate.connectPacketCount);
10741 }
10742 break;
10743 case CA_CHALLENGING:
10744 {
10745 trap_SP_GetStringTextString("MENUS_AWAITING_CHALLENGE", sStringEdTemp, sizeof(sStringEdTemp));
10746 s = va(/*"Awaiting challenge...%i"*/sStringEdTemp, cstate.connectPacketCount);
10747 }
10748 break;
10749 case CA_CONNECTED: {
10750 char downloadName[MAX_INFO_VALUE];
10751
10752 trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) );
10753 if (*downloadName) {
10754 UI_DisplayDownloadInfo( downloadName, centerPoint, yStart, scale, FONT_MEDIUM );
10755 return;
10756 }
10757 }
10758 trap_SP_GetStringTextString("MENUS_AWAITING_GAMESTATE", sStringEdTemp, sizeof(sStringEdTemp));
10759 s = /*"Awaiting gamestate..."*/sStringEdTemp;
10760 break;
10761 case CA_LOADING:
10762 return;
10763 case CA_PRIMED:
10764 return;
10765 default:
10766 return;
10767 }
10768
10769 if (Q_stricmp(cstate.servername,"localhost")) {
10770 Text_PaintCenter(centerPoint, yStart + 80, scale, colorWhite, s, 0, FONT_MEDIUM);
10771 }
10772 // password required / connection rejected information goes here
10773 }
|
|
||||||||||||||||
|
Definition at line 9145 of file ui_main.c. References displayContextDef_t::Assets, CHAN_LOCAL, CIN_loop, CIN_silent, mapInfo::cinematic, siegeTeam_t::classes, Com_sprintf(), uiInfo_t::currentFoundPlayerServer, serverStatus_s::currentServer, serverStatus_s::currentServerCinematic, serverStatus_s::currentServerPreview, cachedAssets_t::datapadmoveSaberSound1, cachedAssets_t::datapadmoveSaberSound2, cachedAssets_t::datapadmoveSaberSound3, cachedAssets_t::datapadmoveSaberSound4, cachedAssets_t::datapadmoveSaberSound5, cachedAssets_t::datapadmoveSaberSound6, datapadMoveTitleBaseAnims, uiInfo_t::demoIndex, serverStatus_s::displayServers, FEEDER_ALLMAPS, FEEDER_CINEMATICS, FEEDER_COLORCHOICES, FEEDER_DEMOS, FEEDER_FINDPLAYER, FEEDER_FORCECFG, FEEDER_LANGUAGES, FEEDER_MAPS, FEEDER_MODS, FEEDER_MOVES, FEEDER_MOVES_TITLES, FEEDER_PLAYER_LIST, FEEDER_PLAYER_SKIN_HEAD, FEEDER_PLAYER_SKIN_LEGS, FEEDER_PLAYER_SKIN_TORSO, FEEDER_PLAYER_SPECIES, FEEDER_Q3HEADS, FEEDER_SERVERS, FEEDER_SERVERSTATUS, FEEDER_SIEGE_BASE_CLASS, FEEDER_SIEGE_CLASS_FORCE, FEEDER_SIEGE_CLASS_INVENTORY, FEEDER_SIEGE_CLASS_WEAPONS, FEEDER_SIEGE_TEAM1, FEEDER_SIEGE_TEAM2, FEEDER_TEAM_LIST, FEEDER_XBL_ACCOUNTS, FEEDER_XBL_FRIENDS, FEEDER_XBL_PLAYERS, FEEDER_XBL_SERVERS, FORCE_LIGHTSIDE, uiInfo_t::forceConfigCount, uiInfo_t::forceConfigDarkIndexBegin, uiInfo_t::forceConfigLightIndexBegin, uiInfo_t::forceConfigSelected, forcepowerDesc, uiInfo_t::foundPlayerServerAddresses, g_siegedFeederForcedSet, g_UIClassDescriptions, g_UIGloballySelectedSiegeClass, uiInfo_t::gameTypes, gUISelectedMap, HolocronIcons, Info_ValueForKey(), vmCvar_t::integer, Item_RunScript(), itemDef_t, ItemParse_asset_model_go(), ItemParse_model_g2anim_go(), uiInfo_t::languageCountIndex, uiInfo_t::mapList, MAX_QPATH, MAX_STRING_CHARS, MDS_FORCE_JUMP, MDS_ROLL, MDS_SABER, Menu_FindItemByName(), Menu_SetFeederSelection(), Menus_FindByName(), modelDef_t, uiInfo_t::modIndex, uiInfo_t::moveAnimTime, cachedAssets_t::moveJumpSound, cachedAssets_t::moveRollSound, uiInfo_t::movesBaseAnim, uiInfo_t::movesTitleIndex, uiInfo_t::movieIndex, NULL, NUM_FORCE_POWERS, uiInfo_t::numFoundPlayerServers, uiInfo_t::playerIndex, uiInfo_t::playerSpecies, uiInfo_t::playerSpeciesIndex, uiInfo_t::previewMovie, uiInfo_t::q3HeadCount, uiInfo_t::q3HeadNames, uiInfo_t::q3SelectedHead, Q_irand(), Q_strncpyz(), qboolean, qfalse, qtrue, displayContextDef_t::realTime, uiInfo_t::serverStatus, uiInfo_t::serverStatusAddress, sfxHandle_t, siegeTeam1, siegeTeam2, strcmp(), uiInfo_t::teamIndex, trap_CIN_PlayCinematic(), trap_CIN_StopCinematic(), trap_Cvar_Set(), trap_Cvar_VariableStringBuffer(), trap_Cvar_VariableValue(), trap_LAN_GetServerInfo(), trap_R_RegisterShaderNoMip(), trap_S_StartLocalSound(), itemDef_s::typeData, ui_currentMap, ui_currentNetMap, UI_Cvar_VariableString(), UI_ForceConfigHandle(), ui_gameType, UI_LoadBestScores(), ui_mapIndex, ui_netSource, UI_SaberAttachToChar(), UI_SiegeClassNum(), UI_SiegeSetCvarsForClass(), UI_UpdateCharacterSkin(), UI_UpdateCvarsForClass(), uiInfo_t::uiDC, uiForceSide, uiInfo, and va(). Referenced by _UI_Init(), and UI_SkinColor_HandleKey().
09146 {
09147 static char info[MAX_STRING_CHARS];
09148 const int feederID = feederFloat;
09149
09150 if (feederID == FEEDER_Q3HEADS)
09151 {
09152 int actual;
09153 UI_SelectedTeamHead(index, &actual);
09154 uiInfo.q3SelectedHead = index;
09155 trap_Cvar_Set("ui_selectedModelIndex", va("%i", index));
09156 index = actual;
09157 if (index >= 0 && index < uiInfo.q3HeadCount)
09158 {
09159 trap_Cvar_Set( "model", uiInfo.q3HeadNames[index]); //standard model
09160 trap_Cvar_Set ( "char_color_red", "255" ); //standard colors
09161 trap_Cvar_Set ( "char_color_green", "255" );
09162 trap_Cvar_Set ( "char_color_blue", "255" );
09163 }
09164 }
09165 else if (feederID == FEEDER_MOVES)
09166 {
09167 itemDef_t *item;
09168 menuDef_t *menu;
09169 modelDef_t *modelPtr;
09170
09171 menu = Menus_FindByName("rulesMenu_moves");
09172
09173 if (menu)
09174 {
09175 item = (itemDef_t *) Menu_FindItemByName((menuDef_t *) menu, "character");
09176 if (item)
09177 {
09178 modelPtr = (modelDef_t*)item->typeData;
09179 if (modelPtr)
09180 {
09181 char modelPath[MAX_QPATH];
09182 int animRunLength;
09183
09184 ItemParse_model_g2anim_go( item, datapadMoveData[uiInfo.movesTitleIndex][index].anim );
09185
09186 Com_sprintf( modelPath, sizeof( modelPath ), "models/players/%s/model.glm", UI_Cvar_VariableString ( "ui_char_model" ) );
09187 ItemParse_asset_model_go( item, modelPath, &animRunLength );
09188 UI_UpdateCharacterSkin();
09189
09190 uiInfo.moveAnimTime = uiInfo.uiDC.realTime + animRunLength;
09191
09192 if (datapadMoveData[uiInfo.movesTitleIndex][index].anim)
09193 {
09194
09195 // Play sound for anim
09196 if (datapadMoveData[uiInfo.movesTitleIndex][index].sound == MDS_FORCE_JUMP)
09197 {
09198 trap_S_StartLocalSound( uiInfo.uiDC.Assets.moveJumpSound, CHAN_LOCAL );
09199 }
09200 else if (datapadMoveData[uiInfo.movesTitleIndex][index].sound == MDS_ROLL)
09201 {
09202 trap_S_StartLocalSound( uiInfo.uiDC.Assets.moveRollSound, CHAN_LOCAL );
09203 }
09204 else if (datapadMoveData[uiInfo.movesTitleIndex][index].sound == MDS_SABER)
09205 {
09206 // Randomly choose one sound
09207 int soundI = Q_irand( 1, 6 );
09208 sfxHandle_t *soundPtr;
09209 soundPtr = &uiInfo.uiDC.Assets.datapadmoveSaberSound1;
09210 if (soundI == 2)
09211 {
09212 soundPtr = &uiInfo.uiDC.Assets.datapadmoveSaberSound2;
09213 }
09214 else if (soundI == 3)
09215 {
09216 soundPtr = &uiInfo.uiDC.Assets.datapadmoveSaberSound3;
09217 }
09218 else if (soundI == 4)
09219 {
09220 soundPtr = &uiInfo.uiDC.Assets.datapadmoveSaberSound4;
09221 }
09222 else if (soundI == 5)
09223 {
09224 soundPtr = &uiInfo.uiDC.Assets.datapadmoveSaberSound5;
09225 }
09226 else if (soundI == 6)
09227 {
09228 soundPtr = &uiInfo.uiDC.Assets.datapadmoveSaberSound6;
09229 }
09230
09231 trap_S_StartLocalSound( *soundPtr, CHAN_LOCAL );
09232 }
09233
09234 if (datapadMoveData[uiInfo.movesTitleIndex][index].desc)
09235 {
09236 trap_Cvar_Set( "ui_move_desc", datapadMoveData[uiInfo.movesTitleIndex][index].desc);
09237 }
09238 }
09239 UI_SaberAttachToChar( item );
09240 }
09241 }
09242 }
09243 }
09244 else if (feederID == FEEDER_MOVES_TITLES)
09245 {
09246 itemDef_t *item;
09247 menuDef_t *menu;
09248 modelDef_t *modelPtr;
09249
09250 uiInfo.movesTitleIndex = index;
09251 uiInfo.movesBaseAnim = datapadMoveTitleBaseAnims[uiInfo.movesTitleIndex];
09252 menu = Menus_FindByName("rulesMenu_moves");
09253
09254 if (menu)
09255 {
09256 item = (itemDef_t *) Menu_FindItemByName((menuDef_t *) menu, "character");
09257 if (item)
09258 {
09259 modelPtr = (modelDef_t*)item->typeData;
09260 if (modelPtr)
09261 {
09262 char modelPath[MAX_QPATH];
09263 int animRunLength;
09264
09265 uiInfo.movesBaseAnim = datapadMoveTitleBaseAnims[uiInfo.movesTitleIndex];
09266 ItemParse_model_g2anim_go( item, uiInfo.movesBaseAnim );
09267
09268 Com_sprintf( modelPath, sizeof( modelPath ), "models/players/%s/model.glm", UI_Cvar_VariableString ( "ui_char_model" ) );
09269 ItemParse_asset_model_go( item, modelPath, &animRunLength );
09270
09271 UI_UpdateCharacterSkin();
09272
09273 }
09274 }
09275 }
09276 }
09277 else if (feederID == FEEDER_SIEGE_TEAM1)
09278 {
09279 if (!g_siegedFeederForcedSet)
09280 {
09281 g_UIGloballySelectedSiegeClass = UI_SiegeClassNum(siegeTeam1->classes[index]);
09282 trap_Cvar_Set("ui_classDesc", g_UIClassDescriptions[g_UIGloballySelectedSiegeClass].desc);
09283
09284 //g_siegedFeederForcedSet = 1;
09285 //Menu_SetFeederSelection(NULL, FEEDER_SIEGE_TEAM2, -1, NULL);
09286
09287 UI_SiegeSetCvarsForClass(siegeTeam1->classes[index]);
09288 }
09289 g_siegedFeederForcedSet = 0;
09290 }
09291 else if (feederID == FEEDER_SIEGE_TEAM2)
09292 {
09293 if (!g_siegedFeederForcedSet)
09294 {
09295 g_UIGloballySelectedSiegeClass = UI_SiegeClassNum(siegeTeam2->classes[index]);
09296 trap_Cvar_Set("ui_classDesc", g_UIClassDescriptions[g_UIGloballySelectedSiegeClass].desc);
09297
09298 //g_siegedFeederForcedSet = 1;
09299 //Menu_SetFeederSelection(NULL, FEEDER_SIEGE_TEAM2, -1, NULL);
09300
09301 UI_SiegeSetCvarsForClass(siegeTeam2->classes[index]);
09302 }
09303 g_siegedFeederForcedSet = 0;
09304 }
09305 else if (feederID == FEEDER_FORCECFG)
09306 {
09307 int newindex = index;
09308
09309 if (uiForceSide == FORCE_LIGHTSIDE)
09310 {
09311 newindex += uiInfo.forceConfigLightIndexBegin;
09312 if (newindex >= uiInfo.forceConfigCount)
09313 {
09314 return qfalse;
09315 }
09316 }
09317 else
09318 { //else dark
09319 newindex += uiInfo.forceConfigDarkIndexBegin;
09320 if (newindex >= uiInfo.forceConfigCount || newindex > uiInfo.forceConfigLightIndexBegin)
09321 { //dark gets read in before light
09322 return qfalse;
09323 }
09324 }
09325
09326 if (index >= 0 && index < uiInfo.forceConfigCount)
09327 {
09328 UI_ForceConfigHandle(uiInfo.forceConfigSelected, index);
09329 uiInfo.forceConfigSelected = index;
09330 }
09331 }
09332 else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS)
09333 {
09334 int actual, map;
09335 const char *checkValid = NULL;
09336
09337 map = (feederID == FEEDER_ALLMAPS) ? ui_currentNetMap.integer : ui_currentMap.integer;
09338 if (uiInfo.mapList[map].cinematic >= 0) {
09339 trap_CIN_StopCinematic(uiInfo.mapList[map].cinematic);
09340 uiInfo.mapList[map].cinematic = -1;
09341 }
09342 checkValid = UI_SelectedMap(index, &actual);
09343
09344 if (!checkValid || !checkValid[0])
09345 { //this isn't a valid map to select, so reselect the current
09346 index = ui_mapIndex.integer;
09347 UI_SelectedMap(index, &actual);
09348 }
09349
09350 trap_Cvar_Set("ui_mapIndex", va("%d", index));
09351 gUISelectedMap = index;
09352 ui_mapIndex.integer = index;
09353
09354 if (feederID == FEEDER_MAPS) {
09355 ui_currentMap.integer = actual;
09356 trap_Cvar_Set("ui_currentMap", va("%d", actual));
09357 uiInfo.mapList[ui_currentMap.integer].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.mapList[ui_currentMap.integer].mapLoadName), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
09358 UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum);
09359 //trap_Cvar_Set("ui_opponentModel", uiInfo.mapList[ui_currentMap.integer].opponentName);
09360 //updateOpponentModel = qtrue;
09361 } else {
09362 ui_currentNetMap.integer = actual;
09363 trap_Cvar_Set("ui_currentNetMap", va("%d", actual));
09364 uiInfo.mapList[ui_currentNetMap.integer].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.mapList[ui_currentNetMap.integer].mapLoadName), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
09365 }
09366
09367 } else if (feederID == FEEDER_SERVERS) {
09368 const char *mapName = NULL;
09369 uiInfo.serverStatus.currentServer = index;
09370 trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[index], info, MAX_STRING_CHARS);
09371 uiInfo.serverStatus.currentServerPreview = trap_R_RegisterShaderNoMip(va("levelshots/%s", Info_ValueForKey(info, "mapname")));
09372 if (uiInfo.serverStatus.currentServerCinematic >= 0) {
09373 trap_CIN_StopCinematic(uiInfo.serverStatus.currentServerCinematic);
09374 uiInfo.serverStatus.currentServerCinematic = -1;
09375 }
09376 mapName = Info_ValueForKey(info, "mapname");
09377 if (mapName && *mapName) {
09378 uiInfo.serverStatus.currentServerCinematic = trap_CIN_PlayCinematic(va("%s.roq", mapName), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
09379 }
09380 } else if (feederID == FEEDER_SERVERSTATUS) {
09381 //
09382 } else if (feederID == FEEDER_FINDPLAYER) {
09383 uiInfo.currentFoundPlayerServer = index;
09384 //
09385 if ( index < uiInfo.numFoundPlayerServers-1) {
09386 // build a new server status for this server
09387 Q_strncpyz(uiInfo.serverStatusAddress, uiInfo.foundPlayerServerAddresses[uiInfo.currentFoundPlayerServer], sizeof(uiInfo.serverStatusAddress));
09388 Menu_SetFeederSelection(NULL, FEEDER_SERVERSTATUS, 0, NULL);
09389 UI_BuildServerStatus(qtrue);
09390 }
09391 } else if (feederID == FEEDER_PLAYER_LIST) {
09392 uiInfo.playerIndex = index;
09393 } else if (feederID == FEEDER_TEAM_LIST) {
09394 uiInfo.teamIndex = index;
09395 } else if (feederID == FEEDER_MODS) {
09396 uiInfo.modIndex = index;
09397 } else if (feederID == FEEDER_CINEMATICS) {
09398 uiInfo.movieIndex = index;
09399 if (uiInfo.previewMovie >= 0) {
09400 trap_CIN_StopCinematic(uiInfo.previewMovie);
09401 }
09402 uiInfo.previewMovie = -1;
09403 } else if (feederID == FEEDER_DEMOS) {
09404 uiInfo.demoIndex = index;
09405 }
09406 else if (feederID == FEEDER_COLORCHOICES)
09407 {
09408 if (index >= 0 && index < uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].ColorCount)
09409 {
09410 Item_RunScript(item, uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].ColorActionText[index]);
09411 }
09412 }
09413 else if (feederID == FEEDER_PLAYER_SKIN_HEAD)
09414 {
09415 if (index >= 0 && index < uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHeadCount)
09416 {
09417 trap_Cvar_Set("ui_char_skin_head", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinHeadNames[index]);
09418 }
09419 }
09420 else if (feederID == FEEDER_PLAYER_SKIN_TORSO)
09421 {
09422 if (index >= 0 && index < uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinTorsoCount)
09423 {
09424 trap_Cvar_Set("ui_char_skin_torso", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinTorsoNames[index]);
09425 }
09426 }
09427 else if (feederID == FEEDER_PLAYER_SKIN_LEGS)
09428 {
09429 if (index >= 0 && index < uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinLegCount)
09430 {
09431 trap_Cvar_Set("ui_char_skin_legs", uiInfo.playerSpecies[uiInfo.playerSpeciesIndex].SkinLegNames[index]);
09432 }
09433 }
09434 else if (feederID == FEEDER_PLAYER_SPECIES)
09435 {
09436 uiInfo.playerSpeciesIndex = index;
09437 }
09438 else if (feederID == FEEDER_LANGUAGES)
09439 {
09440 uiInfo.languageCountIndex = index;
09441 }
09442 else if ( feederID == FEEDER_SIEGE_BASE_CLASS )
09443 {
09444 int team,baseClass;
09445
09446 team = (int)trap_Cvar_VariableValue("ui_team");
09447 baseClass = (int)trap_Cvar_VariableValue("ui_siege_class");
09448
09449 UI_UpdateCvarsForClass(team, baseClass, index);
09450 }
09451 else if (feederID == FEEDER_SIEGE_CLASS_WEAPONS)
09452 {
09453 // trap_Cvar_VariableStringBuffer( va("ui_class_weapondesc%i", index), info, sizeof(info) );
09454 // trap_Cvar_Set( "ui_itemforceinvdesc", info );
09455 }
09456 else if (feederID == FEEDER_SIEGE_CLASS_INVENTORY)
09457 {
09458 // trap_Cvar_VariableStringBuffer( va("ui_class_itemdesc%i", index), info, sizeof(info) );
09459 // trap_Cvar_Set( "ui_itemforceinvdesc", info );
09460 }
09461 else if (feederID == FEEDER_SIEGE_CLASS_FORCE)
09462 {
09463 int i;
09464 // int validCnt = 0;
09465
09466 trap_Cvar_VariableStringBuffer( va("ui_class_power%i", index), info, sizeof(info) );
09467
09468 //count them up
09469 for (i=0;i< NUM_FORCE_POWERS;i++)
09470 {
09471 if (!strcmp(HolocronIcons[i],info))
09472 {
09473 trap_Cvar_Set( "ui_itemforceinvdesc", forcepowerDesc[i] );
09474 }
09475 }
09476 }
09477 #ifdef _XBOX
09478 else if (feederID == FEEDER_XBL_ACCOUNTS)
09479 {
09480 XBL_SetAccountIndex( index );
09481 }
09482 else if (feederID == FEEDER_XBL_PLAYERS)
09483 {
09484 XBL_PL_SetPlayerIndex( index );
09485 }
09486 else if (feederID == FEEDER_XBL_FRIENDS)
09487 {
09488 XBL_F_SetChosenFriendIndex( index );
09489 }
09490 else if (feederID == FEEDER_XBL_SERVERS)
09491 {
09492 XBL_MM_SetChosenServerIndex( index );
09493 }
09494 #endif
09495
09496 return qtrue;
09497 }
|
|
|
Definition at line 5313 of file ui_main.c. References itemDef_s::action, Item_RunScript(), itemDef_t, Menu_FindItemByName(), Menu_GetFocused(), SPC_DEMOLITIONIST, SPC_HEAVY_WEAPONS, SPC_INFANTRY, SPC_JEDI, SPC_SUPPORT, SPC_VANGUARD, TEAM_BLUE, TEAM_RED, and trap_Cvar_VariableValue().
05314 {
05315 menuDef_t *menu;
05316 int myTeam = (int)(trap_Cvar_VariableValue("ui_myteam"));
05317 char *itemname;
05318 itemDef_t *item;
05319 int baseClass;
05320
05321 menu = Menu_GetFocused(); // Get current menu
05322
05323 if (!menu)
05324 {
05325 return;
05326 }
05327
05328 if (( myTeam != TEAM_RED ) && ( myTeam != TEAM_BLUE ))
05329 {
05330 return;
05331 }
05332
05333 // If the player is on a team,
05334 if ( myTeam == TEAM_RED )
05335 {
05336 itemDef_t *item;
05337 item = (itemDef_t *) Menu_FindItemByName(menu, "onteam1" );
05338 if (item)
05339 {
05340 Item_RunScript(item, item->action);
05341 }
05342 }
05343 else if ( myTeam == TEAM_BLUE )
05344 {
05345 itemDef_t *item;
05346 item = (itemDef_t *) Menu_FindItemByName(menu, "onteam2" );
05347 if (item)
05348 {
05349 Item_RunScript(item, item->action);
05350 }
05351 }
05352
05353
05354 baseClass = (int)trap_Cvar_VariableValue("ui_siege_class");
05355
05356 // Find correct class button and activate it.
05357 if (baseClass == SPC_INFANTRY)
05358 {
05359 itemname = "class1_button";
05360 }
05361 else if (baseClass == SPC_HEAVY_WEAPONS)
05362 {
05363 itemname = "class2_button";
05364 }
05365 else if (baseClass == SPC_DEMOLITIONIST)
05366 {
05367 itemname = "class3_button";
05368 }
05369 else if (baseClass == SPC_VANGUARD)
05370 {
05371 itemname = "class4_button";
05372 }
05373 else if (baseClass == SPC_SUPPORT)
05374 {
05375 itemname = "class5_button";
05376 }
05377 else if (baseClass == SPC_SUPPORT)
05378 {
05379 itemname = "class5_button";
05380 }
05381 else if (baseClass == SPC_JEDI)
05382 {
05383 itemname = "class6_button";
05384 }
05385 else
05386 {
05387 return;
05388 }
05389
05390 item = (itemDef_t *) Menu_FindItemByName(menu, itemname );
05391 if (item)
05392 {
05393 Item_RunScript(item, item->action);
05394 }
05395
05396 }
|
|
||||||||||||
|
Definition at line 928 of file ui_main.c. References trap_SP_GetStringTextString(), and va(). Referenced by _UI_Refresh().
00929 {
00930 static char text[1024]={0};
00931
00932 trap_SP_GetStringTextString(va("%s_%s", refSection, refName), text, sizeof(text));
00933 return text;
00934 }
|
|
|
Definition at line 5096 of file ui_main.c. References CVAR_ARCHIVE, CVAR_INTERNAL, CVAR_ROM, NULL, trap_Cvar_Register(), trap_Cvar_Set(), and UI_Cvar_VariableString().
05097 {
05098 // Make sure the cvars are registered as read only.
05099 trap_Cvar_Register ( NULL, "ui_r_glCustom", "4", CVAR_ROM|CVAR_INTERNAL|CVAR_ARCHIVE );
05100
05101 trap_Cvar_Register ( NULL, "ui_r_mode", "0", CVAR_ROM|CVAR_INTERNAL );
05102 trap_Cvar_Register ( NULL, "ui_r_fullscreen", "0", CVAR_ROM|CVAR_INTERNAL );
05103 trap_Cvar_Register ( NULL, "ui_r_colorbits", "0", CVAR_ROM|CVAR_INTERNAL );
05104 trap_Cvar_Register ( NULL, "ui_r_lodbias", "0", CVAR_ROM|CVAR_INTERNAL );
05105 trap_Cvar_Register ( NULL, "ui_r_picmip", "0", CVAR_ROM|CVAR_INTERNAL );
05106 trap_Cvar_Register ( NULL, "ui_r_texturebits", "0", CVAR_ROM|CVAR_INTERNAL );
05107 trap_Cvar_Register ( NULL, "ui_r_texturemode", "0", CVAR_ROM|CVAR_INTERNAL );
05108 trap_Cvar_Register ( NULL, "ui_r_detailtextures", "0", CVAR_ROM|CVAR_INTERNAL );
05109 trap_Cvar_Register ( NULL, "ui_r_ext_compress_textures","0", CVAR_ROM|CVAR_INTERNAL );
05110 trap_Cvar_Register ( NULL, "ui_r_depthbits", "0", CVAR_ROM|CVAR_INTERNAL );
05111 trap_Cvar_Register ( NULL, "ui_r_subdivisions", "0", CVAR_ROM|CVAR_INTERNAL );
05112 trap_Cvar_Register ( NULL, "ui_r_fastSky", "0", CVAR_ROM|CVAR_INTERNAL );
05113 trap_Cvar_Register ( NULL, "ui_r_inGameVideo", "0", CVAR_ROM|CVAR_INTERNAL );
05114 trap_Cvar_Register ( NULL, "ui_r_allowExtensions", "0", CVAR_ROM|CVAR_INTERNAL );
05115 trap_Cvar_Register ( NULL, "ui_cg_shadows", "0", CVAR_ROM|CVAR_INTERNAL );
05116 trap_Cvar_Register ( NULL, "ui_r_modified", "0", CVAR_ROM|CVAR_INTERNAL );
05117
05118 // Copy over the real video cvars into their temporary counterparts
05119 trap_Cvar_Set ( "ui_r_mode", UI_Cvar_VariableString ( "r_mode" ) );
05120 trap_Cvar_Set ( "ui_r_colorbits", UI_Cvar_VariableString ( "r_colorbits" ) );
05121 trap_Cvar_Set ( "ui_r_fullscreen", UI_Cvar_VariableString ( "r_fullscreen" ) );
05122 trap_Cvar_Set ( "ui_r_lodbias", UI_Cvar_VariableString ( "r_lodbias" ) );
05123 trap_Cvar_Set ( "ui_r_picmip", UI_Cvar_VariableString ( "r_picmip" ) );
05124 trap_Cvar_Set ( "ui_r_texturebits", UI_Cvar_VariableString ( "r_texturebits" ) );
05125 trap_Cvar_Set ( "ui_r_texturemode", UI_Cvar_VariableString ( "r_texturemode" ) );
05126 trap_Cvar_Set ( "ui_r_detailtextures", UI_Cvar_VariableString ( "r_detailtextures" ) );
05127 trap_Cvar_Set ( "ui_r_ext_compress_textures", UI_Cvar_VariableString ( "r_ext_compress_textures" ) );
05128 trap_Cvar_Set ( "ui_r_depthbits", UI_Cvar_VariableString ( "r_depthbits" ) );
05129 trap_Cvar_Set ( "ui_r_subdivisions", UI_Cvar_VariableString ( "r_subdivisions" ) );
05130 trap_Cvar_Set ( "ui_r_fastSky", UI_Cvar_VariableString ( "r_fastSky" ) );
05131 trap_Cvar_Set ( "ui_r_inGameVideo", UI_Cvar_VariableString ( "r_inGameVideo" ) );
05132 trap_Cvar_Set ( "ui_r_allowExtensions", UI_Cvar_VariableString ( "r_allowExtensions" ) );
05133 trap_Cvar_Set ( "ui_cg_shadows", UI_Cvar_VariableString ( "cg_shadows" ) );
05134 trap_Cvar_Set ( "ui_r_modified", "0" );
05135 }
|
|
|
Definition at line 1911 of file ui_main.c. References atoi(), CS_SERVERINFO, GT_DUEL, GT_JEDIMASTER, GT_POWERDUEL, Info_ValueForKey(), MAX_INFO_STRING, qboolean, qfalse, qtrue, trap_GetConfigString(), WP_NONE, WP_NUM_WEAPONS, and WP_SABER. Referenced by UI_TrueJediEnabled().
01912 {
01913 char info[MAX_INFO_STRING];
01914 int i = 0;
01915 int wDisable = 0;
01916 int gametype = 0;
01917
01918 gametype = atoi(Info_ValueForKey(info, "g_gametype"));
01919
01920 if ( gametype == GT_JEDIMASTER )
01921 { //set to 0
01922 return qfalse;
01923 }
01924
01925 trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
01926
01927 if (gametype == GT_DUEL || gametype == GT_POWERDUEL)
01928 {
01929 wDisable = atoi(Info_ValueForKey(info, "g_duelWeaponDisable"));
01930 }
01931 else
01932 {
01933 wDisable = atoi(Info_ValueForKey(info, "g_weaponDisable"));
01934 }
01935
01936 while (i < WP_NUM_WEAPONS)
01937 {
01938 if (!(wDisable & (1 << i)) &&
01939 i != WP_SABER && i != WP_NONE)
01940 {
01941 return qfalse;
01942 }
01943
01944 i++;
01945 }
01946
01947 return qtrue;
01948 }
|
|
||||||||||||
|
Definition at line 7131 of file ui_main.c. References Com_sprintf(), fileHandle_t, FS_READ, qboolean, qfalse, qtrue, trap_FS_FCloseFile(), and trap_FS_FOpenFile().
07131 {
07132 char test[1024];
07133 fileHandle_t f;
07134
07135 Com_sprintf( test, sizeof( test ), "models/players/%s/%s/lower_default.skin", base, team );
07136 trap_FS_FOpenFile(test, &f, FS_READ);
07137 if (f != 0) {
07138 trap_FS_FCloseFile(f);
07139 return qtrue;
07140 }
07141 Com_sprintf( test, sizeof( test ), "models/players/characters/%s/%s/lower_default.skin", base, team );
07142 trap_FS_FOpenFile(test, &f, FS_READ);
07143 if (f != 0) {
07144 trap_FS_FCloseFile(f);
07145 return qtrue;
07146 }
07147 return qfalse;
07148 }
|
|
|
Definition at line 1533 of file ui_main.c. References uiInfo_t::inGameLoad, Menu_GetFocused(), Menus_ActivateByName(), Menus_CloseAll(), windowDef_t::name, NULL, qtrue, strcpy(), String_Init(), UI_Cvar_VariableString(), UI_LoadArenas(), UI_LoadBots(), UI_LoadMenus(), uiInfo, and menuDef_t::window. Referenced by UI_ConsoleCommand().
01533 {
01534 char *menuSet;
01535 char lastName[1024];
01536 menuDef_t *menu = Menu_GetFocused();
01537
01538 if (menu && menu->window.name) {
01539 strcpy(lastName, menu->window.name);
01540 }
01541 else
01542 {
01543 lastName[0] = 0;
01544 }
01545
01546 if (uiInfo.inGameLoad)
01547 {
01548 menuSet= "ui/jampingame.txt";
01549 }
01550 else
01551 {
01552 menuSet= UI_Cvar_VariableString("ui_menuFilesMP");
01553 }
01554 if (menuSet == NULL || menuSet[0] == '\0') {
01555 menuSet = "ui/jampmenus.txt";
01556 }
01557
01558 String_Init();
01559
01560 #ifdef PRE_RELEASE_TADEMO
01561 UI_ParseGameInfo("demogameinfo.txt");
01562 #else
01563 UI_ParseGameInfo("ui/jamp/gameinfo.txt");
01564 #endif
01565 UI_LoadArenas();
01566 UI_LoadBots();
01567
01568 UI_LoadMenus(menuSet, qtrue);
01569 Menus_CloseAll();
01570 Menus_ActivateByName(lastName);
01571
01572 }
|
|
|
Definition at line 9734 of file ui_main.c. References Com_sprintf(), COM_StripExtension(), uiInfo_t::forceConfigCount, uiInfo_t::forceConfigDarkIndexBegin, uiInfo_t::forceConfigLightIndexBegin, uiInfo_t::forceConfigNames, uiInfo_t::forceConfigSide, MAX_FORCE_CONFIGS, NULL, qboolean, qfalse, qtrue, strlen(), trap_FS_GetFileList(), and uiInfo. Referenced by _UI_Init(), and UI_SaveForceTemplate().
09735 {
09736 int numfiles = 0;
09737 char filelist[2048];
09738 char configname[128];
09739 char *fileptr = NULL;
09740 int j = 0;
09741 int filelen = 0;
09742 qboolean lightSearch = qfalse;
09743
09744 uiInfo.forceConfigCount = 0;
09745 Com_sprintf( uiInfo.forceConfigNames[uiInfo.forceConfigCount], sizeof(uiInfo.forceConfigNames[uiInfo.forceConfigCount]), "Custom");
09746 uiInfo.forceConfigCount++;
09747 //Always reserve index 0 as the "custom" config
09748
09749 nextSearch:
09750 if (lightSearch)
09751 { //search light side folder
09752 numfiles = trap_FS_GetFileList("forcecfg/light", "fcf", filelist, 2048 );
09753 uiInfo.forceConfigLightIndexBegin = uiInfo.forceConfigCount-1;
09754 }
09755 else
09756 { //search dark side folder
09757 numfiles = trap_FS_GetFileList("forcecfg/dark", "fcf", filelist, 2048 );
09758 uiInfo.forceConfigDarkIndexBegin = uiInfo.forceConfigCount-1;
09759 }
09760
09761 fileptr = filelist;
09762
09763 for (j=0; j<numfiles && uiInfo.forceConfigCount < MAX_FORCE_CONFIGS;j++,fileptr+=filelen+1)
09764 {
09765 filelen = strlen(fileptr);
09766 COM_StripExtension(fileptr, configname);
09767
09768 if (lightSearch)
09769 {
09770 uiInfo.forceConfigSide[uiInfo.forceConfigCount] = qtrue; //light side config
09771 }
09772 else
09773 {
09774 uiInfo.forceConfigSide[uiInfo.forceConfigCount] = qfalse; //dark side config
09775 }
09776
09777 Com_sprintf( uiInfo.forceConfigNames[uiInfo.forceConfigCount], sizeof(uiInfo.forceConfigNames[uiInfo.forceConfigCount]), configname);
09778 uiInfo.forceConfigCount++;
09779 }
09780
09781 if (!lightSearch)
09782 {
09783 lightSearch = qtrue;
09784 goto nextSearch;
09785 }
09786 }
|
|
||||||||||||
|
Definition at line 1484 of file ui_main.c. References Com_Printf(), Load_Menu(), Menu_Reset(), pc_token_t, Q_stricmp(), S_COLOR_RED, S_COLOR_YELLOW, pc_token_s::string, trap_Error(), trap_Milliseconds(), trap_PC_FreeSource(), trap_PC_LoadGlobalDefines(), trap_PC_LoadSource(), trap_PC_ReadToken(), trap_PC_RemoveAllGlobalDefines(), and va(). Referenced by _UI_Init(), UI_Load(), and UI_LoadNonIngame().
01484 {
01485 pc_token_t token;
01486 int handle;
01487 int start;
01488
01489 start = trap_Milliseconds();
01490
01491 trap_PC_LoadGlobalDefines ( "ui/jamp/menudef.h" );
01492
01493 handle = trap_PC_LoadSource( menuFile );
01494 if (!handle) {
01495 Com_Printf( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile );
01496 handle = trap_PC_LoadSource( "ui/jampmenus.txt" );
01497 if (!handle) {
01498 trap_Error( va( S_COLOR_RED "default menu file not found: ui/menus.txt, unable to continue!\n", menuFile ) );
01499 }
01500 }
01501
01502 if (reset) {
01503 Menu_Reset();
01504 }
01505
01506 while ( 1 ) {
01507 if (!trap_PC_ReadToken(handle, &token))
01508 break;
01509 if( token.string[0] == 0 || token.string[0] == '}') {
01510 break;
01511 }
01512
01513 if ( token.string[0] == '}' ) {
01514 break;
01515 }
01516
01517 if (Q_stricmp(token.string, "loadmenu") == 0) {
01518 if (Load_Menu(handle)) {
01519 continue;
01520 } else {
01521 break;
01522 }
01523 }
01524 }
01525
01526 // Com_Printf("UI menu load time = %d milli seconds\n", trap_Milliseconds() - start);
01527
01528 trap_PC_FreeSource( handle );
01529
01530 trap_PC_RemoveAllGlobalDefines ( );
01531 }
|
|
|
Definition at line 10397 of file ui_main.c. References uiInfo_t::inGameLoad, NULL, qfalse, UI_Cvar_VariableString(), UI_LoadMenus(), and uiInfo.
10397 {
10398 const char *menuSet = UI_Cvar_VariableString("ui_menuFilesMP");
10399 if (menuSet == NULL || menuSet[0] == '\0') {
10400 menuSet = "ui/jampmenus.txt";
10401 }
10402 UI_LoadMenus(menuSet, qfalse);
10403 uiInfo.inGameLoad = qfalse;
10404 }
|
|
||||||||||||||||
|
Definition at line 343 of file ui_main.c. References animation_t, bgLoadedAnim_t::anims, animTable, atof(), atoi(), BG_ParseAnimationFile(), bgAllAnims, ceil(), Com_Error(), COM_Parse(), ERR_DROP, fileHandle_t, animation_s::firstFrame, floor(), animation_s::frameLerp, FS_READ, GetIDForString(), animation_s::loopFrames, MAX_ANIMATIONS, animation_s::numFrames, Q_stricmp(), qtrue, strcpy(), strstr(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), UI_AnimsetAlloc(), uiHumanoidAnimations, uiNumAllAnims, and UIPAFtextLoaded. Referenced by ItemParse_asset_model_go().
00344 {
00345 char *text_p;
00346 int len;
00347 int i;
00348 char *token;
00349 float fps;
00350 int skip;
00351 int usedIndex = -1;
00352 int nextIndex = uiNumAllAnims;
00353
00354 fileHandle_t f;
00355 int animNum;
00356
00357 if (!isHumanoid)
00358 {
00359 i = 1;
00360 while (i < uiNumAllAnims)
00361 { //see if it's been loaded already
00362 if (!Q_stricmp(bgAllAnims[i].filename, filename))
00363 {
00364 animset = bgAllAnims[i].anims;
00365 return i; //alright, we already have it.
00366 }
00367 i++;
00368 }
00369
00370 //Looks like it has not yet been loaded. Allocate space for the anim set if we need to, and continue along.
00371 if (!animset)
00372 {
00373 if (strstr(filename, "players/_humanoid/"))
00374 { //then use the static humanoid set.
00375 animset = uiHumanoidAnimations;
00376 isHumanoid = qtrue;
00377 nextIndex = 0;
00378 }
00379 else
00380 {
00381 animset = UI_AnimsetAlloc();
00382
00383 if (!animset)
00384 {
00385 assert(!"Anim set alloc failed!");
00386 return -1;
00387 }
00388 }
00389 }
00390 }
00391 #ifdef _DEBUG
00392 else
00393 {
00394 assert(animset);
00395 }
00396 #endif
00397
00398 // load the file
00399 if (!UIPAFtextLoaded || !isHumanoid)
00400 { //rww - We are always using the same animation config now. So only load it once.
00401 len = trap_FS_FOpenFile( filename, &f, FS_READ );
00402 if ( (len <= 0) || (len >= sizeof( UIPAFtext ) - 1) )
00403 {
00404 if (len > 0)
00405 {
00406 Com_Error(ERR_DROP, "%s exceeds the allowed ui-side animation buffer!", filename);
00407 }
00408 return -1;
00409 }
00410
00411 trap_FS_Read( UIPAFtext, len, f );
00412 UIPAFtext[len] = 0;
00413 trap_FS_FCloseFile( f );
00414 }
00415 else
00416 {
00417 return 0; //humanoid index
00418 }
00419
00420 // parse the text
00421 text_p = UIPAFtext;
00422 skip = 0; // quiet the compiler warning
00423
00424 //FIXME: have some way of playing anims backwards... negative numFrames?
00425
00426 //initialize anim array so that from 0 to MAX_ANIMATIONS, set default values of 0 1 0 100
00427 for(i = 0; i < MAX_ANIMATIONS; i++)
00428 {
00429 animset[i].firstFrame = 0;
00430 animset[i].numFrames = 0;
00431 animset[i].loopFrames = -1;
00432 animset[i].frameLerp = 100;
00433 // animset[i].initialLerp = 100;
00434 }
00435
00436 // read information for each frame
00437 while(1)
00438 {
00439 token = COM_Parse( (const char **)(&text_p) );
00440
00441 if ( !token || !token[0])
00442 {
00443 break;
00444 }
00445
00446 animNum = GetIDForString(animTable, token);
00447 if(animNum == -1)
00448 {
00449 //#ifndef FINAL_BUILD
00450 #ifdef _DEBUG
00451 //Com_Printf(S_COLOR_RED"WARNING: Unknown token %s in %s\n", token, filename);
00452 #endif
00453 continue;
00454 }
00455
00456 token = COM_Parse( (const char **)(&text_p) );
00457 if ( !token )
00458 {
00459 break;
00460 }
00461 animset[animNum].firstFrame = atoi( token );
00462
00463 token = COM_Parse( (const char **)(&text_p) );
00464 if ( !token )
00465 {
00466 break;
00467 }
00468 animset[animNum].numFrames = atoi( token );
00469
00470 token = COM_Parse( (const char **)(&text_p) );
00471 if ( !token )
00472 {
00473 break;
00474 }
00475 animset[animNum].loopFrames = atoi( token );
00476
00477 token = COM_Parse( (const char **)(&text_p) );
00478 if ( !token )
00479 {
00480 break;
00481 }
00482 fps = atof( token );
00483 if ( fps == 0 )
00484 {
00485 fps = 1;//Don't allow divide by zero error
00486 }
00487 if ( fps < 0 )
00488 {//backwards
00489 animset[animNum].frameLerp = floor(1000.0f / fps);
00490 }
00491 else
00492 {
00493 animset[animNum].frameLerp = ceil(1000.0f / fps);
00494 }
00495
00496 // animset[animNum].initialLerp = ceil(1000.0f / fabs(fps));
00497 }
00498
00499 #ifdef _DEBUG
00500 //Check the array, and print the ones that have nothing in them.
00501 /*
00502 for(i = 0; i < MAX_ANIMATIONS; i++)
00503 {
00504 if (animTable[i].name != NULL) // This animation reference exists.
00505 {
00506 if (animset[i].firstFrame <= 0 && animset[i].numFrames <=0)
00507 { // This is an empty animation reference.
00508 Com_Printf("***ANIMTABLE reference #%d (%s) is empty!\n", i, animTable[i].name);
00509 }
00510 }
00511 }
00512 */
00513 #endif // _DEBUG
00514
00515 if (isHumanoid)
00516 {
00517 bgAllAnims[0].anims = animset;
00518 strcpy(bgAllAnims[0].filename, filename);
00519 UIPAFtextLoaded = qtrue;
00520
00521 usedIndex = 0;
00522 }
00523 else
00524 {
00525 bgAllAnims[nextIndex].anims = animset;
00526 strcpy(bgAllAnims[nextIndex].filename, filename);
00527
00528 usedIndex = nextIndex;
00529
00530 if (nextIndex)
00531 { //don't bother increasing the number if this ended up as a humanoid load.
00532 uiNumAllAnims++;
00533 }
00534 else
00535 {
00536 UIPAFtextLoaded = qtrue;
00537 usedIndex = 0;
00538 }
00539 }
00540
00541 return usedIndex;
00542 }
|
|
|
Definition at line 1410 of file ui_main.c. References Asset_Parse(), memset(), Menu_New(), pc_token_t, Q_stricmp(), pc_token_s::string, trap_PC_FreeSource(), trap_PC_LoadSource(), and trap_PC_ReadToken(). Referenced by Load_Menu().
01410 {
01411 int handle;
01412 pc_token_t token;
01413
01414 //Com_Printf("Parsing menu file: %s\n", menuFile);
01415
01416 handle = trap_PC_LoadSource(menuFile);
01417 if (!handle) {
01418 return;
01419 }
01420
01421 while ( 1 ) {
01422 memset(&token, 0, sizeof(pc_token_t));
01423 if (!trap_PC_ReadToken( handle, &token )) {
01424 break;
01425 }
01426
01427 //if ( Q_stricmp( token, "{" ) ) {
01428 // Com_Printf( "Missing { in menu file\n" );
01429 // break;
01430 //}
01431
01432 //if ( menuCount == MAX_MENUS ) {
01433 // Com_Printf( "Too many menus!\n" );
01434 // break;
01435 //}
01436
01437 if ( token.string[0] == '}' ) {
01438 break;
01439 }
01440
01441 if (Q_stricmp(token.string, "assetGlobalDef") == 0) {
01442 if (Asset_Parse(handle)) {
01443 continue;
01444 } else {
01445 break;
01446 }
01447 }
01448
01449 if (Q_stricmp(token.string, "menudef") == 0) {
01450 // start a new menu
01451 Menu_New(handle);
01452 }
01453 }
01454 trap_PC_FreeSource(handle);
01455 }
|
|
|
Definition at line 11043 of file ui_main.c. References trap_Cvar_Register(). Referenced by _UI_Init().
11043 {
11044 int i;
11045 cvarTable_t *cv;
11046
11047 for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
11048 trap_Cvar_Register( cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags );
11049 }
11050 }
|
|
|
Definition at line 1404 of file ui_main.c. References String_Report(). Referenced by UI_ConsoleCommand().
01404 {
01405 String_Report();
01406 //Font_Report();
01407
01408 }
|
|
|
Definition at line 1019 of file ui_saber.c.
01020 {
01021 int numSabers = 1;
01022 int saberNum = 0;
01023
01024 if ( trap_G2API_HasGhoul2ModelOnIndex(&(item->ghoul2),2) )
01025 {//remove any extra models
01026 trap_G2API_RemoveGhoul2Model(&(item->ghoul2), 2);
01027 }
01028 if ( trap_G2API_HasGhoul2ModelOnIndex(&(item->ghoul2),1) )
01029 {//remove any extra models
01030 trap_G2API_RemoveGhoul2Model(&(item->ghoul2), 1);
01031 }
01032
01033 if ( uiInfo.movesTitleIndex == 4 /*MD_DUAL_SABERS*/ )
01034 {
01035 numSabers = 2;
01036 }
01037
01038 for ( saberNum = 0; saberNum < numSabers; saberNum++ )
01039 {
01040 //bolt sabers
01041 char modelPath[MAX_QPATH];
01042 char skinPath[MAX_QPATH];
01043 char saber[MAX_QPATH];
01044
01045 UI_GetSaberForMenu( saber, saberNum );
01046
01047 if ( UI_SaberModelForSaber( saber, modelPath ) )
01048 {//successfully found a model
01049 int g2Saber = trap_G2API_InitGhoul2Model( &(item->ghoul2), modelPath, 0, 0, 0, 0, 0 ); //add the model
01050 if ( g2Saber )
01051 {
01052 int boltNum;
01053 //get the customSkin, if any
01054 if ( UI_SaberSkinForSaber( saber, skinPath ) )
01055 {
01056 int g2skin = trap_R_RegisterSkin(skinPath);
01057 trap_G2API_SetSkin( item->ghoul2, g2Saber, 0, g2skin );//this is going to set the surfs on/off matching the skin file
01058 }
01059 else
01060 {
01061 trap_G2API_SetSkin( item->ghoul2, g2Saber, 0, 0 );//turn off custom skin
01062 }
01063 if ( saberNum == 0 )
01064 {
01065 boltNum = trap_G2API_AddBolt( item->ghoul2, 0, "*r_hand");
01066 }
01067 else
01068 {
01069 boltNum = trap_G2API_AddBolt( item->ghoul2, 0, "*l_hand");
01070 }
01071 trap_G2API_AttachG2Model( item->ghoul2, g2Saber, item->ghoul2, boltNum, 0);
01072 }
01073 }
01074 }
01075 }
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 167 of file ui_saber.c. References qboolean, and UI_SaberParseParm(). Referenced by UI_SaberAttachToChar().
00168 {
00169 return UI_SaberParseParm( saberName, "saberModel", saberModel );
00170 }
|
|
||||||||||||
|
Definition at line 300 of file ui_saber.c. References qboolean, strcpy(), trap_SP_GetStringTextString(), and UI_SaberParseParm().
00301 {
00302 char stringedSaberName[1024];
00303 qboolean ret = UI_SaberParseParm( saberName, "name", stringedSaberName );
00304 // if it's a stringed reference translate it
00305 if( ret && stringedSaberName && stringedSaberName[0] == '@')
00306 {
00307 trap_SP_GetStringTextString(&stringedSaberName[1], saberProperName, 1024);
00308 }
00309 else
00310 {
00311 // no stringed so just use it as it
00312 strcpy( saberProperName, stringedSaberName );
00313 }
00314
00315 return ret;
00316
00317 }
|
|
||||||||||||
|
Definition at line 172 of file ui_saber.c. References qboolean, and UI_SaberParseParm(). Referenced by UI_SaberAttachToChar().
00173 {
00174 return UI_SaberParseParm( saberName, "customSkin", saberSkin );
00175 }
|
|
||||||||||||
|
Definition at line 177 of file ui_saber.c. References qboolean, and UI_SaberParseParm(). Referenced by UI_GetSaberForMenu(), UI_SaberDrawBlades(), and UI_SiegeSetCvarsForClass().
00178 {
00179 return UI_SaberParseParm( saberName, "saberType", saberType );
00180 }
|
|
||||||||||||
|
Definition at line 4575 of file ui_main.c. References serverStatus_s::displayServers, serverStatus_s::numDisplayServers, qsort(), uiInfo_t::serverStatus, serverStatus_s::sortKey, and uiInfo.
04575 {
04576
04577 if ( !force ) {
04578 if ( uiInfo.serverStatus.sortKey == column ) {
04579 return;
04580 }
04581 }
04582
04583 uiInfo.serverStatus.sortKey = column;
04584 qsort( &uiInfo.serverStatus.displayServers[0], uiInfo.serverStatus.numDisplayServers, sizeof(int), UI_ServersQsortCompare);
04585 }
|
|
||||||||||||||||
|
Definition at line 5273 of file ui_main.c. References atof(), rectDef_t::h, itemDef_t, Menu_FindItemByName(), windowDef_t::rect, windowDef_t::rectClient, String_Parse(), trap_Cvar_VariableStringBuffer(), rectDef_t::w, itemDef_s::window, rectDef_t::x, and rectDef_t::y. Referenced by UI_UpdateSiegeObjectiveGraphics().
05274 {
05275 itemDef_t *item;
05276 char cvarBuf[1024];
05277 const char *holdVal;
05278 char *holdBuf;
05279
05280 item = Menu_FindItemByName(menu, itemName);
05281
05282 if (item)
05283 {
05284 // get cvar data
05285 trap_Cvar_VariableStringBuffer(cvarName, cvarBuf, sizeof(cvarBuf));
05286
05287 holdBuf = cvarBuf;
05288 if (String_Parse(&holdBuf,&holdVal))
05289 {
05290 item->window.rectClient.x = atof(holdVal);
05291 if (String_Parse(&holdBuf,&holdVal))
05292 {
05293 item->window.rectClient.y = atof(holdVal);
05294 if (String_Parse(&holdBuf,&holdVal))
05295 {
05296 item->window.rectClient.w = atof(holdVal);
05297 if (String_Parse(&holdBuf,&holdVal))
05298 {
05299 item->window.rectClient.h = atof(holdVal);
05300
05301 item->window.rect.x = item->window.rectClient.x;
05302 item->window.rect.y = item->window.rectClient.y;
05303
05304 item->window.rect.w = item->window.rectClient.w;
05305 item->window.rect.h = item->window.rectClient.h;
05306 }
05307 }
05308 }
05309 }
05310 }
05311 }
|
|
|
Definition at line 7861 of file ui_main.c. References atoi(), BG_SiegeFindThemeForTeam(), BG_SiegeGetPairedValue(), BG_SiegeGetValueGroup(), BG_SiegeSetTeamTheme(), siegeTeam_t::classes, Com_Error(), Com_sprintf(), CS_SERVERINFO, ERR_DROP, FEEDER_SIEGE_TEAM1, FEEDER_SIEGE_TEAM2, fileHandle_t, FS_READ, GT_SIEGE, Info_ValueForKey(), MAX_INFO_VALUE, MAX_QPATH, MAX_SIEGE_INFO_SIZE, Menu_SetFeederSelection(), NULL, Q_stricmp(), siege_info, siegeTeam1, siegeTeam2, SIEGETEAM_TEAM1, SIEGETEAM_TEAM2, strcpy(), trap_Cvar_VariableStringBuffer(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), and trap_GetConfigString().
07862 {
07863 char info[MAX_INFO_VALUE];
07864 char *mapname = NULL;
07865 char levelname[MAX_QPATH];
07866 char btime[1024];
07867 char teams[2048];
07868 char teamInfo[MAX_SIEGE_INFO_SIZE];
07869 char team1[1024];
07870 char team2[1024];
07871 int len = 0;
07872 int gametype;
07873 fileHandle_t f;
07874
07875 //Get the map name from the server info
07876 if (trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ))
07877 {
07878 mapname = Info_ValueForKey( info, "mapname" );
07879 }
07880
07881 if (!mapname || !mapname[0])
07882 {
07883 return;
07884 }
07885
07886 gametype = atoi(Info_ValueForKey(info, "g_gametype"));
07887
07888 //If the server we are connected to is not siege we cannot choose a class anyway
07889 if (gametype != GT_SIEGE)
07890 {
07891 return;
07892 }
07893
07894 Com_sprintf(levelname, sizeof(levelname), "maps/%s.siege", mapname);
07895
07896 if (!levelname || !levelname[0])
07897 {
07898 return;
07899 }
07900
07901 len = trap_FS_FOpenFile(levelname, &f, FS_READ);
07902
07903 if (!f || len >= MAX_SIEGE_INFO_SIZE)
07904 {
07905 return;
07906 }
07907
07908 trap_FS_Read(siege_info, len, f);
07909 siege_info[len] = 0; //ensure null terminated
07910
07911 trap_FS_FCloseFile(f);
07912
07913 //Found the .siege file
07914
07915 if (BG_SiegeGetValueGroup(siege_info, "Teams", teams))
07916 {
07917 char buf[1024];
07918
07919 trap_Cvar_VariableStringBuffer("cg_siegeTeam1", buf, 1024);
07920 if (buf[0] && Q_stricmp(buf, "none"))
07921 {
07922 strcpy(team1, buf);
07923 }
07924 else
07925 {
07926 BG_SiegeGetPairedValue(teams, "team1", team1);
07927 }
07928
07929 trap_Cvar_VariableStringBuffer("cg_siegeTeam2", buf, 1024);
07930 if (buf[0] && Q_stricmp(buf, "none"))
07931 {
07932 strcpy(team2, buf);
07933 }
07934 else
07935 {
07936 BG_SiegeGetPairedValue(teams, "team2", team2);
07937 }
07938 }
07939 else
07940 {
07941 return;
07942 }
07943
07944 //Set the team themes so we know what classes to make available for selection
07945 if (BG_SiegeGetValueGroup(siege_info, team1, teamInfo))
07946 {
07947 if (BG_SiegeGetPairedValue(teamInfo, "UseTeam", btime))
07948 {
07949 BG_SiegeSetTeamTheme(SIEGETEAM_TEAM1, btime);
07950 }
07951 }
07952 if (BG_SiegeGetValueGroup(siege_info, team2, teamInfo))
07953 {
07954 if (BG_SiegeGetPairedValue(teamInfo, "UseTeam", btime))
07955 {
07956 BG_SiegeSetTeamTheme(SIEGETEAM_TEAM2, btime);
07957 }
07958 }
07959
07960 siegeTeam1 = BG_SiegeFindThemeForTeam(SIEGETEAM_TEAM1);
07961 siegeTeam2 = BG_SiegeFindThemeForTeam(SIEGETEAM_TEAM2);
07962
07963 //set the default description for the default selection
07964 if (!siegeTeam1 || !siegeTeam1->classes[0])
07965 {
07966 Com_Error(ERR_DROP, "Error loading teams in UI");
07967 }
07968
07969 Menu_SetFeederSelection(NULL, FEEDER_SIEGE_TEAM1, 0, NULL);
07970 Menu_SetFeederSelection(NULL, FEEDER_SIEGE_TEAM2, -1, NULL);
07971 }
|
|
|
Definition at line 895 of file ui_main.c. References _UI_SetActiveMenu(), uiInfo_t::soundHighScore, trap_Cvar_Set(), uiInfo, and UIMENU_POSTGAME. Referenced by UI_ConsoleCommand().
00895 {
00896 trap_Cvar_Set ("cg_cameraOrbit", "0");
00897 trap_Cvar_Set("cg_thirdPerson", "0");
00898 trap_Cvar_Set( "sv_killserver", "1" );
00899 uiInfo.soundHighScore = newHigh;
00900 _UI_SetActiveMenu(UIMENU_POSTGAME);
00901 }
|
|
|
Definition at line 7845 of file ui_main.c. References bgNumSiegeClasses, and bgSiegeClasses. Referenced by UI_FeederSelection(), and UI_UpdateCvarsForClass().
07846 {
07847 int i = 0;
07848
07849 while (i < bgNumSiegeClasses)
07850 {
07851 if (&bgSiegeClasses[i] == scl)
07852 {
07853 return i;
07854 }
07855 i++;
07856 }
07857
07858 return 0;
07859 }
|
|
|
Definition at line 9946 of file ui_main.c. References BG_SiegeLoadClasses(), BG_SiegeLoadTeams(), bgNumSiegeClasses, bgNumSiegeTeams, Com_Error(), ERR_DROP, and g_UIClassDescriptions. Referenced by _UI_Init().
09947 {
09948 //Load the player class types
09949 BG_SiegeLoadClasses(g_UIClassDescriptions);
09950
09951 if (!bgNumSiegeClasses)
09952 { //We didn't find any?!
09953 Com_Error(ERR_DROP, "Couldn't find any player classes for Siege");
09954 }
09955
09956 //Now load the teams since we have class data.
09957 BG_SiegeLoadTeams();
09958
09959 if (!bgNumSiegeTeams)
09960 { //React same as with classes.
09961 Com_Error(ERR_DROP, "Couldn't find any player teams for Siege");
09962 }
09963 }
|
|
|
Definition at line 8944 of file ui_main.c. References BG_FindItemForHoldable(), BG_FindItemForWeapon(), siegeClass_t::classShader, gitem_s::description, siegeClass_t::forcePowerLevels, gitem_t, HI_NUM_HOLDABLE, HolocronIcons, gitem_s::icon, siegeClass_t::invenItems, MAX_QPATH, siegeClass_t::maxarmor, siegeClass_t::maxhealth, NUM_FORCE_POWERS, Q_stricmp(), siegeClass_t::saber1, siegeClass_t::saber2, siegeClass_t::speed, strcpy(), trap_Cvar_Set(), trap_R_ShaderNameFromIndex(), UI_SaberTypeForSaber(), va(), siegeClass_t::weapons, WP_NUM_WEAPONS, and WP_SABER. Referenced by _UI_Init(), UI_FeederSelection(), and UI_UpdateCvarsForClass().
08945 {
08946 int i = 0;
08947 int count = 0;
08948 char shader[MAX_QPATH];
08949
08950 //let's clear the things out first
08951 while (i < WP_NUM_WEAPONS)
08952 {
08953 trap_Cvar_Set(va("ui_class_weapon%i", i), "gfx/2d/select");
08954 i++;
08955 }
08956 //now for inventory items
08957 i = 0;
08958 while (i < HI_NUM_HOLDABLE)
08959 {
08960 trap_Cvar_Set(va("ui_class_item%i", i), "gfx/2d/select");
08961 i++;
08962 }
08963 //now for force powers
08964 i = 0;
08965 while (i < NUM_FORCE_POWERS)
08966 {
08967 trap_Cvar_Set(va("ui_class_power%i", i), "gfx/2d/select");
08968 i++;
08969 }
08970
08971 //now health and armor
08972 trap_Cvar_Set("ui_class_health", "0");
08973 trap_Cvar_Set("ui_class_armor", "0");
08974
08975 trap_Cvar_Set("ui_class_icon", "");
08976
08977 if (!scl)
08978 { //no select?
08979 return;
08980 }
08981
08982 //set cvars for which weaps we have
08983 i = 0;
08984 trap_Cvar_Set(va("ui_class_weapondesc%i", count), " "); // Blank it out to start with
08985 while (i < WP_NUM_WEAPONS)
08986 {
08987
08988 if (scl->weapons & (1<<i))
08989 {
08990
08991 if (i == WP_SABER)
08992 { //we want to see what kind of saber they have, and set the cvar based on that
08993 char saberType[1024];
08994
08995 if (scl->saber1[0] &&
08996 scl->saber2[0])
08997 {
08998 strcpy(saberType, "gfx/hud/w_icon_duallightsaber");
08999 } //fixme: need saber data access on ui to determine if staff, "gfx/hud/w_icon_saberstaff"
09000 else
09001 {
09002 char buf[1024];
09003 if (scl->saber1[0] && UI_SaberTypeForSaber(scl->saber1, buf))
09004 {
09005 if ( !Q_stricmp( buf, "SABER_STAFF" ) )
09006 {
09007 strcpy(saberType, "gfx/hud/w_icon_saberstaff");
09008 }
09009 else
09010 {
09011 strcpy(saberType, "gfx/hud/w_icon_lightsaber");
09012 }
09013 }
09014 else
09015 {
09016 strcpy(saberType, "gfx/hud/w_icon_lightsaber");
09017 }
09018 }
09019
09020 trap_Cvar_Set(va("ui_class_weapon%i", count), saberType);
09021 trap_Cvar_Set(va("ui_class_weapondesc%i", count), "@MENUS_AN_ELEGANT_WEAPON_FOR");
09022 count++;
09023 trap_Cvar_Set(va("ui_class_weapondesc%i", count), " "); // Blank it out to start with
09024 }
09025 else
09026 {
09027 gitem_t *item = BG_FindItemForWeapon( i );
09028 trap_Cvar_Set(va("ui_class_weapon%i", count), item->icon);
09029 trap_Cvar_Set(va("ui_class_weapondesc%i", count), item->description);
09030 count++;
09031 trap_Cvar_Set(va("ui_class_weapondesc%i", count), " "); // Blank it out to start with
09032 }
09033 }
09034
09035 i++;
09036 }
09037
09038 //now for inventory items
09039 i = 0;
09040 count = 0;
09041
09042 while (i < HI_NUM_HOLDABLE)
09043 {
09044 if (scl->invenItems & (1<<i))
09045 {
09046 gitem_t *item = BG_FindItemForHoldable(i);
09047 trap_Cvar_Set(va("ui_class_item%i", count), item->icon);
09048 trap_Cvar_Set(va("ui_class_itemdesc%i", count), item->description);
09049 count++;
09050 }
09051 else
09052 {
09053 trap_Cvar_Set(va("ui_class_itemdesc%i", count), " ");
09054 }
09055 i++;
09056 }
09057
09058 //now for force powers
09059 i = 0;
09060 count = 0;
09061
09062 while (i < NUM_FORCE_POWERS)
09063 {
09064 trap_Cvar_Set(va("ui_class_powerlevel%i", i), "0"); // Zero this out to start.
09065 if (i<9)
09066 {
09067 trap_Cvar_Set(va("ui_class_powerlevelslot%i", i), "0"); // Zero this out to start.
09068 }
09069
09070 if (scl->forcePowerLevels[i])
09071 {
09072 trap_Cvar_Set(
|