codemp/ui/ui_main.c File Reference

#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.

Data Structures

struct  cvarTable_t
struct  datpadmovedata_t
struct  serverStatusCvar_t

Defines

#define MAX_MOVES   16
#define UI_FPS_FRAMES   4
#define MAX_SABER_HILTS   64

Enumerations

enum  {
  MDS_NONE = 0, MDS_FORCE_JUMP, MDS_ROLL, MDS_SABER,
  MDS_MOVE_SOUNDS_MAX
}
enum  {
  MD_ACROBATICS = 0, MD_SINGLE_FAST, MD_SINGLE_MEDIUM, MD_SINGLE_STRONG,
  MD_DUAL_SABERS, MD_SABER_STAFF, MD_MOVE_TITLE_MAX
}

Functions

void UI_SaberAttachToChar (itemDef_t *item)
void _UI_Init (qboolean)
void _UI_Shutdown (void)
void _UI_KeyEvent (int key, qboolean down)
void _UI_MouseEvent (int dx, int dy)
void _UI_Refresh (int realtime)
qboolean _UI_IsFullscreen (void)
void UI_SetSiegeTeams (void)
qboolean UI_SaberModelForSaber (const char *saberName, char *saberModel)
void UI_SiegeSetCvarsForClass (siegeClass_t *scl)
int UI_SiegeClassNum (siegeClass_t *scl)
void UI_UpdateCvarsForClass (const int team, const baseClass, const int index)
void UI_UpdateSiegeStatusIcons (void)
void UI_ClampMaxPlayers (void)
void Menu_ShowGroup (menuDef_t *menu, char *itemName, qboolean showFlag)
void Menu_ItemDisable (menuDef_t *menu, char *name, int disableFlag)
int Menu_ItemsMatchingGroup (menuDef_t *menu, const char *name)
itemDef_tMenu_GetMatchingItemByNumber (menuDef_t *menu, int index, const char *name)
int BG_GetUIPortrait (const int team, const short classIndex, const short cntIndex)
char * BG_GetUIPortraitFile (const int team, const short classIndex, const short cntIndex)
siegeClass_tBG_GetClassOnBaseClass (const int team, const short classIndex, const short cntIndex)
int vmMain (int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11)
animation_tUI_AnimsetAlloc (void)
int UI_ParseAnimationFile (const char *filename, animation_t *animset, qboolean isHumanoid)
void Menu_ShowItemByName (menuDef_t *menu, const char *p, qboolean bShow)
void UpdateForceUsed ()
int ProcessNewUI (int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6)
const char * UI_GetStringEdString (const char *refSection, const char *refName)
const char * UI_TeamName (int team)
void AssetCache ()
void _UI_DrawSides (float x, float y, float w, float h, float size)
void _UI_DrawTopBottom (float x, float y, float w, float h, float size)
void _UI_DrawRect (float x, float y, float width, float height, float size, const float *color)
int MenuFontToHandle (int iMenuFont)
int Text_Width (const char *text, float scale, int iMenuFont)
int Text_Height (const char *text, float scale, int iMenuFont)
void Text_Paint (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style, int iMenuFont)
void Text_PaintWithCursor (float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style, int iMenuFont)
void UI_ShowPostGame (qboolean newHigh)
void UI_DrawCenteredPic (qhandle_t image, int w, int h)
void Text_PaintCenter (float x, float y, float scale, vec4_t color, const char *text, float adjust, int iMenuFont)
void UI_CleanupGhoul2 (void)
char * GetMenuBuffer (const char *filename)
qboolean Asset_Parse (int handle)
void UI_Report ()
void UI_ParseMenu (const char *menuFile)
qboolean Load_Menu (int handle)
void UI_LoadMenus (const char *menuFile, qboolean reset)
void UI_Load ()
qboolean UI_HasSetSaberOnly (void)
qboolean UI_TrueJediEnabled (void)
void UpdateBotButtons (void)
void UpdateForceStatus ()
void Item_RunScript (itemDef_t *item, const char *s)
void UI_ServersSort (int column, qboolean force)
void UI_UpdateVideoSetup (void)
void UI_GetVideoSetup (void)
void UI_SetSiegeObjectiveGraphicPos (menuDef_t *menu, const char *itemName, const char *cvarName)
void UI_FindCurrentSiegeTeamClass (void)
void UI_UpdateSiegeObjectiveGraphics (void)
saber_colors_t TranslateSaberColor (const char *name)
qboolean UI_SaberSkinForSaber (const char *saberName, char *saberSkin)
qboolean ItemParse_asset_model_go (itemDef_t *item, const char *name, int *runTimeLength)
qboolean ItemParse_model_g2skin_go (itemDef_t *item, const char *skinName)
char * SaberColorToString (saber_colors_t color)
qboolean ItemParse_model_g2anim_go (itemDef_t *item, const char *animName)
void UI_UpdateCharacterSkin (void)
qboolean UI_SaberProperNameForSaber (const char *saberName, char *saberProperName)
void UI_SaberGetHiltInfo (char *singleHilts[MAX_SABER_HILTS], char *staffHilts[MAX_SABER_HILTS])
int BG_SiegeCountBaseClass (const int team, const short classIndex)
qboolean UI_hasSkinForBase (const char *base, const char *team)
qboolean UI_SaberTypeForSaber (const char *saberName, char *saberType)
qboolean UI_FeederSelection (float feederFloat, int index, itemDef_t *item)
void UI_LoadForceConfig_List (void)
void UI_SiegeInit (void)
void UI_LoadNonIngame ()
void _UI_SetActiveMenu (uiMenuCommand_t menu)
void UI_DrawConnectScreen (qboolean overlay)
void UI_RegisterCvars (void)
void UI_UpdateCvars (void)

Variables

char * forcepowerDesc [NUM_FORCE_POWERS]
char * datapadMoveTitleData [MD_MOVE_TITLE_MAX]
char * datapadMoveTitleBaseAnims [MD_MOVE_TITLE_MAX]
vmCvar_t ui_debug
vmCvar_t ui_initialized
vmCvar_t ui_char_color_red
vmCvar_t ui_char_color_green
vmCvar_t ui_char_color_blue
vmCvar_t ui_PrecacheModels
vmCvar_t ui_char_anim
siegeClassDesc_t g_UIClassDescriptions [MAX_SIEGE_CLASSES]
siegeTeam_tsiegeTeam1 = NULL
siegeTeam_tsiegeTeam2 = NULL
int g_UIGloballySelectedSiegeClass = -1
qboolean UIPAFtextLoaded = qfalse
animation_t uiHumanoidAnimations [MAX_TOTALANIMATIONS]
bgLoadedAnim_t bgAllAnims [MAX_ANIM_FILES]
int uiNumAllAnims = 1
char holdSPString [MAX_STRING_CHARS] = {0}
char holdSPString2 [MAX_STRING_CHARS] = {0}
uiInfo_t uiInfo
int uiSkinColor = TEAM_FREE
int uiHoldSkinColor = TEAM_FREE
int frameCount = 0
int startTime
vmCvar_t ui_rankChange
char parsedFPMessage [1024]
int FPMessageTime
char * defaultMenu = NULL
int gUISelectedMap = 0
char * saberSingleHiltInfo [MAX_SABER_HILTS]
char * saberStaffHiltInfo [MAX_SABER_HILTS]
serverStatusCvar_t serverStatusCvars []
int g_siegedFeederForcedSet = 0
vmCvar_t ui_ffa_fraglimit
vmCvar_t ui_ffa_timelimit
vmCvar_t ui_selectedModelIndex
vmCvar_t ui_char_model
vmCvar_t ui_char_skin_head
vmCvar_t ui_char_skin_torso
vmCvar_t ui_char_skin_legs
vmCvar_t ui_saber_type
vmCvar_t ui_saber
vmCvar_t ui_saber2
vmCvar_t ui_saber_color
vmCvar_t ui_saber2_color
vmCvar_t ui_team_fraglimit
vmCvar_t ui_team_timelimit
vmCvar_t ui_team_friendly
vmCvar_t ui_ctf_capturelimit
vmCvar_t ui_ctf_timelimit
vmCvar_t ui_ctf_friendly
vmCvar_t ui_arenasFile
vmCvar_t ui_botsFile
vmCvar_t ui_spSkill
vmCvar_t ui_browserMaster
vmCvar_t ui_browserGameType
vmCvar_t ui_browserSortKey
vmCvar_t ui_browserShowFull
vmCvar_t ui_browserShowEmpty
vmCvar_t ui_drawCrosshair
vmCvar_t ui_drawCrosshairNames
vmCvar_t ui_marks
vmCvar_t ui_redteam
vmCvar_t ui_redteam1
vmCvar_t ui_redteam2
vmCvar_t ui_redteam3
vmCvar_t ui_redteam4
vmCvar_t ui_redteam5
vmCvar_t ui_redteam6
vmCvar_t ui_redteam7
vmCvar_t ui_redteam8
vmCvar_t ui_blueteam
vmCvar_t ui_blueteam1
vmCvar_t ui_blueteam2
vmCvar_t ui_blueteam3
vmCvar_t ui_blueteam4
vmCvar_t ui_blueteam5
vmCvar_t ui_blueteam6
vmCvar_t ui_blueteam7
vmCvar_t ui_blueteam8
vmCvar_t ui_teamName
vmCvar_t ui_dedicated
vmCvar_t ui_gameType
vmCvar_t ui_netGameType
vmCvar_t ui_actualNetGameType
vmCvar_t ui_joinGameType
vmCvar_t ui_netSource
vmCvar_t ui_serverFilterType
vmCvar_t ui_opponentName
vmCvar_t ui_menuFiles
vmCvar_t ui_currentMap
vmCvar_t ui_currentNetMap
vmCvar_t ui_mapIndex
vmCvar_t ui_currentOpponent
vmCvar_t ui_selectedPlayer
vmCvar_t ui_selectedPlayerName
vmCvar_t ui_lastServerRefresh_0
vmCvar_t ui_lastServerRefresh_1
vmCvar_t ui_lastServerRefresh_2
vmCvar_t ui_lastServerRefresh_3
vmCvar_t ui_singlePlayerActive
vmCvar_t ui_scoreAccuracy
vmCvar_t ui_scoreImpressives
vmCvar_t ui_scoreExcellents
vmCvar_t ui_scoreCaptures
vmCvar_t ui_scoreDefends
vmCvar_t ui_scoreAssists
vmCvar_t ui_scoreGauntlets
vmCvar_t ui_scoreScore
vmCvar_t ui_scorePerfect
vmCvar_t ui_scoreTeam
vmCvar_t ui_scoreBase
vmCvar_t ui_scoreTimeBonus
vmCvar_t ui_scoreSkillBonus
vmCvar_t ui_scoreShutoutBonus
vmCvar_t ui_scoreTime
vmCvar_t ui_captureLimit
vmCvar_t ui_fragLimit
vmCvar_t ui_findPlayer
vmCvar_t ui_hudFiles
vmCvar_t ui_recordSPDemo
vmCvar_t ui_realCaptureLimit
vmCvar_t ui_realWarmUp
vmCvar_t ui_serverStatusTimeOut
vmCvar_t se_language
vmCvar_t ui_bypassMainMenuLoad


Define Documentation

#define MAX_MOVES   16
 

Definition at line 91 of file ui_main.c.

#define MAX_SABER_HILTS   64
 

Definition at line 5737 of file ui_main.c.

Referenced by UI_SaberGetHiltInfo().

#define UI_FPS_FRAMES   4
 

Definition at line 936 of file ui_main.c.

Referenced by _UI_Refresh().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
MDS_NONE 
MDS_FORCE_JUMP 
MDS_ROLL 
MDS_SABER 
MDS_MOVE_SOUNDS_MAX 

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 };

anonymous enum
 

Enumeration values:
MD_ACROBATICS 
MD_SINGLE_FAST 
MD_SINGLE_MEDIUM 
MD_SINGLE_STRONG 
MD_DUAL_SABERS 
MD_SABER_STAFF 
MD_MOVE_TITLE_MAX 

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 };


Function Documentation

void _UI_DrawRect float  x,
float  y,
float  width,
float  height,
float  size,
const float *  color
 

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 }

void _UI_DrawSides float  x,
float  y,
float  w,
float  h,
float  size
 

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 }

void _UI_DrawTopBottom float  x,
float  y,
float  w,
float  h,
float  size
 

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 }

void _UI_Init qboolean   ) 
 

Definition at line 10164 of file ui_main.c.

References _UI_DrawRect(), _UI_DrawSides(), _UI_DrawTopBottom(), displayContextDef_t::addRefEntityToScene, uiInfo_t::aliasCount, displayContextDef_t::AnyLanguage_ReadCharFromString, AssetCache(), displayContextDef_t::bias, uiInfo_t::characterCount, displayContextDef_t::clearScene, Com_Error(), Com_Printf(), uiInfo_t::currentCrosshair, serverStatus_s::currentServerCinematic, displayContextDef_t::cursor, CVAR_ARCHIVE, CVAR_INTERNAL, CVAR_SERVERINFO, displayContextDef_t::deferScript, displayContextDef_t::drawCinematic, displayContextDef_t::drawHandlePic, displayContextDef_t::drawRect, displayContextDef_t::drawSides, displayContextDef_t::drawStretchPic, displayContextDef_t::drawText, displayContextDef_t::drawTextWithCursor, displayContextDef_t::drawTopBottom, uiInfo_t::effectsColor, displayContextDef_t::Error, displayContextDef_t::executeText, displayContextDef_t::feederCount, displayContextDef_t::feederItemImage, displayContextDef_t::feederItemText, displayContextDef_t::feederSelection, displayContextDef_t::fillRect, displayContextDef_t::Font_DrawString, displayContextDef_t::Font_HeightPixels, displayContextDef_t::Font_StrLenChars, displayContextDef_t::Font_StrLenPixels, uiInfo_t::gameTypes, displayContextDef_t::getBindingBuf, displayContextDef_t::getCVarString, displayContextDef_t::getCVarValue, displayContextDef_t::getOverstrikeMode, displayContextDef_t::getTeamColor, displayContextDef_t::getValue, displayContextDef_t::glconfig, uiInfo_t::inGameLoad, Init_Display(), vmCvar_t::integer, displayContextDef_t::keynumToStringBuf, displayContextDef_t::Language_IsAsian, displayContextDef_t::Language_UsesSpaces, uiInfo_t::languageCount, uiInfo_t::mapList, Menus_CloseAll(), displayContextDef_t::modelBounds, NULL, displayContextDef_t::ownerDrawHandleKey, displayContextDef_t::ownerDrawItem, displayContextDef_t::ownerDrawVisible, displayContextDef_t::ownerDrawWidth, displayContextDef_t::Pause, displayContextDef_t::playCinematic, uiInfo_t::previewMovie, displayContextDef_t::Print, qtrue, displayContextDef_t::RegisterFont, displayContextDef_t::registerModel, displayContextDef_t::registerShaderNoMip, displayContextDef_t::registerSound, displayContextDef_t::renderScene, displayContextDef_t::runCinematicFrame, displayContextDef_t::runScript, uiInfo_t::serverStatus, displayContextDef_t::setBinding, displayContextDef_t::setColor, displayContextDef_t::setCVar, displayContextDef_t::setOverstrikeMode, displayContextDef_t::startBackgroundTrack, displayContextDef_t::startLocalSound, displayContextDef_t::stopBackgroundTrack, displayContextDef_t::stopCinematic, String_Init(), uiInfo_t::teamCount, Text_Height(), Text_Paint(), Text_PaintWithCursor(), Text_Width(), displayContextDef_t::textHeight, displayContextDef_t::textWidth, trap_AnyLanguage_ReadCharFromString(), trap_Cmd_ExecuteText(), trap_Cvar_Register(), trap_Cvar_Set(), trap_Cvar_VariableStringBuffer(), trap_Cvar_VariableValue(), trap_GetGlconfig(), trap_Key_GetBindingBuf(), trap_Key_GetOverstrikeMode(), trap_Key_KeynumToStringBuf(), trap_Key_SetBinding(), trap_Key_SetOverstrikeMode(), trap_LAN_LoadCachedServers(), trap_Language_IsAsian(), trap_Language_UsesSpaces(), trap_Milliseconds(), trap_R_AddRefEntityToScene(), trap_R_ClearScene(), trap_R_DrawStretchPic(), trap_R_Font_DrawString(), trap_R_Font_HeightPixels(), trap_R_Font_StrLenChars(), trap_R_Font_StrLenPixels(), trap_R_ModelBounds(), trap_R_RegisterFont(), trap_R_RegisterModel(), trap_R_RegisterShaderNoMip(), trap_R_RenderScene(), trap_S_RegisterSound(), trap_S_StartBackgroundTrack(), trap_S_StartLocalSound(), trap_S_StopBackgroundTrack(), trap_SP_GetNumLanguages(), ui_bypassMainMenuLoad, ui_currentMap, UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_FeederSelection(), UI_FillRect(), ui_gameType, UI_InitForceShaders(), UI_InitMemory(), UI_LoadBestScores(), UI_LoadBots(), UI_LoadForceConfig_List(), UI_LoadMenus(), ui_netGameType, UI_RegisterCvars(), UI_SetColor(), UI_SiegeInit(), UI_SiegeSetCvarsForClass(), UI_UpdateForcePowers(), uiInfo_t::uiDC, uiInfo, va(), glconfig_t::vidHeight, glconfig_t::vidWidth, displayContextDef_t::whiteShader, displayContextDef_t::xscale, and displayContextDef_t::yscale.

Referenced by vmMain().

10164                                      {
10165         const char *menuSet;
10166         int start;
10167 
10168         //register this freakin thing now
10169         vmCvar_t siegeTeamSwitch;
10170         trap_Cvar_Register(&siegeTeamSwitch, "g_siegeTeamSwitch", "1", CVAR_SERVERINFO|CVAR_ARCHIVE);
10171 
10172         // Get the list of possible languages
10173         uiInfo.languageCount = trap_SP_GetNumLanguages();       // this does a dir scan, so use carefully
10174 
10175         uiInfo.inGameLoad = inGameLoad;
10176 
10177         //initialize all these cvars to "0"
10178         UI_SiegeSetCvarsForClass(NULL);
10179 
10180         UI_SiegeInit();
10181 
10182         UI_UpdateForcePowers();
10183 
10184         UI_RegisterCvars();
10185         UI_InitMemory();
10186 
10187         // cache redundant calulations
10188         trap_GetGlconfig( &uiInfo.uiDC.glconfig );
10189 
10190         // for 640x480 virtualized screen
10191         uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0/480.0);
10192         uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * (1.0/640.0);
10193         if ( uiInfo.uiDC.glconfig.vidWidth * 480 > uiInfo.uiDC.glconfig.vidHeight * 640 ) {
10194                 // wide screen
10195                 uiInfo.uiDC.bias = 0.5 * ( uiInfo.uiDC.glconfig.vidWidth - ( uiInfo.uiDC.glconfig.vidHeight * (640.0/480.0) ) );
10196         }
10197         else {
10198                 // no wide screen
10199                 uiInfo.uiDC.bias = 0;
10200         }
10201 
10202 
10203   //UI_Load();
10204         uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip;
10205         uiInfo.uiDC.setColor = &UI_SetColor;
10206         uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic;
10207         uiInfo.uiDC.drawStretchPic = &trap_R_DrawStretchPic;
10208         uiInfo.uiDC.drawText = &Text_Paint;
10209         uiInfo.uiDC.textWidth = &Text_Width;
10210         uiInfo.uiDC.textHeight = &Text_Height;
10211         uiInfo.uiDC.registerModel = &trap_R_RegisterModel;
10212         uiInfo.uiDC.modelBounds = &trap_R_ModelBounds;
10213         uiInfo.uiDC.fillRect = &UI_FillRect;
10214         uiInfo.uiDC.drawRect = &_UI_DrawRect;
10215         uiInfo.uiDC.drawSides = &_UI_DrawSides;
10216         uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom;
10217         uiInfo.uiDC.clearScene = &trap_R_ClearScene;
10218         uiInfo.uiDC.drawSides = &_UI_DrawSides;
10219         uiInfo.uiDC.addRefEntityToScene = &trap_R_AddRefEntityToScene;
10220         uiInfo.uiDC.renderScene = &trap_R_RenderScene;
10221         uiInfo.uiDC.RegisterFont = &trap_R_RegisterFont;
10222         uiInfo.uiDC.Font_StrLenPixels = trap_R_Font_StrLenPixels;
10223         uiInfo.uiDC.Font_StrLenChars = trap_R_Font_StrLenChars;
10224         uiInfo.uiDC.Font_HeightPixels = trap_R_Font_HeightPixels;
10225         uiInfo.uiDC.Font_DrawString = trap_R_Font_DrawString;
10226         uiInfo.uiDC.Language_IsAsian = trap_Language_IsAsian;
10227         uiInfo.uiDC.Language_UsesSpaces = trap_Language_UsesSpaces;
10228         uiInfo.uiDC.AnyLanguage_ReadCharFromString = trap_AnyLanguage_ReadCharFromString;
10229         uiInfo.uiDC.ownerDrawItem = &UI_OwnerDraw;
10230         uiInfo.uiDC.getValue = &UI_GetValue;
10231         uiInfo.uiDC.ownerDrawVisible = &UI_OwnerDrawVisible;
10232         uiInfo.uiDC.runScript = &UI_RunMenuScript;
10233         uiInfo.uiDC.deferScript = &UI_DeferMenuScript;
10234         uiInfo.uiDC.getTeamColor = &UI_GetTeamColor;
10235         uiInfo.uiDC.setCVar = trap_Cvar_Set;
10236         uiInfo.uiDC.getCVarString = trap_Cvar_VariableStringBuffer;
10237         uiInfo.uiDC.getCVarValue = trap_Cvar_VariableValue;
10238         uiInfo.uiDC.drawTextWithCursor = &Text_PaintWithCursor;
10239         uiInfo.uiDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode;
10240         uiInfo.uiDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode;
10241         uiInfo.uiDC.startLocalSound = &trap_S_StartLocalSound;
10242         uiInfo.uiDC.ownerDrawHandleKey = &UI_OwnerDrawHandleKey;
10243         uiInfo.uiDC.feederCount = &UI_FeederCount;
10244         uiInfo.uiDC.feederItemImage = &UI_FeederItemImage;
10245         uiInfo.uiDC.feederItemText = &UI_FeederItemText;
10246         uiInfo.uiDC.feederSelection = &UI_FeederSelection;
10247         uiInfo.uiDC.setBinding = &trap_Key_SetBinding;
10248         uiInfo.uiDC.getBindingBuf = &trap_Key_GetBindingBuf;
10249         uiInfo.uiDC.keynumToStringBuf = &trap_Key_KeynumToStringBuf;
10250         uiInfo.uiDC.executeText = &trap_Cmd_ExecuteText;
10251         uiInfo.uiDC.Error = &Com_Error; 
10252         uiInfo.uiDC.Print = &Com_Printf; 
10253         uiInfo.uiDC.Pause = &UI_Pause;
10254         uiInfo.uiDC.ownerDrawWidth = &UI_OwnerDrawWidth;
10255         uiInfo.uiDC.registerSound = &trap_S_RegisterSound;
10256         uiInfo.uiDC.startBackgroundTrack = &trap_S_StartBackgroundTrack;
10257         uiInfo.uiDC.stopBackgroundTrack = &trap_S_StopBackgroundTrack;
10258         uiInfo.uiDC.playCinematic = &UI_PlayCinematic;
10259         uiInfo.uiDC.stopCinematic = &UI_StopCinematic;
10260         uiInfo.uiDC.drawCinematic = &UI_DrawCinematic;
10261         uiInfo.uiDC.runCinematicFrame = &UI_RunCinematicFrame;
10262 
10263         Init_Display(&uiInfo.uiDC);
10264 
10265         UI_BuildPlayerModel_List(inGameLoad);
10266 
10267         String_Init();
10268   
10269         uiInfo.uiDC.cursor      = trap_R_RegisterShaderNoMip( "menu/art/3_cursor2" );
10270         uiInfo.uiDC.whiteShader = trap_R_RegisterShaderNoMip( "white" );
10271 
10272         AssetCache();
10273 
10274         start = trap_Milliseconds();
10275 
10276   uiInfo.teamCount = 0;
10277   uiInfo.characterCount = 0;
10278   uiInfo.aliasCount = 0;
10279 
10280         UI_ParseGameInfo("ui/jamp/gameinfo.txt");
10281 
10282         menuSet = UI_Cvar_VariableString("ui_menuFilesMP");
10283         if (menuSet == NULL || menuSet[0] == '\0') {
10284                 menuSet = "ui/jampmenus.txt";
10285         }
10286 
10287 #if 1
10288         if (inGameLoad)
10289         {
10290                 UI_LoadMenus("ui/jampingame.txt", qtrue);
10291         }
10292         else if (!ui_bypassMainMenuLoad.integer)
10293         {
10294                 UI_LoadMenus(menuSet, qtrue);
10295         }
10296 #else //this was adding quite a giant amount of time to the load time
10297         UI_LoadMenus(menuSet, qtrue);
10298         UI_LoadMenus("ui/jampingame.txt", qtrue);
10299 #endif
10300         
10301         trap_Cvar_Register(NULL, "ui_name", UI_Cvar_VariableString("name"), CVAR_INTERNAL );    //get this now, jic the menus change again trying to setName before getName
10302 
10303         Menus_CloseAll();
10304 
10305         trap_LAN_LoadCachedServers();
10306         UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum);
10307 
10308         UI_BuildQ3Model_List();
10309         UI_LoadBots();
10310 
10311         UI_LoadForceConfig_List();
10312 
10313         UI_InitForceShaders();
10314 
10315         // sets defaults for ui temp cvars
10316         uiInfo.effectsColor = /*gamecodetoui[*/(int)trap_Cvar_VariableValue("color1");//-1];
10317         uiInfo.currentCrosshair = (int)trap_Cvar_VariableValue("cg_drawCrosshair");
10318         trap_Cvar_Set("ui_mousePitch", (trap_Cvar_VariableValue("m_pitch") >= 0) ? "0" : "1");
10319         trap_Cvar_Set("ui_mousePitchVeh", (trap_Cvar_VariableValue("m_pitchVeh") >= 0) ? "0" : "1");
10320 
10321         uiInfo.serverStatus.currentServerCinematic = -1;
10322         uiInfo.previewMovie = -1;
10323 
10324         trap_Cvar_Register(NULL, "debug_protocol", "", 0 );
10325 
10326         trap_Cvar_Set("ui_actualNetGameType", va("%d", ui_netGameType.integer));
10327 }

qboolean _UI_IsFullscreen void   ) 
 

Definition at line 10533 of file ui_main.c.

References Menus_AnyFullScreenVisible(), and qboolean.

Referenced by vmMain().

10533                                   {
10534         return Menus_AnyFullScreenVisible();
10535 }

void _UI_KeyEvent int  key,
qboolean  down
 

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 }

void _UI_MouseEvent int  dx,
int  dy
 

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 }

void _UI_Refresh int  realtime  ) 
 

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 }

void _UI_SetActiveMenu uiMenuCommand_t  menu  ) 
 

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 }

void _UI_Shutdown void   ) 
 

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 }

qboolean Asset_Parse int  handle  ) 
 

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 }

void AssetCache  ) 
 

Definition at line 688 of file ui_main.c.

References ART_FX_BASE, ART_FX_BLUE, ART_FX_GREEN, ART_FX_ORANGE, ART_FX_PURPLE, ART_FX_RED, ART_FX_WHITE, ART_FX_YELLOW, ASSET_GRADIENTBAR, ASSET_SCROLL_THUMB, ASSET_SCROLLBAR, ASSET_SCROLLBAR_ARROWDOWN, ASSET_SCROLLBAR_ARROWLEFT, ASSET_SCROLLBAR_ARROWRIGHT, ASSET_SCROLLBAR_ARROWUP, ASSET_SLIDER_BAR, ASSET_SLIDER_THUMB, displayContextDef_t::Assets, cachedAssets_t::crosshairShader, cachedAssets_t::forceRestrict, cachedAssets_t::fxBasePic, cachedAssets_t::fxPic, cachedAssets_t::gradientBar, cachedAssets_t::needPass, uiInfo_t::newHighScoreSound, cachedAssets_t::noForce, NUM_CROSSHAIRS, cachedAssets_t::saberOnly, cachedAssets_t::scrollBar, cachedAssets_t::scrollBarArrowDown, cachedAssets_t::scrollBarArrowLeft, cachedAssets_t::scrollBarArrowRight, cachedAssets_t::scrollBarArrowUp, cachedAssets_t::scrollBarThumb, cachedAssets_t::sliderBar, cachedAssets_t::sliderThumb, trap_R_RegisterShaderNoMip(), cachedAssets_t::trueJedi, uiInfo_t::uiDC, uiInfo, and va().

Referenced by _UI_Init().

00688                   {
00689         int n;
00690         //if (Assets.textFont == NULL) {
00691         //}
00692         //Assets.background = trap_R_RegisterShaderNoMip( ASSET_BACKGROUND );
00693         //Com_Printf("Menu Size: %i bytes\n", sizeof(Menus));
00694         uiInfo.uiDC.Assets.gradientBar = trap_R_RegisterShaderNoMip( ASSET_GRADIENTBAR );
00695         uiInfo.uiDC.Assets.fxBasePic = trap_R_RegisterShaderNoMip( ART_FX_BASE );
00696         uiInfo.uiDC.Assets.fxPic[0] = trap_R_RegisterShaderNoMip( ART_FX_RED );
00697         uiInfo.uiDC.Assets.fxPic[1] = trap_R_RegisterShaderNoMip( ART_FX_ORANGE );//trap_R_RegisterShaderNoMip( ART_FX_YELLOW );
00698         uiInfo.uiDC.Assets.fxPic[2] = trap_R_RegisterShaderNoMip( ART_FX_YELLOW );//trap_R_RegisterShaderNoMip( ART_FX_GREEN );
00699         uiInfo.uiDC.Assets.fxPic[3] = trap_R_RegisterShaderNoMip( ART_FX_GREEN );//trap_R_RegisterShaderNoMip( ART_FX_TEAL );
00700         uiInfo.uiDC.Assets.fxPic[4] = trap_R_RegisterShaderNoMip( ART_FX_BLUE );
00701         uiInfo.uiDC.Assets.fxPic[5] = trap_R_RegisterShaderNoMip( ART_FX_PURPLE );//trap_R_RegisterShaderNoMip( ART_FX_CYAN );
00702         uiInfo.uiDC.Assets.fxPic[6] = trap_R_RegisterShaderNoMip( ART_FX_WHITE );
00703         uiInfo.uiDC.Assets.scrollBar = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR );
00704         uiInfo.uiDC.Assets.scrollBarArrowDown = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWDOWN );
00705         uiInfo.uiDC.Assets.scrollBarArrowUp = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWUP );
00706         uiInfo.uiDC.Assets.scrollBarArrowLeft = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWLEFT );
00707         uiInfo.uiDC.Assets.scrollBarArrowRight = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWRIGHT );
00708         uiInfo.uiDC.Assets.scrollBarThumb = trap_R_RegisterShaderNoMip( ASSET_SCROLL_THUMB );
00709         uiInfo.uiDC.Assets.sliderBar = trap_R_RegisterShaderNoMip( ASSET_SLIDER_BAR );
00710         uiInfo.uiDC.Assets.sliderThumb = trap_R_RegisterShaderNoMip( ASSET_SLIDER_THUMB );
00711 
00712         // Icons for various server settings.
00713         uiInfo.uiDC.Assets.needPass = trap_R_RegisterShaderNoMip( "gfx/menus/needpass" );
00714         uiInfo.uiDC.Assets.noForce = trap_R_RegisterShaderNoMip( "gfx/menus/noforce" );
00715         uiInfo.uiDC.Assets.forceRestrict = trap_R_RegisterShaderNoMip( "gfx/menus/forcerestrict" );
00716         uiInfo.uiDC.Assets.saberOnly = trap_R_RegisterShaderNoMip( "gfx/menus/saberonly" );
00717         uiInfo.uiDC.Assets.trueJedi = trap_R_RegisterShaderNoMip( "gfx/menus/truejedi" );
00718                                                         
00719         for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
00720                 uiInfo.uiDC.Assets.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
00721         }
00722 
00723         uiInfo.newHighScoreSound = 0;//trap_S_RegisterSound("sound/feedback/voc_newhighscore.wav");
00724 }

siegeClass_t* BG_GetClassOnBaseClass const int  team,
const short  classIndex,
const short  cntIndex
 

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 }

int BG_GetUIPortrait const int  team,
const short  classIndex,
const short  cntIndex
 

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 }

char* BG_GetUIPortraitFile const int  team,
const short  classIndex,
const short  cntIndex
 

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 }

int BG_SiegeCountBaseClass const int  team,
const short  classIndex
 

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 }

char* GetMenuBuffer const char *  filename  ) 
 

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 }

void Item_RunScript itemDef_t item,
const char *  s
 

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 }

qboolean ItemParse_asset_model_go itemDef_t item,
const char *  name,
int *  runTimeLength
 

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 }

qboolean ItemParse_model_g2anim_go itemDef_t item,
const char *  animName
 

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 }

qboolean ItemParse_model_g2skin_go itemDef_t item,
const char *  skinName
 

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 }

qboolean Load_Menu int  handle  ) 
 

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 }

itemDef_t* Menu_GetMatchingItemByNumber menuDef_t menu,
int  index,
const char *  name
 

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 }

void Menu_ItemDisable menuDef_t menu,
char *  name,
int  disableFlag
 

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 }

int Menu_ItemsMatchingGroup menuDef_t menu,
const char *  name
 

Definition at line 1026 of file ui_shared.c.

References Com_Printf(), windowDef_t::group, menuDef_t::itemCount, menuDef_t::items, windowDef_t::name, name, Q_stricmp(), S_COLOR_YELLOW, 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().

01027 {
01028         int i;
01029         int count = 0;
01030 
01031         for (i = 0; i < menu->itemCount; i++) 
01032         {
01033                 if ((!menu->items[i]->window.name) && (!menu->items[i]->window.group))
01034                 {
01035                         Com_Printf(S_COLOR_YELLOW"WARNING: item has neither name or group\n");
01036                         continue;
01037                 }
01038 
01039                 if (Q_stricmp(menu->items[i]->window.name, name) == 0 || 
01040                         (menu->items[i]->window.group && Q_stricmp(menu->items[i]->window.group, name) == 0)) 
01041                 {
01042                         count++;
01043                 } 
01044         }
01045 
01046         return count;
01047 }

void Menu_ShowGroup menuDef_t menu,
char *  itemName,
qboolean  showFlag
 

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 }

void Menu_ShowItemByName menuDef_t menu,
const char *  p,
qboolean  bShow
 

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 }

int MenuFontToHandle int  iMenuFont  ) 
 

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 }

int ProcessNewUI int  command,
int  arg0,
int  arg1,
int  arg2,
int  arg3,
int  arg4,
int  arg5,
int  arg6
 

char* SaberColorToString saber_colors_t  color  ) 
 

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 }

int Text_Height const char *  text,
float  scale,
int  iMenuFont
 

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 }

void Text_Paint float  x,
float  y,
float  scale,
vec4_t  color,
const char *  text,
float  adjust,
int  limit,
int  style,
int  iMenuFont
 

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 }

void Text_PaintCenter float  x,
float  y,
float  scale,
vec4_t  color,
const char *  text,
float  adjust,
int  iMenuFont
 

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 }

void Text_PaintWithCursor float  x,
float  y,
float  scale,
vec4_t  color,
const char *  text,
int  cursorPos,
char  cursor,
int  limit,
int  style,
int  iMenuFont
 

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 }

int Text_Width const char *  text,
float  scale,
int  iMenuFont
 

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 }

saber_colors_t TranslateSaberColor const char *  name  ) 
 

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 }

animation_t* UI_AnimsetAlloc void   ) 
 

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 }

void UI_ClampMaxPlayers void   ) 
 

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 }

void UI_CleanupGhoul2 void   ) 
 

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 }

void UI_DrawCenteredPic qhandle_t  image,
int  w,
int  h
 

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 }

void UI_DrawConnectScreen qboolean  overlay  ) 
 

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 }

qboolean UI_FeederSelection float  feederFloat,
int  index,
itemDef_t item
 

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 }

void UI_FindCurrentSiegeTeamClass void   ) 
 

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 }

const char * UI_GetStringEdString const char *  refSection,
const char *  refName
 

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 }

void UI_GetVideoSetup void   ) 
 

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 }

qboolean UI_HasSetSaberOnly void   ) 
 

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 }

qboolean UI_hasSkinForBase const char *  base,
const char *  team
 

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 }

void UI_Load  ) 
 

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 }

void UI_LoadForceConfig_List void   ) 
 

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 }

void UI_LoadMenus const char *  menuFile,
qboolean  reset
 

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 }

void UI_LoadNonIngame  ) 
 

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 }

int UI_ParseAnimationFile const char *  filename,
animation_t animset,
qboolean  isHumanoid
 

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 }

void UI_ParseMenu const char *  menuFile  ) 
 

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 }

void UI_RegisterCvars void   ) 
 

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 }

void UI_Report  ) 
 

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 }

void UI_SaberAttachToChar itemDef_t item  ) 
 

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 }

void UI_SaberGetHiltInfo char *  singleHilts[MAX_SABER_HILTS],
char *  staffHilts[MAX_SABER_HILTS]
 

qboolean UI_SaberModelForSaber const char *  saberName,
char *  saberModel
 

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 }

qboolean UI_SaberProperNameForSaber const char *  saberName,
char *  saberProperName
 

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 }

qboolean UI_SaberSkinForSaber const char *  saberName,
char *  saberSkin
 

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 }

qboolean UI_SaberTypeForSaber const char *  saberName,
char *  saberType
 

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 }

void UI_ServersSort int  column,
qboolean  force
 

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 }

void UI_SetSiegeObjectiveGraphicPos menuDef_t menu,
const char *  itemName,
const char *  cvarName
 

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 }

void UI_SetSiegeTeams void   ) 
 

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 }

void UI_ShowPostGame qboolean  newHigh  ) 
 

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 }

int UI_SiegeClassNum siegeClass_t scl  ) 
 

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 }

void UI_SiegeInit void   ) 
 

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 }

void UI_SiegeSetCvarsForClass siegeClass_t scl  ) 
 

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(va("ui_class_powerlevel%i", count), va("%i",scl->forcePowerLevels[i]));
09073                         trap_Cvar_Set(va("ui_class_power%i", count), HolocronIcons[i]);
09074                         count++;
09075                 }
09076 
09077                 i++;
09078         }
09079 
09080         //now health and armor
09081         trap_Cvar_Set("ui_class_health", va("%i", scl->maxhealth));
09082         trap_Cvar_Set("ui_class_armor", va("%i", scl->maxarmor));
09083         trap_Cvar_Set("ui_class_speed", va("%3.2f", scl->speed));
09084 
09085         //now get the icon path based on the shader index
09086         if (scl->classShader)
09087         {
09088                 trap_R_ShaderNameFromIndex(shader, scl->classShader);
09089         }
09090         else
09091         { //no shader
09092                 shader[0] = 0;
09093         }
09094         trap_Cvar_Set("ui_class_icon", shader);
09095 }

const char* UI_TeamName int  team  ) 
 

Definition at line 621 of file ui_main.c.

References TEAM_BLUE, TEAM_RED, and TEAM_SPECTATOR.

Referenced by UI_JediNonJedi_HandleKey(), and UpdateForceUsed().

00621                                    {
00622         if (team==TEAM_RED)
00623                 return "RED";
00624         else if (team==TEAM_BLUE)
00625                 return "BLUE";
00626         else if (team==TEAM_SPECTATOR)
00627                 return "SPECTATOR";
00628         return "FREE";
00629 }

qboolean UI_TrueJediEnabled void   ) 
 

Definition at line 1970 of file ui_main.c.

References atoi(), CS_SERVERINFO, GT_HOLOCRON, GT_JEDIMASTER, Info_ValueForKey(), MAX_INFO_STRING, qboolean, qfalse, trap_GetConfigString(), and UI_HasSetSaberOnly().

Referenced by UI_JediNonJedi_HandleKey(), UpdateForceStatus(), and UpdateForceUsed().

01971 {
01972         char    info[MAX_INFO_STRING];
01973         int             gametype = 0, disabledForce = 0, trueJedi = 0;
01974         qboolean saberOnly = qfalse, allForceDisabled = qfalse;
01975 
01976         trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
01977 
01978         //already have serverinfo at this point for stuff below. Don't bother trying to use ui_forcePowerDisable.
01979         //if (ui_forcePowerDisable.integer)
01980         //if (atoi(Info_ValueForKey(info, "g_forcePowerDisable")))
01981         disabledForce = atoi(Info_ValueForKey(info, "g_forcePowerDisable"));
01982         allForceDisabled = UI_AllForceDisabled(disabledForce);
01983         gametype = atoi(Info_ValueForKey(info, "g_gametype"));
01984         saberOnly = UI_HasSetSaberOnly();
01985 
01986         if ( gametype == GT_HOLOCRON 
01987                 || gametype == GT_JEDIMASTER 
01988                 || saberOnly 
01989                 || allForceDisabled )
01990         {
01991                 trueJedi = 0;
01992         }
01993         else
01994         {
01995                 trueJedi = atoi( Info_ValueForKey( info, "g_jediVmerc" ) );
01996         }
01997         return (trueJedi != 0);
01998 }

void UI_UpdateCharacterSkin void   ) 
 

Definition at line 5641 of file ui_main.c.

References Com_Error(), Com_sprintf(), ERR_FATAL, itemDef_t, ItemParse_model_g2skin_go(), MAX_QPATH, Menu_FindItemByName(), Menu_GetFocused(), windowDef_t::name, trap_Cvar_VariableStringBuffer(), and menuDef_t::window.

Referenced by Item_Model_Paint(), and UI_FeederSelection().

05642 {
05643         menuDef_t *menu;
05644         itemDef_t *item;
05645         char skin[MAX_QPATH];
05646         char model[MAX_QPATH];
05647         char head[MAX_QPATH];
05648         char torso[MAX_QPATH];
05649         char legs[MAX_QPATH];
05650 
05651         menu = Menu_GetFocused();       // Get current menu
05652 
05653         if (!menu)
05654         {
05655                 return;
05656         }
05657 
05658         item = (itemDef_t *) Menu_FindItemByName(menu, "character");
05659 
05660         if (!item)
05661         {
05662                 Com_Error( ERR_FATAL, "UI_UpdateCharacterSkin: Could not find item (character) in menu (%s)", menu->window.name);
05663         }
05664 
05665         trap_Cvar_VariableStringBuffer("ui_char_model", model, sizeof(model));
05666         trap_Cvar_VariableStringBuffer("ui_char_skin_head", head, sizeof(head));
05667         trap_Cvar_VariableStringBuffer("ui_char_skin_torso", torso, sizeof(torso));
05668         trap_Cvar_VariableStringBuffer("ui_char_skin_legs", legs, sizeof(legs));
05669 
05670         Com_sprintf( skin, sizeof( skin ), "models/players/%s/|%s|%s|%s", 
05671                                                                                 model, 
05672                                                                                 head, 
05673                                                                                 torso, 
05674                                                                                 legs 
05675                                 );
05676 
05677         ItemParse_model_g2skin_go( item, skin );
05678 }

void UI_UpdateCvars void   ) 
 

Definition at line 11057 of file ui_main.c.

References trap_Cvar_Update().

Referenced by _UI_Refresh().

11057                             {
11058         int                     i;
11059         cvarTable_t     *cv;
11060 
11061         for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
11062                 trap_Cvar_Update( cv->vmCvar );
11063         }
11064 }

void UI_UpdateCvarsForClass const int  team,
const  baseClass,
const int  index
 

Definition at line 9099 of file ui_main.c.

References BG_GetClassOnBaseClass(), BG_GetUIPortraitFile(), BG_SiegeCountBaseClass(), FEEDER_SIEGE_BASE_CLASS, g_siegedFeederForcedSet, g_UIClassDescriptions, g_UIGloballySelectedSiegeClass, Menu_SetFeederSelection(), NULL, SIEGETEAM_TEAM1, SIEGETEAM_TEAM2, SPC_INFANTRY, SPC_MAX, trap_Cvar_Set(), UI_SiegeClassNum(), and UI_SiegeSetCvarsForClass().

Referenced by UI_FeederSelection().

09100 {
09101         siegeClass_t *holdClass=0;
09102         char *holdBuf;
09103 
09104         // Is it a valid team
09105         if ((team == SIEGETEAM_TEAM1) || 
09106                 (team == SIEGETEAM_TEAM2)) 
09107         {
09108 
09109                 // Is it a valid base class?
09110                 if ((baseClass >= SPC_INFANTRY) && (baseClass < SPC_MAX))
09111                 {
09112                         // A valid index?
09113                         if ((index>=0) && (index < BG_SiegeCountBaseClass( team, baseClass )))
09114                         {
09115                                 if (!g_siegedFeederForcedSet)
09116                                 {
09117                                         holdClass = BG_GetClassOnBaseClass( team, baseClass, index);                                    
09118                                         if (holdClass)  //clicked a valid item
09119                                         {
09120                                                 g_UIGloballySelectedSiegeClass = UI_SiegeClassNum(holdClass);
09121                                                 trap_Cvar_Set("ui_classDesc", g_UIClassDescriptions[g_UIGloballySelectedSiegeClass].desc);
09122                                                 g_siegedFeederForcedSet = 1;
09123                                                 Menu_SetFeederSelection(NULL, FEEDER_SIEGE_BASE_CLASS, -1, NULL);
09124                                                 UI_SiegeSetCvarsForClass(holdClass);
09125 
09126                                                 holdBuf = BG_GetUIPortraitFile(team, baseClass, index);
09127                                                 if (holdBuf)
09128                                                 {
09129                                                         trap_Cvar_Set("ui_classPortrait",holdBuf);
09130                                                 }
09131                                         }
09132                                 }
09133                                 g_siegedFeederForcedSet = 0;
09134                         }
09135                         else
09136                         {
09137                                 trap_Cvar_Set("ui_classDesc", " ");
09138                         }
09139                 }
09140         }
09141 
09142 }

void UI_UpdateSiegeObjectiveGraphics void   ) 
 

Definition at line 5398 of file ui_main.c.

References Menu_GetFocused(), Menu_SetItemBackground(), Menu_ShowGroup(), qfalse, UI_SetSiegeObjectiveGraphicPos(), and va().

05399 {
05400         menuDef_t *menu;
05401         int     teamI,objI;
05402 
05403         menu = Menu_GetFocused();       // Get current menu
05404 
05405         if (!menu)
05406         {
05407                 return;
05408         }
05409 
05410         // Hiding a bunch of fields because the opening section of the siege menu was getting too long
05411         Menu_ShowGroup(menu,"class_button",qfalse);
05412         Menu_ShowGroup(menu,"class_count",qfalse);
05413         Menu_ShowGroup(menu,"feeders",qfalse);
05414         Menu_ShowGroup(menu,"classdescription",qfalse);
05415         Menu_ShowGroup(menu,"minidesc",qfalse);
05416         Menu_ShowGroup(menu,"obj_longdesc",qfalse);
05417         Menu_ShowGroup(menu,"objective_pic",qfalse);
05418         Menu_ShowGroup(menu,"stats",qfalse);
05419         Menu_ShowGroup(menu,"forcepowerlevel",qfalse);
05420 
05421         // Get objective icons for each team
05422         for (teamI=1;teamI<3;teamI++)
05423         {
05424                 for (objI=1;objI<8;objI++)
05425                 {
05426                         Menu_SetItemBackground(menu,va("tm%i_icon%i",teamI,objI),va("*team%i_objective%i_mapicon",teamI,objI));
05427                         Menu_SetItemBackground(menu,va("tm%i_l_icon%i",teamI,objI),va("*team%i_objective%i_mapicon",teamI,objI));
05428                 }
05429         }
05430 
05431         // Now get their placement on the map
05432         for (teamI=1;teamI<3;teamI++)
05433         {
05434                 for (objI=1;objI<8;objI++)
05435                 {
05436                         UI_SetSiegeObjectiveGraphicPos(menu,va("tm%i_icon%i",teamI,objI),va("team%i_objective%i_mappos",teamI,objI));
05437                 }
05438         }
05439 
05440 }

void UI_UpdateSiegeStatusIcons void   ) 
 

Definition at line 7062 of file ui_main.c.

References Menu_GetFocused(), Menu_SetItemBackground(), and va().

07063 {
07064     menuDef_t *menu = Menu_GetFocused();
07065         int i;
07066 
07067         menu = Menu_GetFocused();       // Get current menu
07068 
07069         if (!menu)
07070         {
07071                 return;
07072         }
07073 
07074         for (i=0;i<7;i++)
07075         {
07076 
07077                 Menu_SetItemBackground(menu,va("wpnicon0%d",i), va("*ui_class_weapon%d",i));
07078         }
07079 
07080         for (i=0;i<7;i++)
07081         {
07082                 Menu_SetItemBackground(menu,va("itemicon0%d",i), va("*ui_class_item%d",i));
07083         }
07084 
07085         for (i=0;i<10;i++)
07086         {
07087                 Menu_SetItemBackground(menu,va("forceicon0%d",i), va("*ui_class_power%d",i));
07088         }
07089 
07090         for (i=10;i<15;i++)
07091         {
07092                 Menu_SetItemBackground(menu,va("forceicon%d",i), va("*ui_class_power%d",i));
07093         }
07094 
07095 }

void UI_UpdateVideoSetup void   ) 
 

Definition at line 5066 of file ui_main.c.

References EXEC_APPEND, trap_Cmd_ExecuteText(), trap_Cvar_Set(), and UI_Cvar_VariableString().

05067 {
05068         trap_Cvar_Set ( "r_mode", UI_Cvar_VariableString ( "ui_r_mode" ) );
05069         trap_Cvar_Set ( "r_fullscreen", UI_Cvar_VariableString ( "ui_r_fullscreen" ) );
05070         trap_Cvar_Set ( "r_colorbits", UI_Cvar_VariableString ( "ui_r_colorbits" ) );
05071         trap_Cvar_Set ( "r_lodbias", UI_Cvar_VariableString ( "ui_r_lodbias" ) );
05072         trap_Cvar_Set ( "r_picmip", UI_Cvar_VariableString ( "ui_r_picmip" ) );
05073         trap_Cvar_Set ( "r_texturebits", UI_Cvar_VariableString ( "ui_r_texturebits" ) );
05074         trap_Cvar_Set ( "r_texturemode", UI_Cvar_VariableString ( "ui_r_texturemode" ) );
05075         trap_Cvar_Set ( "r_detailtextures", UI_Cvar_VariableString ( "ui_r_detailtextures" ) );
05076         trap_Cvar_Set ( "r_ext_compress_textures", UI_Cvar_VariableString ( "ui_r_ext_compress_textures" ) );
05077         trap_Cvar_Set ( "r_depthbits", UI_Cvar_VariableString ( "ui_r_depthbits" ) );
05078         trap_Cvar_Set ( "r_subdivisions", UI_Cvar_VariableString ( "ui_r_subdivisions" ) );
05079         trap_Cvar_Set ( "r_fastSky", UI_Cvar_VariableString ( "ui_r_fastSky" ) );
05080         trap_Cvar_Set ( "r_inGameVideo", UI_Cvar_VariableString ( "ui_r_inGameVideo" ) );
05081         trap_Cvar_Set ( "r_allowExtensions", UI_Cvar_VariableString ( "ui_r_allowExtensions" ) );
05082         trap_Cvar_Set ( "cg_shadows", UI_Cvar_VariableString ( "ui_cg_shadows" ) );
05083         trap_Cvar_Set ( "ui_r_modified", "0" );
05084 
05085         trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
05086 }

void UpdateBotButtons void   ) 
 

Definition at line 2228 of file ui_main.c.

References uiInfo_t::gameTypes, GT_SIEGE, vmCvar_t::integer, Menu_GetFocused(), Menu_ShowItemByName(), qfalse, qtrue, ui_netGameType, and uiInfo.

02229 {
02230         menuDef_t *menu;
02231 
02232         menu = Menu_GetFocused();       
02233 
02234         if (!menu)
02235         {
02236                 return;
02237         }
02238 
02239         if (uiInfo.gameTypes[ui_netGameType.integer].gtEnum == GT_SIEGE)
02240         {
02241                 Menu_ShowItemByName(menu, "humanbotfield", qfalse);
02242                 Menu_ShowItemByName(menu, "humanbotnonfield", qtrue);
02243         }
02244         else
02245         {
02246                 Menu_ShowItemByName(menu, "humanbotfield", qtrue);
02247                 Menu_ShowItemByName(menu, "humanbotnonfield", qfalse);
02248         }
02249 
02250 }

void UpdateForceStatus  ) 
 

Definition at line 2252 of file ui_main.c.

References atoi(), CS_SERVERINFO, uiInfo_t::effectsColor, FORCE_DARKSIDE, FORCE_LIGHTSIDE, FORCE_NONJEDI, FP_SABER_OFFENSE, GT_TEAM, Info_ValueForKey(), vmCvar_t::integer, MAX_INFO_STRING, Menu_ShowItemByName(), Menus_FindByName(), qboolean, qfalse, qtrue, SABER_BLUE, SABER_RED, TEAM_BLUE, TEAM_FREE, TEAM_RED, TEAM_SPECTATOR, trap_Cvar_VariableValue(), trap_GetConfigString(), ui_freeSaber, UI_TrueJediEnabled(), uiForcePowersRank, uiForceSide, uiHoldSkinColor, uiInfo, uiJediNonJedi, and uiSkinColor.

02253 {
02254         menuDef_t *menu;
02255 
02256         // Currently we don't make a distinction between those that wish to play Jedi of lower than maximum skill.
02257 /*      if (ui_forcePowerDisable.integer)
02258         {
02259                 uiForceRank = 0;
02260                 uiForceAvailable = 0;
02261                 uiForceUsed = 0;
02262         }
02263         else
02264         {
02265                 uiForceRank = uiMaxRank;
02266                 uiForceUsed = 0;
02267                 uiForceAvailable = forceMasteryPoints[uiForceRank];
02268         }
02269 */
02270         menu = Menus_FindByName("ingame_player");
02271         if (menu)
02272         {
02273                 char    info[MAX_INFO_STRING];
02274                 int             disabledForce = 0;
02275                 qboolean trueJedi = qfalse, allForceDisabled = qfalse;
02276 
02277                 trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
02278 
02279                 //already have serverinfo at this point for stuff below. Don't bother trying to use ui_forcePowerDisable.
02280                 //if (ui_forcePowerDisable.integer)
02281                 //if (atoi(Info_ValueForKey(info, "g_forcePowerDisable")))
02282                 disabledForce = atoi(Info_ValueForKey(info, "g_forcePowerDisable"));
02283                 allForceDisabled = UI_AllForceDisabled(disabledForce);
02284                 trueJedi = UI_TrueJediEnabled();
02285 
02286                 if ( !trueJedi || allForceDisabled )
02287                 {
02288                         Menu_ShowItemByName(menu, "jedinonjedi", qfalse);
02289                 }
02290                 else
02291                 {
02292                         Menu_ShowItemByName(menu, "jedinonjedi", qtrue);
02293                 }
02294                 if ( allForceDisabled == qtrue || (trueJedi && uiJediNonJedi == FORCE_NONJEDI) )
02295                 {       // No force stuff
02296                         Menu_ShowItemByName(menu, "noforce", qtrue);
02297                         Menu_ShowItemByName(menu, "yesforce", qfalse);
02298                         // We don't want the saber explanation to say "configure saber attack 1" since we can't.
02299                         Menu_ShowItemByName(menu, "sabernoneconfigme", qfalse);
02300                 }
02301                 else
02302                 {
02303                         UI_SetForceDisabled(disabledForce);
02304                         Menu_ShowItemByName(menu, "noforce", qfalse);
02305                         Menu_ShowItemByName(menu, "yesforce", qtrue);
02306                 }
02307 
02308                 //Moved this to happen after it's done with force power disabling stuff
02309                 if (uiForcePowersRank[FP_SABER_OFFENSE] > 0 || ui_freeSaber.integer)
02310                 {       // Show lightsaber stuff.
02311                         Menu_ShowItemByName(menu, "nosaber", qfalse);
02312                         Menu_ShowItemByName(menu, "yessaber", qtrue);
02313                 }
02314                 else
02315                 {
02316                         Menu_ShowItemByName(menu, "nosaber", qtrue);
02317                         Menu_ShowItemByName(menu, "yessaber", qfalse);
02318                 }
02319 
02320                 // The leftmost button should be "apply" unless you are in spectator, where you can join any team.
02321                 if ((int)(trap_Cvar_VariableValue("ui_myteam")) != TEAM_SPECTATOR)
02322                 {
02323                         Menu_ShowItemByName(menu, "playerapply", qtrue);
02324                         Menu_ShowItemByName(menu, "playerforcejoin", qfalse);
02325                         Menu_ShowItemByName(menu, "playerforcered", qtrue);
02326                         Menu_ShowItemByName(menu, "playerforceblue", qtrue);
02327                         Menu_ShowItemByName(menu, "playerforcespectate", qtrue);
02328                 }
02329                 else
02330                 {
02331                         // Set or reset buttons based on choices
02332                         if (atoi(Info_ValueForKey(info, "g_gametype")) >= GT_TEAM)
02333                         {       // This is a team-based game.
02334                                 Menu_ShowItemByName(menu, "playerforcespectate", qtrue);
02335                                 
02336                                 // This is disabled, always show both sides from spectator.
02337                                 if ( 0 && atoi(Info_ValueForKey(info, "g_forceBasedTeams")))
02338                                 {       // Show red or blue based on what side is chosen.
02339                                         if (uiForceSide==FORCE_LIGHTSIDE)
02340                                         {
02341                                                 Menu_ShowItemByName(menu, "playerforcered", qfalse);
02342                                                 Menu_ShowItemByName(menu, "playerforceblue", qtrue);
02343                                         }
02344                                         else if (uiForceSide==FORCE_DARKSIDE)
02345                                         {
02346                                                 Menu_ShowItemByName(menu, "playerforcered", qtrue);
02347                                                 Menu_ShowItemByName(menu, "playerforceblue", qfalse);
02348                                         }
02349                                         else
02350                                         {
02351                                                 Menu_ShowItemByName(menu, "playerforcered", qtrue);
02352                                                 Menu_ShowItemByName(menu, "playerforceblue", qtrue);
02353                                         }
02354                                 }
02355                                 else
02356                                 {
02357                                         Menu_ShowItemByName(menu, "playerforcered", qtrue);
02358                                         Menu_ShowItemByName(menu, "playerforceblue", qtrue);
02359                                 }
02360                         }
02361                         else
02362                         {
02363                                 Menu_ShowItemByName(menu, "playerforcered", qfalse);
02364                                 Menu_ShowItemByName(menu, "playerforceblue", qfalse);
02365                         }
02366 
02367                         Menu_ShowItemByName(menu, "playerapply", qfalse);
02368                         Menu_ShowItemByName(menu, "playerforcejoin", qtrue);
02369                         Menu_ShowItemByName(menu, "playerforcespectate", qtrue);
02370                 }
02371         }
02372 
02373 
02374         if ( !UI_TrueJediEnabled() )
02375         {// Take the current team and force a skin color based on it.
02376                 char    info[MAX_INFO_STRING];
02377 
02378                 switch((int)(trap_Cvar_VariableValue("ui_myteam")))
02379                 {
02380                 case TEAM_RED:
02381                         uiSkinColor = TEAM_RED;
02382                         uiInfo.effectsColor = SABER_RED;
02383                         break;
02384                 case TEAM_BLUE:
02385                         uiSkinColor = TEAM_BLUE;
02386                         uiInfo.effectsColor = SABER_BLUE;
02387                         break;
02388                 default:
02389                         trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
02390 
02391                         if (atoi(Info_ValueForKey(info, "g_gametype")) >= GT_TEAM)
02392                         {
02393                                 uiSkinColor = TEAM_FREE;
02394                         }
02395                         else    // A bit of a hack so non-team games will remember which skin set you chose in the player menu
02396                         {
02397                                 uiSkinColor = uiHoldSkinColor;
02398                         }
02399                         break;
02400                 }
02401         }
02402 }

void UpdateForceUsed  ) 
 

Definition at line 290 of file ui_force.c.

References bgForcePowerCost, FORCE_JEDI, FORCE_LEVEL_1, FORCE_NONJEDI, forceMasteryPoints, FP_LEVITATION, FP_SABER_DEFENSE, FP_SABER_OFFENSE, FP_SABERTHROW, vmCvar_t::integer, Menu_ShowItemByName(), Menus_FindByName(), NULL, NUM_FORCE_POWER_LEVELS, NUM_FORCE_POWERS, qboolean, qfalse, qtrue, TEAM_SPECTATOR, trap_Cvar_VariableValue(), ui_freeSaber, UI_TeamName(), UI_TrueJediEnabled(), UI_UpdateClientForcePowers(), uiForceAvailable, uiForcePowersRank, uiForceRank, uiForceUsed, uiJediNonJedi, and uiMaxRank.

Referenced by _UI_Refresh(), _UI_SetActiveMenu(), UI_ForceConfigHandle(), UI_ForceMaxRank_HandleKey(), UI_ForcePowerRank_HandleKey(), UI_ForceSide_HandleKey(), UI_JediNonJedi_HandleKey(), UI_ReadLegalForce(), and UI_UpdateForcePowers().

00291 {
00292         int curpower, currank;
00293         menuDef_t *menu;
00294 
00295         // Currently we don't make a distinction between those that wish to play Jedi of lower than maximum skill.
00296         uiForceRank = uiMaxRank;
00297 
00298         uiForceUsed = 0;
00299         uiForceAvailable = forceMasteryPoints[uiForceRank];
00300 
00301         // Make sure that we have one freebie in jump.
00302         if (uiForcePowersRank[FP_LEVITATION]<1)
00303         {
00304                 uiForcePowersRank[FP_LEVITATION]=1;
00305         }
00306 
00307         if ( UI_TrueJediEnabled() )
00308         {//true jedi mode is set
00309                 if ( uiJediNonJedi == -1 )
00310                 {
00311                         int x = 0;
00312                         qboolean clear = qfalse, update = qfalse;
00313                         uiJediNonJedi = FORCE_NONJEDI;
00314                         while ( x < NUM_FORCE_POWERS )
00315                         {//if any force power is set, we must be a jedi
00316                                 if ( x == FP_LEVITATION || x == FP_SABER_OFFENSE )
00317                                 {
00318                                         if ( uiForcePowersRank[x] > 1 )
00319                                         {
00320                                                 uiJediNonJedi = FORCE_JEDI;
00321                                                 break;
00322                                         }
00323                                         else if ( uiForcePowersRank[x] > 0 )
00324                                         {
00325                                                 clear = qtrue;
00326                                         }
00327                                 }
00328                                 else if ( uiForcePowersRank[x] > 0 )
00329                                 {
00330                                         uiJediNonJedi = FORCE_JEDI;
00331                                         break;
00332                                 }
00333                                 x++;
00334                         }
00335                         if ( uiJediNonJedi == FORCE_JEDI )
00336                         {
00337                                 if ( uiForcePowersRank[FP_SABER_OFFENSE] < 1 )
00338                                 {
00339                                         uiForcePowersRank[FP_SABER_OFFENSE]=1;
00340                                         update = qtrue;
00341                                 }
00342                         }
00343                         else if ( clear )
00344                         {
00345                                 x = 0;
00346                                 while ( x < NUM_FORCE_POWERS )
00347                                 {//clear all force
00348                                         uiForcePowersRank[x] = 0;
00349                                         x++;
00350                                 }
00351                                 update = qtrue;
00352                         }
00353                         if ( update )
00354                         {
00355                                 int myTeam;
00356                                 myTeam = (int)(trap_Cvar_VariableValue("ui_myteam"));
00357                                 if ( myTeam != TEAM_SPECTATOR )
00358                                 {
00359                                         UI_UpdateClientForcePowers(UI_TeamName(myTeam));//will cause him to respawn, if it's been 5 seconds since last one
00360                                 }
00361                                 else
00362                                 {
00363                                         UI_UpdateClientForcePowers(NULL);//just update powers
00364                                 }
00365                         }
00366                 }
00367         }
00368 
00369         menu = Menus_FindByName("ingame_playerforce");
00370         // Set the cost of the saberattack according to whether its free.
00371         if (ui_freeSaber.integer)
00372         {       // Make saber free
00373                 bgForcePowerCost[FP_SABER_OFFENSE][FORCE_LEVEL_1] = 0;
00374                 bgForcePowerCost[FP_SABER_DEFENSE][FORCE_LEVEL_1] = 0;
00375                 // Make sure that we have one freebie in saber if applicable.
00376                 if (uiForcePowersRank[FP_SABER_OFFENSE]<1)
00377                 {
00378                         uiForcePowersRank[FP_SABER_OFFENSE]=1;
00379                 }
00380                 if (uiForcePowersRank[FP_SABER_DEFENSE]<1)
00381                 {
00382                         uiForcePowersRank[FP_SABER_DEFENSE]=1;
00383                 }
00384                 if (menu)
00385                 {
00386                         Menu_ShowItemByName(menu, "setFP_SABER_DEFENSE", qtrue);
00387                         Menu_ShowItemByName(menu, "setfp_saberthrow", qtrue);
00388                         Menu_ShowItemByName(menu, "effectentry", qtrue);
00389                         Menu_ShowItemByName(menu, "effectfield", qtrue);
00390                         Menu_ShowItemByName(menu, "nosaber", qfalse);
00391                 }
00392         }
00393         else
00394         {       // Make saber normal cost
00395                 bgForcePowerCost[FP_SABER_OFFENSE][FORCE_LEVEL_1] = 1;
00396                 bgForcePowerCost[FP_SABER_DEFENSE][FORCE_LEVEL_1] = 1;
00397                 // Also, check if there is no saberattack.  If there isn't, there had better not be any defense or throw!
00398                 if (uiForcePowersRank[FP_SABER_OFFENSE]<1)
00399                 {
00400                         uiForcePowersRank[FP_SABER_DEFENSE]=0;
00401                         uiForcePowersRank[FP_SABERTHROW]=0;
00402                         if (menu)
00403                         {
00404                                 Menu_ShowItemByName(menu, "setfp_saberdefend", qfalse);
00405                                 Menu_ShowItemByName(menu, "setfp_saberthrow", qfalse);
00406                                 Menu_ShowItemByName(menu, "effectentry", qfalse);
00407                                 Menu_ShowItemByName(menu, "effectfield", qfalse);
00408                                 Menu_ShowItemByName(menu, "nosaber", qtrue);
00409                         }
00410                 }
00411                 else
00412                 {
00413                         if (menu)
00414                         {
00415                                 Menu_ShowItemByName(menu, "setfp_saberdefend", qtrue);
00416                                 Menu_ShowItemByName(menu, "setfp_saberthrow", qtrue);
00417                                 Menu_ShowItemByName(menu, "effectentry", qtrue);
00418                                 Menu_ShowItemByName(menu, "effectfield", qtrue);
00419                                 Menu_ShowItemByName(menu, "nosaber", qfalse);
00420                         }
00421                 }
00422         }
00423 
00424         // Make sure that we're still legal.
00425         for (curpower=0;curpower<NUM_FORCE_POWERS;curpower++)
00426         {       // Make sure that our ranks are within legal limits.
00427                 if (uiForcePowersRank[curpower]<0)
00428                         uiForcePowersRank[curpower]=0;
00429                 else if (uiForcePowersRank[curpower]>=NUM_FORCE_POWER_LEVELS)
00430                         uiForcePowersRank[curpower]=(NUM_FORCE_POWER_LEVELS-1);
00431 
00432                 for (currank=FORCE_LEVEL_1;currank<=uiForcePowersRank[curpower];currank++)
00433                 {       // Check on this force power
00434                         if (uiForcePowersRank[curpower]>0)
00435                         {       // Do not charge the player for the one freebie in jump, or if there is one in saber.
00436                                 if  (   (curpower == FP_LEVITATION && currank == FORCE_LEVEL_1) ||
00437                                                 (curpower == FP_SABER_OFFENSE && currank == FORCE_LEVEL_1 && ui_freeSaber.integer) ||
00438                                                 (curpower == FP_SABER_DEFENSE && currank == FORCE_LEVEL_1 && ui_freeSaber.integer) )
00439                                 {
00440                                         // Do nothing (written this way for clarity)
00441                                 }
00442                                 else
00443                                 {       // Check if we can accrue the cost of this power.
00444                                         if (bgForcePowerCost[curpower][currank] > uiForceAvailable)
00445                                         {       // We can't afford this power.  Break to the next one.
00446                                                 // Remove this power from the player's roster.
00447                                                 uiForcePowersRank[curpower] = currank-1;
00448                                                 break;
00449                                         }
00450                                         else
00451                                         {       // Sure we can afford it.
00452                                                 uiForceUsed += bgForcePowerCost[curpower][currank];
00453                                                 uiForceAvailable -= bgForcePowerCost[curpower][currank];
00454                                         }
00455                                 }
00456                         }
00457                 }
00458         }
00459 
00460 }

int vmMain int  command,
int  arg0,
int  arg1,
int  arg2,
int  arg3,
int  arg4,
int  arg5,
int  arg6,
int  arg7,
int  arg8,
int  arg9,
int  arg10,
int  arg11
 

Definition at line 258 of file ui_main.c.

References _UI_Init(), _UI_IsFullscreen(), _UI_KeyEvent(), _UI_MouseEvent(), _UI_Refresh(), _UI_SetActiveMenu(), _UI_Shutdown(), Menu_Reset(), qtrue, UI_API_VERSION, UI_CONSOLE_COMMAND, UI_ConsoleCommand(), UI_DRAW_CONNECT_SCREEN, UI_DrawConnectScreen(), UI_GETAPIVERSION, UI_HASUNIQUECDKEY, UI_INIT, UI_IS_FULLSCREEN, UI_KEY_EVENT, UI_MENU_RESET, UI_MOUSE_EVENT, UI_REFRESH, UI_SET_ACTIVE_MENU, and UI_SHUTDOWN.

00258                                                                                                                                                      {
00259   switch ( command ) {
00260           case UI_GETAPIVERSION:
00261                   return UI_API_VERSION;
00262 
00263           case UI_INIT:
00264                   _UI_Init(arg0);
00265                   return 0;
00266 
00267           case UI_SHUTDOWN:
00268                   _UI_Shutdown();
00269                   return 0;
00270 
00271           case UI_KEY_EVENT:
00272                   _UI_KeyEvent( arg0, arg1 );
00273                   return 0;
00274 
00275           case UI_MOUSE_EVENT:
00276                   _UI_MouseEvent( arg0, arg1 );
00277                   return 0;
00278 
00279           case UI_REFRESH:
00280                   _UI_Refresh( arg0 );
00281                   return 0;
00282 
00283           case UI_IS_FULLSCREEN:
00284                   return _UI_IsFullscreen();
00285 
00286           case UI_SET_ACTIVE_MENU:
00287                   _UI_SetActiveMenu( arg0 );
00288                   return 0;
00289 
00290           case UI_CONSOLE_COMMAND:
00291                   return UI_ConsoleCommand(arg0);
00292 
00293           case UI_DRAW_CONNECT_SCREEN:
00294                   UI_DrawConnectScreen( arg0 );
00295                   return 0;
00296           case UI_HASUNIQUECDKEY: // mod authors need to observe this
00297             return qtrue; // bk010117 - change this to qfalse for mods!
00298           case UI_MENU_RESET:
00299                   Menu_Reset();
00300                   return 0;
00301         }
00302 
00303         return -1;
00304 }


Variable Documentation

bgLoadedAnim_t bgAllAnims[MAX_ANIM_FILES]
 

Definition at line 320 of file ui_main.c.

char* datapadMoveTitleBaseAnims[MD_MOVE_TITLE_MAX]
 

Initial value:

{
"BOTH_RUN1",
"BOTH_SABERFAST_STANCE",
"BOTH_STAND2",
"BOTH_SABERSLOW_STANCE",
"BOTH_SABERDUAL_STANCE",
"BOTH_SABERSTAFF_STANCE",
}

Definition at line 81 of file ui_main.c.

Referenced by UI_FeederSelection().

char* datapadMoveTitleData[MD_MOVE_TITLE_MAX]
 

Initial value:

{
"@MENUS_ACROBATICS",
"@MENUS_SINGLE_FAST",
"@MENUS_SINGLE_MEDIUM",
"@MENUS_SINGLE_STRONG",
"@MENUS_DUAL_SABERS",
"@MENUS_SABER_STAFF",
}

Definition at line 71 of file ui_main.c.

char* defaultMenu = NULL
 

Definition at line 1116 of file ui_main.c.

Referenced by GetMenuBuffer().

char* forcepowerDesc[NUM_FORCE_POWERS]
 

Initial value:

 
{
"@MENUS_OF_EFFECT_JEDI_ONLY_NEFFECT",
"@MENUS_DURATION_IMMEDIATE_NAREA",
"@MENUS_DURATION_5_SECONDS_NAREA",
"@MENUS_DURATION_INSTANTANEOUS",
"@MENUS_INSTANTANEOUS_EFFECT_NAREA",
"@MENUS_DURATION_VARIABLE_20",
"@MENUS_DURATION_INSTANTANEOUS_NAREA",
"@MENUS_OF_EFFECT_LIVING_PERSONS",
"@MENUS_DURATION_VARIABLE_10",
"@MENUS_DURATION_VARIABLE_NAREA",
"@MENUS_DURATION_CONTINUOUS_NAREA",
"@MENUS_OF_EFFECT_JEDI_ALLIES_NEFFECT",
"@MENUS_EFFECT_JEDI_ALLIES_NEFFECT",
"@MENUS_VARIABLE_NAREA_OF_EFFECT",
"@MENUS_EFFECT_NAREA_OF_EFFECT",
"@SP_INGAME_FORCE_SABER_OFFENSE_DESC",
"@SP_INGAME_FORCE_SABER_DEFENSE_DESC",
"@SP_INGAME_FORCE_SABER_THROW_DESC"
}

Definition at line 26 of file ui_main.c.

Referenced by UI_FeederSelection().

int FPMessageTime
 

Definition at line 923 of file ui_main.c.

Referenced by _UI_Refresh(), and Menus_CloseAll().

int frameCount = 0
 

Definition at line 915 of file ui_main.c.

int g_siegedFeederForcedSet = 0
 

Definition at line 9097 of file ui_main.c.

Referenced by UI_FeederSelection(), and UI_UpdateCvarsForClass().

siegeClassDesc_t g_UIClassDescriptions[MAX_SIEGE_CLASSES]
 

Definition at line 307 of file ui_main.c.

Referenced by UI_FeederSelection(), UI_SiegeInit(), and UI_UpdateCvarsForClass().

int g_UIGloballySelectedSiegeClass = -1
 

Definition at line 310 of file ui_main.c.

Referenced by UI_FeederSelection(), and UI_UpdateCvarsForClass().

int gUISelectedMap = 0
 

Definition at line 5001 of file ui_main.c.

Referenced by UI_FeederSelection().

char holdSPString[MAX_STRING_CHARS] = {0}
 

Definition at line 551 of file ui_main.c.

char holdSPString2[MAX_STRING_CHARS] = {0}
 

Definition at line 552 of file ui_main.c.

char parsedFPMessage[1024]
 

Definition at line 920 of file ui_main.c.

Referenced by _UI_Refresh().

char* saberSingleHiltInfo[MAX_SABER_HILTS]
 

Definition at line 5739 of file ui_main.c.

char* saberStaffHiltInfo[MAX_SABER_HILTS]
 

Definition at line 5740 of file ui_main.c.

vmCvar_t se_language
 

Definition at line 10897 of file ui_main.c.

Referenced by Item_SetTextExtents().

serverStatusCvar_t serverStatusCvars[]
 

Initial value:

 {
        {"sv_hostname", "Name"},
        {"Address", ""},
        {"gamename", "Game name"},
        {"g_gametype", "Game type"},
        {"mapname", "Map"},
        {"version", ""},
        {"protocol", ""},
        {"timelimit", ""},
        {"fraglimit", ""},
        {NULL, NULL}
}

Definition at line 7386 of file ui_main.c.

siegeTeam_t* siegeTeam1 = NULL
 

Definition at line 308 of file ui_main.c.

Referenced by UI_FeederSelection(), and UI_SetSiegeTeams().

siegeTeam_t* siegeTeam2 = NULL
 

Definition at line 309 of file ui_main.c.

Referenced by UI_FeederSelection(), and UI_SetSiegeTeams().

int startTime
 

Definition at line 916 of file ui_main.c.

Referenced by CG_LocalTimingBar(), CG_SmokePuff(), G_RMGPathing(), NPC_BSST_Attack(), NPC_MoveToGoal(), and NPC_Think().

vmCvar_t ui_actualNetGameType
 

Definition at line 10848 of file ui_main.c.

vmCvar_t ui_arenasFile
 

Definition at line 10812 of file ui_main.c.

vmCvar_t ui_blueteam
 

Definition at line 10835 of file ui_main.c.

vmCvar_t ui_blueteam1
 

Definition at line 10836 of file ui_main.c.

vmCvar_t ui_blueteam2
 

Definition at line 10837 of file ui_main.c.

vmCvar_t ui_blueteam3
 

Definition at line 10838 of file ui_main.c.

vmCvar_t ui_blueteam4
 

Definition at line 10839 of file ui_main.c.

vmCvar_t ui_blueteam5
 

Definition at line 10840 of file ui_main.c.

vmCvar_t ui_blueteam6
 

Definition at line 10841 of file ui_main.c.

vmCvar_t ui_blueteam7
 

Definition at line 10842 of file ui_main.c.

vmCvar_t ui_blueteam8
 

Definition at line 10843 of file ui_main.c.

vmCvar_t ui_botsFile
 

Definition at line 10813 of file ui_main.c.

vmCvar_t ui_browserGameType
 

Definition at line 10817 of file ui_main.c.

vmCvar_t ui_browserMaster
 

Definition at line 10816 of file ui_main.c.

vmCvar_t ui_browserShowEmpty
 

Definition at line 10820 of file ui_main.c.

vmCvar_t ui_browserShowFull
 

Definition at line 10819 of file ui_main.c.

vmCvar_t ui_browserSortKey
 

Definition at line 10818 of file ui_main.c.

vmCvar_t ui_bypassMainMenuLoad
 

Definition at line 10899 of file ui_main.c.

Referenced by _UI_Init().

vmCvar_t ui_captureLimit
 

Definition at line 10889 of file ui_main.c.

vmCvar_t ui_char_anim
 

Definition at line 227 of file ui_main.c.

vmCvar_t ui_char_color_blue
 

Definition at line 225 of file ui_main.c.

Referenced by Item_ListBox_Paint(), Item_Model_Paint(), and Window_Paint().

vmCvar_t ui_char_color_green
 

Definition at line 224 of file ui_main.c.

Referenced by Item_ListBox_Paint(), Item_Model_Paint(), and Window_Paint().

vmCvar_t ui_char_color_red
 

Definition at line 223 of file ui_main.c.

Referenced by Item_ListBox_Paint(), Item_Model_Paint(), and Window_Paint().

vmCvar_t ui_char_model
 

Definition at line 10793 of file ui_main.c.

Referenced by ItemParse_asset_model().

vmCvar_t ui_char_skin_head
 

Definition at line 10794 of file ui_main.c.

vmCvar_t ui_char_skin_legs
 

Definition at line 10796 of file ui_main.c.

vmCvar_t ui_char_skin_torso
 

Definition at line 10795 of file ui_main.c.

vmCvar_t ui_ctf_capturelimit
 

Definition at line 10808 of file ui_main.c.

vmCvar_t ui_ctf_friendly
 

Definition at line 10810 of file ui_main.c.

vmCvar_t ui_ctf_timelimit
 

Definition at line 10809 of file ui_main.c.

vmCvar_t ui_currentMap
 

Definition at line 10863 of file ui_main.c.

Referenced by _UI_Init(), and UI_FeederSelection().

vmCvar_t ui_currentNetMap
 

Definition at line 10864 of file ui_main.c.

Referenced by UI_FeederSelection().

vmCvar_t ui_currentOpponent
 

Definition at line 10866 of file ui_main.c.

vmCvar_t ui_debug
 

Definition at line 221 of file ui_main.c.

vmCvar_t ui_dedicated
 

Definition at line 10845 of file ui_main.c.

vmCvar_t ui_drawCrosshair
 

Definition at line 10822 of file ui_main.c.

vmCvar_t ui_drawCrosshairNames
 

Definition at line 10823 of file ui_main.c.

vmCvar_t ui_ffa_fraglimit
 

Definition at line 10789 of file ui_main.c.

vmCvar_t ui_ffa_timelimit
 

Definition at line 10790 of file ui_main.c.

vmCvar_t ui_findPlayer
 

Definition at line 10891 of file ui_main.c.

vmCvar_t ui_fragLimit
 

Definition at line 10890 of file ui_main.c.

vmCvar_t ui_gameType
 

Definition at line 10846 of file ui_main.c.

Referenced by _UI_Init(), and UI_FeederSelection().

vmCvar_t ui_hudFiles
 

Definition at line 10892 of file ui_main.c.

vmCvar_t ui_initialized
 

Definition at line 222 of file ui_main.c.

vmCvar_t ui_joinGameType
 

Definition at line 10849 of file ui_main.c.

vmCvar_t ui_lastServerRefresh_0
 

Definition at line 10869 of file ui_main.c.

vmCvar_t ui_lastServerRefresh_1
 

Definition at line 10870 of file ui_main.c.

vmCvar_t ui_lastServerRefresh_2
 

Definition at line 10871 of file ui_main.c.

vmCvar_t ui_lastServerRefresh_3
 

Definition at line 10872 of file ui_main.c.

vmCvar_t ui_mapIndex
 

Definition at line 10865 of file ui_main.c.

Referenced by UI_FeederSelection().

vmCvar_t ui_marks
 

Definition at line 10824 of file ui_main.c.

vmCvar_t ui_menuFiles
 

Definition at line 10862 of file ui_main.c.

vmCvar_t ui_netGameType
 

Definition at line 10847 of file ui_main.c.

Referenced by _UI_Init(), UI_ClampMaxPlayers(), and UpdateBotButtons().

vmCvar_t ui_netSource
 

Definition at line 10859 of file ui_main.c.

Referenced by UI_FeederSelection().

vmCvar_t ui_opponentName
 

Definition at line 10861 of file ui_main.c.

vmCvar_t ui_PrecacheModels
 

Definition at line 226 of file ui_main.c.

vmCvar_t ui_rankChange
 

Definition at line 918 of file ui_main.c.

Referenced by _UI_Refresh().

vmCvar_t ui_realCaptureLimit
 

Definition at line 10894 of file ui_main.c.

vmCvar_t ui_realWarmUp
 

Definition at line 10895 of file ui_main.c.

vmCvar_t ui_recordSPDemo
 

Definition at line 10893 of file ui_main.c.

vmCvar_t ui_redteam
 

Definition at line 10826 of file ui_main.c.

vmCvar_t ui_redteam1
 

Definition at line 10827 of file ui_main.c.

vmCvar_t ui_redteam2
 

Definition at line 10828 of file ui_main.c.

vmCvar_t ui_redteam3
 

Definition at line 10829 of file ui_main.c.

vmCvar_t ui_redteam4
 

Definition at line 10830 of file ui_main.c.

vmCvar_t ui_redteam5
 

Definition at line 10831 of file ui_main.c.

vmCvar_t ui_redteam6
 

Definition at line 10832 of file ui_main.c.

vmCvar_t ui_redteam7
 

Definition at line 10833 of file ui_main.c.

vmCvar_t ui_redteam8
 

Definition at line 10834 of file ui_main.c.

vmCvar_t ui_saber
 

Definition at line 10799 of file ui_main.c.

vmCvar_t ui_saber2
 

Definition at line 10800 of file ui_main.c.

vmCvar_t ui_saber2_color
 

Definition at line 10802 of file ui_main.c.

vmCvar_t ui_saber_color
 

Definition at line 10801 of file ui_main.c.

vmCvar_t ui_saber_type
 

Definition at line 10798 of file ui_main.c.

vmCvar_t ui_scoreAccuracy
 

Definition at line 10874 of file ui_main.c.

vmCvar_t ui_scoreAssists
 

Definition at line 10879 of file ui_main.c.

vmCvar_t ui_scoreBase
 

Definition at line 10884 of file ui_main.c.

vmCvar_t ui_scoreCaptures
 

Definition at line 10877 of file ui_main.c.

vmCvar_t ui_scoreDefends
 

Definition at line 10878 of file ui_main.c.

vmCvar_t ui_scoreExcellents
 

Definition at line 10876 of file ui_main.c.

vmCvar_t ui_scoreGauntlets
 

Definition at line 10880 of file ui_main.c.

vmCvar_t ui_scoreImpressives
 

Definition at line 10875 of file ui_main.c.

vmCvar_t ui_scorePerfect
 

Definition at line 10882 of file ui_main.c.

vmCvar_t ui_scoreScore
 

Definition at line 10881 of file ui_main.c.

vmCvar_t ui_scoreShutoutBonus
 

Definition at line 10887 of file ui_main.c.

vmCvar_t ui_scoreSkillBonus
 

Definition at line 10886 of file ui_main.c.

vmCvar_t ui_scoreTeam
 

Definition at line 10883 of file ui_main.c.

vmCvar_t ui_scoreTime
 

Definition at line 10888 of file ui_main.c.

vmCvar_t ui_scoreTimeBonus
 

Definition at line 10885 of file ui_main.c.

vmCvar_t ui_selectedModelIndex
 

Definition at line 10792 of file ui_main.c.

vmCvar_t ui_selectedPlayer
 

Definition at line 10867 of file ui_main.c.

vmCvar_t ui_selectedPlayerName
 

Definition at line 10868 of file ui_main.c.

vmCvar_t ui_serverFilterType
 

Definition at line 10860 of file ui_main.c.

vmCvar_t ui_serverStatusTimeOut
 

Definition at line 10896 of file ui_main.c.

vmCvar_t ui_singlePlayerActive
 

Definition at line 10873 of file ui_main.c.

Referenced by _UI_SetActiveMenu().

vmCvar_t ui_spSkill
 

Definition at line 10814 of file ui_main.c.

vmCvar_t ui_team_fraglimit
 

Definition at line 10804 of file ui_main.c.

vmCvar_t ui_team_friendly
 

Definition at line 10806 of file ui_main.c.

vmCvar_t ui_team_timelimit
 

Definition at line 10805 of file ui_main.c.

vmCvar_t ui_teamName
 

Definition at line 10844 of file ui_main.c.

int uiHoldSkinColor = TEAM_FREE
 

Definition at line 573 of file ui_main.c.

Referenced by UI_SkinColor_HandleKey(), and UpdateForceStatus().

animation_t uiHumanoidAnimations[MAX_TOTALANIMATIONS]
 

Definition at line 317 of file ui_main.c.

Referenced by UI_ParseAnimationFile().

uiInfo_t uiInfo
 

Definition at line 554 of file ui_main.c.

Referenced by _UI_DrawSides(), _UI_DrawTopBottom(), _UI_Init(), _UI_MouseEvent(), _UI_Refresh(), _UI_SetActiveMenu(), Asset_Parse(), AssetCache(), Item_Model_Paint(), ItemParse_cvarStrList(), MenuFontToHandle(), UI_ClampMaxPlayers(), UI_ConsoleCommand(), UI_CursorInRect(), UI_DrawSides(), UI_DrawTopBottom(), UI_FeederSelection(), UI_FillRect(), UI_ForceConfigHandle(), UI_GetSaberForMenu(), UI_Load(), UI_LoadArenas(), UI_LoadBestScores(), UI_LoadForceConfig_List(), UI_LoadNonIngame(), UI_SaberAttachToChar(), UI_SaberDrawBlade(), UI_SaberDrawBlades(), UI_SaveForceTemplate(), UI_ServersSort(), UI_ShowPostGame(), UI_SkinColor_HandleKey(), UI_TranslateFCFIndex(), UpdateBotButtons(), and UpdateForceStatus().

int uiNumAllAnims = 1
 

Definition at line 321 of file ui_main.c.

Referenced by UI_AnimsetAlloc(), and UI_ParseAnimationFile().

qboolean UIPAFtextLoaded = qfalse
 

Definition at line 316 of file ui_main.c.

Referenced by UI_ParseAnimationFile().

int uiSkinColor = TEAM_FREE
 

Definition at line 572 of file ui_main.c.

Referenced by UI_SkinColor_HandleKey(), and UpdateForceStatus().