Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ui_main.c File Reference

#include "ui_local.h"

Include dependency graph for ui_main.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  cvarTable_t
struct  serverStatusCvar_t

Defines

#define UI_FPS_FRAMES   4

Functions

void _UI_DrawRect (float x, float y, float width, float height, float size, const float *color)
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_Init (qboolean)
qboolean _UI_IsFullscreen (void)
void _UI_KeyEvent (int key, qboolean down)
void _UI_MouseEvent (int dx, int dy)
void _UI_Refresh (int realtime)
void _UI_SetActiveMenu (uiMenuCommand_t menu)
void _UI_Shutdown (void)
qboolean Alias_Parse (char **p)
int ArenaServers_MaxPing (void)
qboolean Asset_Parse (int handle)
void AssetCache ()
qboolean Character_Parse (char **p)
void Font_Report ()
qboolean GameType_Parse (char **p, qboolean join)
char * GetMenuBuffer (const char *filename)
qboolean Load_Menu (int handle)
qboolean MapList_Parse (char **p)
int ProcessNewUI (int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6)
char * stristr (char *str, char *charset)
qboolean Team_Parse (char **p)
int Text_Height (const char *text, float scale, int limit)
void Text_Paint (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style)
void Text_Paint_Limit (float *maxX, float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit)
void Text_PaintCenter (float x, float y, float scale, vec4_t color, const char *text, float adjust)
void Text_PaintCenter_AutoWrapped (float x, float y, float xmax, float ystep, float scale, vec4_t color, const char *str, float adjust)
void Text_PaintChar (float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader)
void Text_PaintWithCursor (float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style)
int Text_Width (const char *text, float scale, int limit)
const char * UI_AIFromName (const char *name)
const int UI_AIIndex (const char *name)
const int UI_AIIndexFromName (const char *name)
void UI_BinaryServerInsertion (int num)
qboolean UI_BotName_HandleKey (int flags, float *special, int key)
qboolean UI_BotSkill_HandleKey (int flags, float *special, int key)
void UI_BuildFindPlayerList (qboolean force)
void UI_BuildPlayerList ()
void UI_BuildQ3Model_List (void)
void UI_BuildServerDisplayList (qboolean force)
void UI_BuildServerStatus (qboolean force)
qboolean UI_ClanName_HandleKey (int flags, float *special, int key)
qboolean UI_Crosshair_HandleKey (int flags, float *special, int key)
void UI_DisplayDownloadInfo (const char *downloadName, float centerPoint, float yStart, float scale)
void UI_DoServerRefresh (void)
void UI_DrawAllMapsSelection (rectDef_t *rect, float scale, vec4_t color, int textStyle, qboolean net)
void UI_DrawBotName (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawBotSkill (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawCenteredPic (qhandle_t image, int w, int h)
void UI_DrawCinematic (int handle, float x, float y, float w, float h)
void UI_DrawClanCinematic (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawClanLogo (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawClanName (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawConnectScreen (qboolean overlay)
void UI_DrawCrosshair (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawEffects (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawGameType (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawGLInfo (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawHandicap (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawJoinGameType (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawKeyBindStatus (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawMapCinematic (rectDef_t *rect, float scale, vec4_t color, qboolean net)
void UI_DrawMapPreview (rectDef_t *rect, float scale, vec4_t color, qboolean net)
void UI_DrawMapTimeToBeat (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawNetFilter (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawNetGameType (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawNetMapCinematic (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawNetMapPreview (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawNetSource (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawOpponent (rectDef_t *rect)
void UI_DrawOpponentLogo (rectDef_t *rect, vec3_t color)
void UI_DrawOpponentLogoMetal (rectDef_t *rect, vec3_t color)
void UI_DrawOpponentLogoName (rectDef_t *rect, vec3_t color)
void UI_DrawOpponentName (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawPlayerLogo (rectDef_t *rect, vec3_t color)
void UI_DrawPlayerLogoMetal (rectDef_t *rect, vec3_t color)
void UI_DrawPlayerLogoName (rectDef_t *rect, vec3_t color)
void UI_DrawPlayerModel (rectDef_t *rect)
void UI_DrawPreviewCinematic (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawRedBlue (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawSelectedPlayer (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawServerMOTD (rectDef_t *rect, float scale, vec4_t color)
void UI_DrawServerRefreshDate (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawSkill (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawTeamMember (rectDef_t *rect, float scale, vec4_t color, qboolean blue, int num, int textStyle)
void UI_DrawTeamName (rectDef_t *rect, float scale, vec4_t color, qboolean blue, int textStyle)
void UI_DrawTier (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawTierGameType (rectDef_t *rect, float scale, vec4_t color, int textStyle)
void UI_DrawTierMap (rectDef_t *rect, int index)
void UI_DrawTierMapName (rectDef_t *rect, float scale, vec4_t color, int textStyle)
qboolean UI_Effects_HandleKey (int flags, float *special, int key)
const char * UI_EnglishMapName (const char *map)
int UI_FeederCount (float feederID)
qhandle_t UI_FeederItemImage (float feederID, int index)
const char * UI_FeederItemText (float feederID, int index, int column, qhandle_t *handle)
void UI_FeederSelection (float feederID, int index)
qboolean UI_GameType_HandleKey (int flags, float *special, int key, qboolean resetMap)
int UI_GetIndexFromSelection (int actual)
int UI_GetServerStatusInfo (const char *serverAddress, serverStatusInfo_t *info)
void UI_GetTeamColor (vec4_t *color)
float UI_GetValue (int ownerDraw)
qboolean UI_Handicap_HandleKey (int flags, float *special, int key)
qboolean UI_hasSkinForBase (const char *base, const char *team)
int UI_HeadCountByTeam (void)
void UI_InsertServerIntoDisplayList (int num, int position)
qboolean UI_JoinGameType_HandleKey (int flags, float *special, int key)
void UI_Load ()
void UI_LoadDemos ()
void UI_LoadMenus (const char *menuFile, qboolean reset)
void UI_LoadMods ()
void UI_LoadMovies ()
void UI_LoadNonIngame ()
void UI_LoadTeams ()
int UI_MapCountByGameType (qboolean singlePlayer)
qboolean UI_NetFilter_HandleKey (int flags, float *special, int key)
qboolean UI_NetGameType_HandleKey (int flags, float *special, int key)
qboolean UI_NetSource_HandleKey (int flags, float *special, int key)
void UI_NextOpponent ()
const char * UI_OpponentLeaderHead ()
const char * UI_OpponentLeaderModel ()
const char * UI_OpponentLeaderName ()
qboolean UI_OpponentName_HandleKey (int flags, float *special, int key)
void UI_OwnerDraw (float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle)
int UI_OwnerDraw_Width (int ownerDraw)
qboolean UI_OwnerDrawHandleKey (int ownerDraw, int flags, float *special, int key)
qboolean UI_OwnerDrawVisible (int flags)
int UI_OwnerDrawWidth (int ownerDraw, float scale)
void UI_ParseGameInfo (const char *teamFile)
void UI_ParseMenu (const char *menuFile)
void UI_ParseTeamInfo (const char *teamFile)
void UI_Pause (qboolean b)
int UI_PlayCinematic (const char *name, float x, float y, float w, float h)
void UI_PrintTime (char *buf, int bufsize, int time)
void UI_PriorOpponent ()
void UI_ReadableSize (char *buf, int bufsize, int value)
qboolean UI_RedBlue_HandleKey (int flags, float *special, int key)
void UI_RegisterCvars (void)
void UI_RemoveServerFromDisplayList (int num)
void UI_Report ()
void UI_RunCinematicFrame (int handle)
void UI_RunMenuScript (char **args)
const char * UI_SelectedHead (int index, int *actual)
const char * UI_SelectedMap (int index, int *actual)
qboolean UI_SelectedPlayer_HandleKey (int flags, float *special, int key)
int QDECL UI_ServersQsortCompare (const void *arg1, const void *arg2)
void UI_ServersSort (int column, qboolean force)
void UI_SetCapFragLimits (qboolean uiVars)
qboolean UI_SetNextMap (int actual, int index)
void UI_ShowPostGame (qboolean newHigh)
qboolean UI_Skill_HandleKey (int flags, float *special, int key)
void UI_SortServerStatusInfo (serverStatusInfo_t *info)
void UI_StartServerRefresh (qboolean full)
void UI_StartSkirmish (qboolean next)
void UI_StopCinematic (int handle)
void UI_StopServerRefresh (void)
int UI_TeamIndexFromName (const char *name)
qboolean UI_TeamMember_HandleKey (int flags, float *special, int key, qboolean blue, int num)
qboolean UI_TeamName_HandleKey (int flags, float *special, int key, qboolean blue)
void UI_Update (const char *name)
void UI_UpdateCvars (void)
void UI_UpdatePendingPings ()
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)

Variables

cvarTable_t cvarTable []
int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0])
char * defaultMenu = NULL
int frameCount = 0
int gamecodetoui [] = {4,2,3,0,5,1,6}
const char * handicapValues [] = {"None","95","90","85","80","75","70","65","60","55","50","45","40","35","30","25","20","15","10","5",NULL}
connstate_t lastConnState
char lastLoadingText [MAX_INFO_VALUE]
const char * MonthAbbrev []
char * netnames []
const char * netSources []
int numHandicaps = sizeof(handicapValues) / sizeof(const char*)
const int numNetSources = sizeof(netSources) / sizeof(const char*)
const int numServerFilters = sizeof(serverFilters) / sizeof(serverFilter_t)
const int numSkillLevels = sizeof(skillLevels) / sizeof(const char*)
const int numSortKeys = sizeof(sortKeys) / sizeof(const char*)
int const numTeamArenaGameNames = sizeof(teamArenaGameNames) / sizeof(const char*)
int const numTeamArenaGameTypes = sizeof(teamArenaGameTypes) / sizeof(const char*)
qboolean q3Model = qfalse
char quake3worldMessage [] = "Visit www.quake3world.com - News, Community, Events, Files"
const serverFilter_t serverFilters []
serverStatusCvar_t serverStatusCvars []
const char * skillLevels []
const char * sortKeys []
int startTime
const char * teamArenaGameNames []
const char * teamArenaGameTypes []
vmCvar_t ui_actualNetGameType
vmCvar_t ui_arenasFile
vmCvar_t ui_bigFont
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_botsFile
vmCvar_t ui_brassTime
vmCvar_t ui_browserGameType
vmCvar_t ui_browserMaster
vmCvar_t ui_browserShowEmpty
vmCvar_t ui_browserShowFull
vmCvar_t ui_browserSortKey
vmCvar_t ui_captureLimit
vmCvar_t ui_cdkeychecked
vmCvar_t ui_ctf_capturelimit
vmCvar_t ui_ctf_friendly
vmCvar_t ui_ctf_timelimit
vmCvar_t ui_currentMap
vmCvar_t ui_currentNetMap
vmCvar_t ui_currentOpponent
vmCvar_t ui_currentTier
vmCvar_t ui_debug
vmCvar_t ui_dedicated
vmCvar_t ui_drawCrosshair
vmCvar_t ui_drawCrosshairNames
vmCvar_t ui_ffa_fraglimit
vmCvar_t ui_ffa_timelimit
vmCvar_t ui_findPlayer
vmCvar_t ui_fragLimit
vmCvar_t ui_gameType
vmCvar_t ui_hudFiles
vmCvar_t ui_initialized
vmCvar_t ui_joinGameType
vmCvar_t ui_lastServerRefresh_0
vmCvar_t ui_lastServerRefresh_1
vmCvar_t ui_lastServerRefresh_2
vmCvar_t ui_lastServerRefresh_3
vmCvar_t ui_mapIndex
vmCvar_t ui_marks
vmCvar_t ui_menuFiles
vmCvar_t ui_netGameType
vmCvar_t ui_netSource
vmCvar_t ui_new
vmCvar_t ui_opponentName
vmCvar_t ui_Q3Model
vmCvar_t ui_realCaptureLimit
vmCvar_t ui_realWarmUp
vmCvar_t ui_recordSPDemo
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_scoreAccuracy
vmCvar_t ui_scoreAssists
vmCvar_t ui_scoreBase
vmCvar_t ui_scoreCaptures
vmCvar_t ui_scoreDefends
vmCvar_t ui_scoreExcellents
vmCvar_t ui_scoreGauntlets
vmCvar_t ui_scoreImpressives
vmCvar_t ui_scorePerfect
vmCvar_t ui_scoreScore
vmCvar_t ui_scoreShutoutBonus
vmCvar_t ui_scoreSkillBonus
vmCvar_t ui_scoreTeam
vmCvar_t ui_scoreTime
vmCvar_t ui_scoreTimeBonus
vmCvar_t ui_selectedPlayer
vmCvar_t ui_selectedPlayerName
vmCvar_t ui_server1
vmCvar_t ui_server10
vmCvar_t ui_server11
vmCvar_t ui_server12
vmCvar_t ui_server13
vmCvar_t ui_server14
vmCvar_t ui_server15
vmCvar_t ui_server16
vmCvar_t ui_server2
vmCvar_t ui_server3
vmCvar_t ui_server4
vmCvar_t ui_server5
vmCvar_t ui_server6
vmCvar_t ui_server7
vmCvar_t ui_server8
vmCvar_t ui_server9
vmCvar_t ui_serverFilterType
vmCvar_t ui_serverStatusTimeOut
vmCvar_t ui_singlePlayerActive
vmCvar_t ui_smallFont
vmCvar_t ui_spAwards
vmCvar_t ui_spScores1
vmCvar_t ui_spScores2
vmCvar_t ui_spScores3
vmCvar_t ui_spScores4
vmCvar_t ui_spScores5
vmCvar_t ui_spSelection
vmCvar_t ui_spSkill
vmCvar_t ui_spVideos
vmCvar_t ui_team_fraglimit
vmCvar_t ui_team_friendly
vmCvar_t ui_team_timelimit
vmCvar_t ui_teamArenaFirstRun
vmCvar_t ui_teamName
vmCvar_t ui_tourney_fraglimit
vmCvar_t ui_tourney_timelimit
uiInfo_t uiInfo
int uitogamecode [] = {4,6,2,3,1,5,7}
qboolean updateModel = qtrue
qboolean updateOpponentModel = qtrue


Define Documentation

#define UI_FPS_FRAMES   4
 

Definition at line 602 of file ui_main.c.

Referenced by _UI_Refresh().


Function Documentation

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

Definition at line 267 of file ui_main.c.

References _UI_DrawSides(), _UI_DrawTopBottom(), height, NULL, trap_R_SetColor(), width, x, and y.

00267                                                                                                  {
00268     trap_R_SetColor( color );
00269 
00270   _UI_DrawTopBottom(x, y, width, height, size);
00271   _UI_DrawSides(x, y, width, height, size);
00272 
00273     trap_R_SetColor( NULL );
00274 }

Here is the call graph for this function:

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

Definition at line 247 of file ui_main.c.

References h(), trap_R_DrawStretchPic(), UI_AdjustFrom640(), uiInfo_t::uiDC, uiInfo, w, displayContextDef_t::whiteShader, x, displayContextDef_t::xscale, and y.

Referenced by _UI_DrawRect().

00247                                                                    {
00248     UI_AdjustFrom640( &x, &y, &w, &h );
00249     size *= uiInfo.uiDC.xscale;
00250     trap_R_DrawStretchPic( x, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00251     trap_R_DrawStretchPic( x + w - size, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00252 }

Here is the call graph for this function:

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

Definition at line 254 of file ui_main.c.

References h(), trap_R_DrawStretchPic(), UI_AdjustFrom640(), uiInfo_t::uiDC, uiInfo, w, displayContextDef_t::whiteShader, x, y, and displayContextDef_t::yscale.

Referenced by _UI_DrawRect().

00254                                                                        {
00255     UI_AdjustFrom640( &x, &y, &w, &h );
00256     size *= uiInfo.uiDC.yscale;
00257     trap_R_DrawStretchPic( x, y, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00258     trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00259 }

Here is the call graph for this function:

void _UI_Init qboolean   ) 
 

Definition at line 5026 of file ui_main.c.

References displayContextDef_t::addRefEntityToScene, uiInfo_t::aliasCount, AssetCache(), displayContextDef_t::bias, uiInfo_t::characterCount, displayContextDef_t::clearScene, uiInfo_t::currentCrosshair, serverStatus_s::currentServerCinematic, displayContextDef_t::cursor, 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, gamecodetoui, 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, 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, qfalse, 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, displayContextDef_t::textHeight, displayContextDef_t::textWidth, trap_Cvar_Register(), trap_Cvar_Set(), trap_Cvar_VariableValue(), trap_GetGlconfig(), trap_LAN_LoadCachedServers(), trap_Milliseconds(), trap_R_RegisterShaderNoMip(), UI_BuildQ3Model_List(), ui_currentMap, UI_Cvar_VariableString(), ui_gameType, UI_InitMemory(), UI_LoadBestScores(), UI_LoadBots(), UI_LoadMenus(), UI_LoadTeams(), ui_netGameType, UI_ParseGameInfo(), UI_ParseTeamInfo(), UI_RegisterCvars(), uiInfo_t::uiDC, uiInfo, va(), glconfig_t::vidHeight, glconfig_t::vidWidth, displayContextDef_t::whiteShader, displayContextDef_t::xscale, and displayContextDef_t::yscale.

Referenced by vmMain().

05026                                      {
05027     const char *menuSet;
05028     int start;
05029 
05030     //uiInfo.inGameLoad = inGameLoad;
05031 
05032     UI_RegisterCvars();
05033     UI_InitMemory();
05034 
05035     // cache redundant calulations
05036     trap_GetGlconfig( &uiInfo.uiDC.glconfig );
05037 
05038     // for 640x480 virtualized screen
05039     uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0/480.0);
05040     uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * (1.0/640.0);
05041     if ( uiInfo.uiDC.glconfig.vidWidth * 480 > uiInfo.uiDC.glconfig.vidHeight * 640 ) {
05042         // wide screen
05043         uiInfo.uiDC.bias = 0.5 * ( uiInfo.uiDC.glconfig.vidWidth - ( uiInfo.uiDC.glconfig.vidHeight * (640.0/480.0) ) );
05044     }
05045     else {
05046         // no wide screen
05047         uiInfo.uiDC.bias = 0;
05048     }
05049 
05050 
05051   //UI_Load();
05052     uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip;
05053     uiInfo.uiDC.setColor = &UI_SetColor;
05054     uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic;
05055     uiInfo.uiDC.drawStretchPic = &trap_R_DrawStretchPic;
05056     uiInfo.uiDC.drawText = &Text_Paint;
05057     uiInfo.uiDC.textWidth = &Text_Width;
05058     uiInfo.uiDC.textHeight = &Text_Height;
05059     uiInfo.uiDC.registerModel = &trap_R_RegisterModel;
05060     uiInfo.uiDC.modelBounds = &trap_R_ModelBounds;
05061     uiInfo.uiDC.fillRect = &UI_FillRect;
05062     uiInfo.uiDC.drawRect = &_UI_DrawRect;
05063     uiInfo.uiDC.drawSides = &_UI_DrawSides;
05064     uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom;
05065     uiInfo.uiDC.clearScene = &trap_R_ClearScene;
05066     uiInfo.uiDC.drawSides = &_UI_DrawSides;
05067     uiInfo.uiDC.addRefEntityToScene = &trap_R_AddRefEntityToScene;
05068     uiInfo.uiDC.renderScene = &trap_R_RenderScene;
05069     uiInfo.uiDC.registerFont = &trap_R_RegisterFont;
05070     uiInfo.uiDC.ownerDrawItem = &UI_OwnerDraw;
05071     uiInfo.uiDC.getValue = &UI_GetValue;
05072     uiInfo.uiDC.ownerDrawVisible = &UI_OwnerDrawVisible;
05073     uiInfo.uiDC.runScript = &UI_RunMenuScript;
05074     uiInfo.uiDC.getTeamColor = &UI_GetTeamColor;
05075     uiInfo.uiDC.setCVar = trap_Cvar_Set;
05076     uiInfo.uiDC.getCVarString = trap_Cvar_VariableStringBuffer;
05077     uiInfo.uiDC.getCVarValue = trap_Cvar_VariableValue;
05078     uiInfo.uiDC.drawTextWithCursor = &Text_PaintWithCursor;
05079     uiInfo.uiDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode;
05080     uiInfo.uiDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode;
05081     uiInfo.uiDC.startLocalSound = &trap_S_StartLocalSound;
05082     uiInfo.uiDC.ownerDrawHandleKey = &UI_OwnerDrawHandleKey;
05083     uiInfo.uiDC.feederCount = &UI_FeederCount;
05084     uiInfo.uiDC.feederItemImage = &UI_FeederItemImage;
05085     uiInfo.uiDC.feederItemText = &UI_FeederItemText;
05086     uiInfo.uiDC.feederSelection = &UI_FeederSelection;
05087     uiInfo.uiDC.setBinding = &trap_Key_SetBinding;
05088     uiInfo.uiDC.getBindingBuf = &trap_Key_GetBindingBuf;
05089     uiInfo.uiDC.keynumToStringBuf = &trap_Key_KeynumToStringBuf;
05090     uiInfo.uiDC.executeText = &trap_Cmd_ExecuteText;
05091     uiInfo.uiDC.Error = &Com_Error; 
05092     uiInfo.uiDC.Print = &Com_Printf; 
05093     uiInfo.uiDC.Pause = &UI_Pause;
05094     uiInfo.uiDC.ownerDrawWidth = &UI_OwnerDrawWidth;
05095     uiInfo.uiDC.registerSound = &trap_S_RegisterSound;
05096     uiInfo.uiDC.startBackgroundTrack = &trap_S_StartBackgroundTrack;
05097     uiInfo.uiDC.stopBackgroundTrack = &trap_S_StopBackgroundTrack;
05098     uiInfo.uiDC.playCinematic = &UI_PlayCinematic;
05099     uiInfo.uiDC.stopCinematic = &UI_StopCinematic;
05100     uiInfo.uiDC.drawCinematic = &UI_DrawCinematic;
05101     uiInfo.uiDC.runCinematicFrame = &UI_RunCinematicFrame;
05102 
05103     Init_Display(&uiInfo.uiDC);
05104 
05105     String_Init();
05106   
05107     uiInfo.uiDC.cursor  = trap_R_RegisterShaderNoMip( "menu/art/3_cursor2" );
05108     uiInfo.uiDC.whiteShader = trap_R_RegisterShaderNoMip( "white" );
05109 
05110     AssetCache();
05111 
05112     start = trap_Milliseconds();
05113 
05114   uiInfo.teamCount = 0;
05115   uiInfo.characterCount = 0;
05116   uiInfo.aliasCount = 0;
05117 
05118 #ifdef PRE_RELEASE_TADEMO
05119     UI_ParseTeamInfo("demoteaminfo.txt");
05120     UI_ParseGameInfo("demogameinfo.txt");
05121 #else
05122     UI_ParseTeamInfo("teaminfo.txt");
05123     UI_LoadTeams();
05124     UI_ParseGameInfo("gameinfo.txt");
05125 #endif
05126 
05127     menuSet = UI_Cvar_VariableString("ui_menuFiles");
05128     if (menuSet == NULL || menuSet[0] == '\0') {
05129         menuSet = "ui/menus.txt";
05130     }
05131 
05132 #if 0
05133     if (uiInfo.inGameLoad) {
05134         UI_LoadMenus("ui/ingame.txt", qtrue);
05135     } else { // bk010222: left this: UI_LoadMenus(menuSet, qtrue);
05136     }
05137 #else 
05138     UI_LoadMenus(menuSet, qtrue);
05139     UI_LoadMenus("ui/ingame.txt", qfalse);
05140 #endif
05141     
05142     Menus_CloseAll();
05143 
05144     trap_LAN_LoadCachedServers();
05145     UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum);
05146 
05147     UI_BuildQ3Model_List();
05148     UI_LoadBots();
05149 
05150     // sets defaults for ui temp cvars
05151     uiInfo.effectsColor = gamecodetoui[(int)trap_Cvar_VariableValue("color1")-1];
05152     uiInfo.currentCrosshair = (int)trap_Cvar_VariableValue("cg_drawCrosshair");
05153     trap_Cvar_Set("ui_mousePitch", (trap_Cvar_VariableValue("m_pitch") >= 0) ? "0" : "1");
05154 
05155     uiInfo.serverStatus.currentServerCinematic = -1;
05156     uiInfo.previewMovie = -1;
05157 
05158     if (trap_Cvar_VariableValue("ui_TeamArenaFirstRun") == 0) {
05159         trap_Cvar_Set("s_volume", "0.8");
05160         trap_Cvar_Set("s_musicvolume", "0.5");
05161         trap_Cvar_Set("ui_TeamArenaFirstRun", "1");
05162     }
05163 
05164     trap_Cvar_Register(NULL, "debug_protocol", "", 0 );
05165 
05166     trap_Cvar_Set("ui_actualNetGameType", va("%d", ui_netGameType.integer));
05167 }

Here is the call graph for this function:

qboolean _UI_IsFullscreen void   ) 
 

Definition at line 5306 of file ui_main.c.

References Menus_AnyFullScreenVisible(), and qboolean.

Referenced by vmMain().

05306                                   {
05307     return Menus_AnyFullScreenVisible();
05308 }

Here is the call graph for this function:

void _UI_KeyEvent int  key,
qboolean  down
 

Definition at line 5175 of file ui_main.c.

References down, K_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().

05175                                             {
05176 
05177   if (Menu_Count() > 0) {
05178     menuDef_t *menu = Menu_GetFocused();
05179         if (menu) {
05180             if (key == K_ESCAPE && down && !Menus_AnyFullScreenVisible()) {
05181                 Menus_CloseAll();
05182             } else {
05183                 Menu_HandleKey(menu, key, down );
05184             }
05185         } else {
05186             trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI );
05187             trap_Key_ClearStates();
05188             trap_Cvar_Set( "cl_paused", "0" );
05189         }
05190   }
05191 
05192   //if ((s > 0) && (s != menu_null_sound)) {
05193     //  trap_S_StartLocalSound( s, CHAN_LOCAL_SOUND );
05194   //}
05195 }

Here is the call graph for this function:

void _UI_MouseEvent int  dx,
int  dy
 

Definition at line 5202 of file ui_main.c.

References displayContextDef_t::cursorx, displayContextDef_t::cursory, Display_MouseMove(), Menu_Count(), NULL, uiInfo_t::uiDC, and uiInfo.

Referenced by vmMain().

05203 {
05204     // update mouse screen position
05205     uiInfo.uiDC.cursorx += dx;
05206     if (uiInfo.uiDC.cursorx < 0)
05207         uiInfo.uiDC.cursorx = 0;
05208     else if (uiInfo.uiDC.cursorx > SCREEN_WIDTH)
05209         uiInfo.uiDC.cursorx = SCREEN_WIDTH;
05210 
05211     uiInfo.uiDC.cursory += dy;
05212     if (uiInfo.uiDC.cursory < 0)
05213         uiInfo.uiDC.cursory = 0;
05214     else if (uiInfo.uiDC.cursory > SCREEN_HEIGHT)
05215         uiInfo.uiDC.cursory = SCREEN_HEIGHT;
05216 
05217   if (Menu_Count() > 0) {
05218     //menuDef_t *menu = Menu_GetFocused();
05219     //Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
05220         Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
05221   }
05222 
05223 }

Here is the call graph for this function:

void _UI_Refresh int  realtime  ) 
 

Definition at line 603 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::cursor, displayContextDef_t::cursorx, displayContextDef_t::cursory, displayContextDef_t::debug, displayContextDef_t::FPS, displayContextDef_t::frameTime, i, Menu_Count(), Menu_PaintAll(), NULL, qfalse, displayContextDef_t::realTime, UI_BuildFindPlayerList(), UI_BuildServerStatus(), UI_DoServerRefresh(), UI_DrawHandlePic(), UI_FPS_FRAMES, UI_SetColor(), UI_UpdateCvars(), uiInfo_t::uiDC, and uiInfo.

Referenced by vmMain().

00604 {
00605     static int index;
00606     static int  previousTimes[UI_FPS_FRAMES];
00607 
00608     //if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) {
00609     //  return;
00610     //}
00611 
00612     uiInfo.uiDC.frameTime = realtime - uiInfo.uiDC.realTime;
00613     uiInfo.uiDC.realTime = realtime;
00614 
00615     previousTimes[index % UI_FPS_FRAMES] = uiInfo.uiDC.frameTime;
00616     index++;
00617     if ( index > UI_FPS_FRAMES ) {
00618         int i, total;
00619         // average multiple frames together to smooth changes out a bit
00620         total = 0;
00621         for ( i = 0 ; i < UI_FPS_FRAMES ; i++ ) {
00622             total += previousTimes[i];
00623         }
00624         if ( !total ) {
00625             total = 1;
00626         }
00627         uiInfo.uiDC.FPS = 1000 * UI_FPS_FRAMES / total;
00628     }
00629 
00630 
00631 
00632     UI_UpdateCvars();
00633 
00634     if (Menu_Count() > 0) {
00635         // paint all the menus
00636         Menu_PaintAll();
00637         // refresh server browser list
00638         UI_DoServerRefresh();
00639         // refresh server status
00640         UI_BuildServerStatus(qfalse);
00641         // refresh find player list
00642         UI_BuildFindPlayerList(qfalse);
00643     } 
00644     
00645     // draw cursor
00646     UI_SetColor( NULL );
00647     if (Menu_Count() > 0) {
00648         UI_DrawHandlePic( uiInfo.uiDC.cursorx-16, uiInfo.uiDC.cursory-16, 32, 32, uiInfo.uiDC.Assets.cursor);
00649     }
00650 
00651 #ifndef NDEBUG
00652     if (uiInfo.uiDC.debug)
00653     {
00654         // cursor coordinates
00655         //FIXME
00656         //UI_DrawString( 0, 0, va("(%d,%d)",uis.cursorx,uis.cursory), UI_LEFT|UI_SMALLFONT, colorRed );
00657     }
00658 #endif
00659 
00660 }

Here is the call graph for this function:

void _UI_SetActiveMenu uiMenuCommand_t  menu  ) 
 

Definition at line 5234 of file ui_main.c.

References uiInfo_t::inGameLoad, vmCvar_t::integer, KEYCATCH_UI, Menu_Count(), Menus_ActivateByName(), Menus_CloseAll(), strlen(), trap_Cvar_Set(), trap_Cvar_VariableStringBuffer(), trap_Key_ClearStates(), trap_Key_GetCatcher(), trap_Key_SetCatcher(), UI_BuildPlayerList(), UI_LoadNonIngame(), ui_singlePlayerActive, uiInfo, UIMENU_BAD_CD_KEY, UIMENU_INGAME, UIMENU_MAIN, UIMENU_NEED_CD, UIMENU_NONE, UIMENU_POSTGAME, UIMENU_TEAM, v, and vec3_t.

Referenced by UI_ShowPostGame(), and vmMain().

05234                                                {
05235     char buf[256];
05236 
05237     // this should be the ONLY way the menu system is brought up
05238     // enusure minumum menu data is cached
05239   if (Menu_Count() > 0) {
05240         vec3_t v;
05241         v[0] = v[1] = v[2] = 0;
05242       switch ( menu ) {
05243       case UIMENU_NONE:
05244             trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI );
05245             trap_Key_ClearStates();
05246             trap_Cvar_Set( "cl_paused", "0" );
05247             Menus_CloseAll();
05248 
05249           return;
05250       case UIMENU_MAIN:
05251             //trap_Cvar_Set( "sv_killserver", "1" );
05252             trap_Key_SetCatcher( KEYCATCH_UI );
05253             //trap_S_StartLocalSound( trap_S_RegisterSound("sound/misc/menu_background.wav", qfalse) , CHAN_LOCAL_SOUND );
05254             //trap_S_StartBackgroundTrack("sound/misc/menu_background.wav", NULL);
05255             if (uiInfo.inGameLoad) {
05256                 UI_LoadNonIngame();
05257             }
05258             Menus_CloseAll();
05259             Menus_ActivateByName("main");
05260             trap_Cvar_VariableStringBuffer("com_errorMessage", buf, sizeof(buf));
05261             if (strlen(buf)) {
05262                 if (!ui_singlePlayerActive.integer) {
05263                     Menus_ActivateByName("error_popmenu");
05264                 } else {
05265                     trap_Cvar_Set("com_errorMessage", "");
05266                 }
05267             }
05268           return;
05269       case UIMENU_TEAM:
05270             trap_Key_SetCatcher( KEYCATCH_UI );
05271       Menus_ActivateByName("team");
05272           return;
05273       case UIMENU_NEED_CD:
05274             // no cd check in TA
05275             //trap_Key_SetCatcher( KEYCATCH_UI );
05276       //Menus_ActivateByName("needcd");
05277           //UI_ConfirmMenu( "Insert the CD", NULL, NeedCDAction );
05278           return;
05279       case UIMENU_BAD_CD_KEY:
05280             // no cd check in TA
05281             //trap_Key_SetCatcher( KEYCATCH_UI );
05282       //Menus_ActivateByName("badcd");
05283           //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction );
05284           return;
05285       case UIMENU_POSTGAME:
05286             //trap_Cvar_Set( "sv_killserver", "1" );
05287             trap_Key_SetCatcher( KEYCATCH_UI );
05288             if (uiInfo.inGameLoad) {
05289                 UI_LoadNonIngame();
05290             }
05291             Menus_CloseAll();
05292             Menus_ActivateByName("endofgame");
05293           //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction );
05294           return;
05295       case UIMENU_INGAME:
05296           trap_Cvar_Set( "cl_paused", "1" );
05297             trap_Key_SetCatcher( KEYCATCH_UI );
05298             UI_BuildPlayerList();
05299             Menus_CloseAll();
05300             Menus_ActivateByName("ingame");
05301           return;
05302       }
05303   }
05304 }

Here is the call graph for this function:

void _UI_Shutdown void   ) 
 

Definition at line 667 of file ui_main.c.

References trap_LAN_SaveCachedServers().

Referenced by vmMain().

00667                           {
00668     trap_LAN_SaveCachedServers();
00669 }

Here is the call graph for this function:

qboolean Alias_Parse char **  p  )  [static]
 

Definition at line 4620 of file ui_main.c.

References uiInfo_t::aliasCount, uiInfo_t::aliasList, COM_ParseExt(), Com_Printf(), p, Q_stricmp(), qboolean, qtrue, String_Parse(), token, and uiInfo.

Referenced by UI_ParseTeamInfo().

04620                                       {
04621   char *token;
04622 
04623   token = COM_ParseExt(p, qtrue);
04624 
04625   if (token[0] != '{') {
04626     return qfalse;
04627   }
04628 
04629   while ( 1 ) {
04630     token = COM_ParseExt(p, qtrue);
04631 
04632     if (Q_stricmp(token, "}") == 0) {
04633       return qtrue;
04634     }
04635 
04636     if ( !token || token[0] == 0 ) {
04637       return qfalse;
04638     }
04639 
04640     if (token[0] == '{') {
04641       // three tokens per line, character name, bot alias, and preferred action a - all purpose, d - defense, o - offense
04642       if (!String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].name) || !String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].ai) || !String_Parse(p, &uiInfo.aliasList[uiInfo.aliasCount].action)) {
04643         return qfalse;
04644       }
04645     
04646       Com_Printf("Loaded character alias %s using character ai %s.\n", uiInfo.aliasList[uiInfo.aliasCount].name, uiInfo.aliasList[uiInfo.aliasCount].ai);
04647       if (uiInfo.aliasCount < MAX_ALIASES) {
04648         uiInfo.aliasCount++;
04649       } else {
04650         Com_Printf("Too many aliases, last alias replaced!\n");
04651       }
04652      
04653       token = COM_ParseExt(p, qtrue);
04654       if (token[0] != '}') {
04655         return qfalse;
04656       }
04657     }
04658   }
04659 
04660   return qfalse;
04661 }

Here is the call graph for this function:

int ArenaServers_MaxPing void   )  [static]
 

Definition at line 5890 of file ui_main.c.

References trap_Cvar_VariableValue().

05890                                         {
05891     int     maxPing;
05892 
05893     maxPing = (int)trap_Cvar_VariableValue( "cl_maxPing" );
05894     if( maxPing < 100 ) {
05895         maxPing = 100;
05896     }
05897     return maxPing;
05898 }

Here is the call graph for this function:

qboolean Asset_Parse int  handle  ) 
 

Definition at line 697 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::bigFont, cachedAssets_t::cursor, cachedAssets_t::cursorStr, 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, PC_Color_Parse(), PC_Float_Parse(), PC_Int_Parse(), PC_String_Parse(), pc_token_t, Q_stricmp(), qboolean, qfalse, cachedAssets_t::shadowColor, cachedAssets_t::shadowFadeClamp, cachedAssets_t::shadowX, cachedAssets_t::shadowY, cachedAssets_t::smallFont, pc_token_s::string, cachedAssets_t::textFont, token, trap_PC_ReadToken(), trap_R_RegisterFont(), trap_R_RegisterShaderNoMip(), trap_S_RegisterSound(), uiInfo_t::uiDC, and uiInfo.

Referenced by UI_ParseMenu().

00697                                  {
00698     pc_token_t token;
00699     const char *tempStr;
00700 
00701     if (!trap_PC_ReadToken(handle, &token))
00702         return qfalse;
00703     if (Q_stricmp(token.string, "{") != 0) {
00704         return qfalse;
00705     }
00706     
00707     while ( 1 ) {
00708 
00709         memset(&token, 0, sizeof(pc_token_t));
00710 
00711         if (!trap_PC_ReadToken(handle, &token))
00712             return qfalse;
00713 
00714         if (Q_stricmp(token.string, "}") == 0) {
00715             return qtrue;
00716         }
00717 
00718         // font
00719         if (Q_stricmp(token.string, "font") == 0) {
00720             int pointSize;
00721             if (!PC_String_Parse(handle, &tempStr) || !PC_Int_Parse(handle,&pointSize)) {
00722                 return qfalse;
00723             }
00724             trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.textFont);
00725             uiInfo.uiDC.Assets.fontRegistered = qtrue;
00726             continue;
00727         }
00728 
00729         if (Q_stricmp(token.string, "smallFont") == 0) {
00730             int pointSize;
00731             if (!PC_String_Parse(handle, &tempStr) || !PC_Int_Parse(handle,&pointSize)) {
00732                 return qfalse;
00733             }
00734             trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.smallFont);
00735             continue;
00736         }
00737 
00738         if (Q_stricmp(token.string, "bigFont") == 0) {
00739             int pointSize;
00740             if (!PC_String_Parse(handle, &tempStr) || !PC_Int_Parse(handle,&pointSize)) {
00741                 return qfalse;
00742             }
00743             trap_R_RegisterFont(tempStr, pointSize, &uiInfo.uiDC.Assets.bigFont);
00744             continue;
00745         }
00746 
00747 
00748         // gradientbar
00749         if (Q_stricmp(token.string, "gradientbar") == 0) {
00750             if (!PC_String_Parse(handle, &tempStr)) {
00751                 return qfalse;
00752             }
00753             uiInfo.uiDC.Assets.gradientBar = trap_R_RegisterShaderNoMip(tempStr);
00754             continue;
00755         }
00756 
00757         // enterMenuSound
00758         if (Q_stricmp(token.string, "menuEnterSound") == 0) {
00759             if (!PC_String_Parse(handle, &tempStr)) {
00760                 return qfalse;
00761             }
00762             uiInfo.uiDC.Assets.menuEnterSound = trap_S_RegisterSound( tempStr, qfalse );
00763             continue;
00764         }
00765 
00766         // exitMenuSound
00767         if (Q_stricmp(token.string, "menuExitSound") == 0) {
00768             if (!PC_String_Parse(handle, &tempStr)) {
00769                 return qfalse;
00770             }
00771             uiInfo.uiDC.Assets.menuExitSound = trap_S_RegisterSound( tempStr, qfalse );
00772             continue;
00773         }
00774 
00775         // itemFocusSound
00776         if (Q_stricmp(token.string, "itemFocusSound") == 0) {
00777             if (!PC_String_Parse(handle, &tempStr)) {
00778                 return qfalse;
00779             }
00780             uiInfo.uiDC.Assets.itemFocusSound = trap_S_RegisterSound( tempStr, qfalse );
00781             continue;
00782         }
00783 
00784         // menuBuzzSound
00785         if (Q_stricmp(token.string, "menuBuzzSound") == 0) {
00786             if (!PC_String_Parse(handle, &tempStr)) {
00787                 return qfalse;
00788             }
00789             uiInfo.uiDC.Assets.menuBuzzSound = trap_S_RegisterSound( tempStr, qfalse );
00790             continue;
00791         }
00792 
00793         if (Q_stricmp(token.string, "cursor") == 0) {
00794             if (!PC_String_Parse(handle, &uiInfo.uiDC.Assets.cursorStr)) {
00795                 return qfalse;
00796             }
00797             uiInfo.uiDC.Assets.cursor = trap_R_RegisterShaderNoMip( uiInfo.uiDC.Assets.cursorStr);
00798             continue;
00799         }
00800 
00801         if (Q_stricmp(token.string, "fadeClamp") == 0) {
00802             if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.fadeClamp)) {
00803                 return qfalse;
00804             }
00805             continue;
00806         }
00807 
00808         if (Q_stricmp(token.string, "fadeCycle") == 0) {
00809             if (!PC_Int_Parse(handle, &uiInfo.uiDC.Assets.fadeCycle)) {
00810                 return qfalse;
00811             }
00812             continue;
00813         }
00814 
00815         if (Q_stricmp(token.string, "fadeAmount") == 0) {
00816             if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.fadeAmount)) {
00817                 return qfalse;
00818             }
00819             continue;
00820         }
00821 
00822         if (Q_stricmp(token.string, "shadowX") == 0) {
00823             if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.shadowX)) {
00824                 return qfalse;
00825             }
00826             continue;
00827         }
00828 
00829         if (Q_stricmp(token.string, "shadowY") == 0) {
00830             if (!PC_Float_Parse(handle, &uiInfo.uiDC.Assets.shadowY)) {
00831                 return qfalse;
00832             }
00833             continue;
00834         }
00835 
00836         if (Q_stricmp(token.string, "shadowColor") == 0) {
00837             if (!PC_Color_Parse(handle, &uiInfo.uiDC.Assets.shadowColor)) {
00838                 return qfalse;
00839             }
00840             uiInfo.uiDC.Assets.shadowFadeClamp = uiInfo.uiDC.Assets.shadowColor[3];
00841             continue;
00842         }
00843 
00844     }
00845     return qfalse;
00846 }

Here is the call graph for this function:

void AssetCache  ) 
 

Definition at line 216 of file ui_main.c.

References ART_FX_BASE, ART_FX_BLUE, ART_FX_CYAN, ART_FX_GREEN, ART_FX_RED, ART_FX_TEAL, 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::fxBasePic, cachedAssets_t::fxPic, cachedAssets_t::gradientBar, n, uiInfo_t::newHighScoreSound, qfalse, 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(), trap_S_RegisterSound(), uiInfo_t::uiDC, uiInfo, and va().

Referenced by _UI_Init().

00216                   {
00217     int n;
00218     //if (Assets.textFont == NULL) {
00219     //}
00220     //Assets.background = trap_R_RegisterShaderNoMip( ASSET_BACKGROUND );
00221     //Com_Printf("Menu Size: %i bytes\n", sizeof(Menus));
00222     uiInfo.uiDC.Assets.gradientBar = trap_R_RegisterShaderNoMip( ASSET_GRADIENTBAR );
00223     uiInfo.uiDC.Assets.fxBasePic = trap_R_RegisterShaderNoMip( ART_FX_BASE );
00224     uiInfo.uiDC.Assets.fxPic[0] = trap_R_RegisterShaderNoMip( ART_FX_RED );
00225     uiInfo.uiDC.Assets.fxPic[1] = trap_R_RegisterShaderNoMip( ART_FX_YELLOW );
00226     uiInfo.uiDC.Assets.fxPic[2] = trap_R_RegisterShaderNoMip( ART_FX_GREEN );
00227     uiInfo.uiDC.Assets.fxPic[3] = trap_R_RegisterShaderNoMip( ART_FX_TEAL );
00228     uiInfo.uiDC.Assets.fxPic[4] = trap_R_RegisterShaderNoMip( ART_FX_BLUE );
00229     uiInfo.uiDC.Assets.fxPic[5] = trap_R_RegisterShaderNoMip( ART_FX_CYAN );
00230     uiInfo.uiDC.Assets.fxPic[6] = trap_R_RegisterShaderNoMip( ART_FX_WHITE );
00231     uiInfo.uiDC.Assets.scrollBar = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR );
00232     uiInfo.uiDC.Assets.scrollBarArrowDown = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWDOWN );
00233     uiInfo.uiDC.Assets.scrollBarArrowUp = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWUP );
00234     uiInfo.uiDC.Assets.scrollBarArrowLeft = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWLEFT );
00235     uiInfo.uiDC.Assets.scrollBarArrowRight = trap_R_RegisterShaderNoMip( ASSET_SCROLLBAR_ARROWRIGHT );
00236     uiInfo.uiDC.Assets.scrollBarThumb = trap_R_RegisterShaderNoMip( ASSET_SCROLL_THUMB );
00237     uiInfo.uiDC.Assets.sliderBar = trap_R_RegisterShaderNoMip( ASSET_SLIDER_BAR );
00238     uiInfo.uiDC.Assets.sliderThumb = trap_R_RegisterShaderNoMip( ASSET_SLIDER_THUMB );
00239 
00240     for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
00241         uiInfo.uiDC.Assets.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
00242     }
00243 
00244     uiInfo.newHighScoreSound = trap_S_RegisterSound("sound/feedback/voc_newhighscore.wav", qfalse);
00245 }

Here is the call graph for this function:

qboolean Character_Parse char **  p  )  [static]
 

Definition at line 4563 of file ui_main.c.

References characterInfo::base, uiInfo_t::characterCount, uiInfo_t::characterList, COM_ParseExt(), Com_Printf(), characterInfo::headImage, characterInfo::imageName, p, Q_stricmp(), qboolean, qtrue, String_Alloc(), String_Parse(), token, uiInfo, and va().

Referenced by UI_ParseTeamInfo().

04563                                           {
04564   char *token;
04565   const char *tempStr;
04566 
04567   token = COM_ParseExt(p, qtrue);
04568 
04569   if (token[0] != '{') {
04570     return qfalse;
04571   }
04572 
04573 
04574   while ( 1 ) {
04575     token = COM_ParseExt(p, qtrue);
04576 
04577     if (Q_stricmp(token, "}") == 0) {
04578       return qtrue;
04579     }
04580 
04581     if ( !token || token[0] == 0 ) {
04582       return qfalse;
04583     }
04584 
04585     if (token[0] == '{') {
04586       // two tokens per line, character name and sex
04587       if (!String_Parse(p, &uiInfo.characterList[uiInfo.characterCount].name) || !String_Parse(p, &tempStr)) {
04588         return qfalse;
04589       }
04590     
04591       uiInfo.characterList[uiInfo.characterCount].headImage = -1;
04592             uiInfo.characterList[uiInfo.characterCount].imageName = String_Alloc(va("models/players/heads/%s/icon_default.tga", uiInfo.characterList[uiInfo.characterCount].name));
04593 
04594       if (tempStr && (!Q_stricmp(tempStr, "female"))) {
04595         uiInfo.characterList[uiInfo.characterCount].base = String_Alloc(va("Janet"));
04596       } else if (tempStr && (!Q_stricmp(tempStr, "male"))) {
04597         uiInfo.characterList[uiInfo.characterCount].base = String_Alloc(va("James"));
04598       } else {
04599         uiInfo.characterList[uiInfo.characterCount].base = String_Alloc(va("%s",tempStr));
04600       }
04601 
04602       Com_Printf("Loaded %s character %s.\n", uiInfo.characterList[uiInfo.characterCount].base, uiInfo.characterList[uiInfo.characterCount].name);
04603       if (uiInfo.characterCount < MAX_HEADS) {
04604         uiInfo.characterCount++;
04605       } else {
04606         Com_Printf("Too many characters, last character replaced!\n");
04607       }
04608      
04609       token = COM_ParseExt(p, qtrue);
04610       if (token[0] != '}') {
04611         return qfalse;
04612       }
04613     }
04614   }
04615 
04616   return qfalse;
04617 }

Here is the call graph for this function:

void Font_Report  ) 
 

Definition at line 848 of file ui_main.c.

References displayContextDef_t::Assets, Com_Printf(), glyphInfo_t::glyph, fontInfo_t::glyphs, i, cachedAssets_t::textFont, uiInfo_t::uiDC, and uiInfo.

00848                    {
00849   int i;
00850   Com_Printf("Font Info\n");
00851   Com_Printf("=========\n");
00852   for ( i = 32; i < 96; i++) {
00853     Com_Printf("Glyph handle %i: %i\n", i, uiInfo.uiDC.Assets.textFont.glyphs[i].glyph);
00854   }
00855 }

Here is the call graph for this function:

qboolean GameType_Parse char **  p,
qboolean  join
[static]
 

Definition at line 4714 of file ui_main.c.

References COM_ParseExt(), Com_Printf(), uiInfo_t::gameTypes, Int_Parse(), uiInfo_t::joinGameTypes, uiInfo_t::numGameTypes, uiInfo_t::numJoinGameTypes, p, Q_stricmp(), qboolean, qtrue, String_Parse(), token, and uiInfo.

Referenced by UI_ParseGameInfo().

04714                                                         {
04715     char *token;
04716 
04717     token = COM_ParseExt(p, qtrue);
04718 
04719     if (token[0] != '{') {
04720         return qfalse;
04721     }
04722 
04723     if (join) {
04724         uiInfo.numJoinGameTypes = 0;
04725     } else {
04726         uiInfo.numGameTypes = 0;
04727     }
04728 
04729     while ( 1 ) {
04730         token = COM_ParseExt(p, qtrue);
04731 
04732         if (Q_stricmp(token, "}") == 0) {
04733             return qtrue;
04734         }
04735 
04736         if ( !token || token[0] == 0 ) {
04737             return qfalse;
04738         }
04739 
04740         if (token[0] == '{') {
04741             // two tokens per line, character name and sex
04742             if (join) {
04743                 if (!String_Parse(p, &uiInfo.joinGameTypes[uiInfo.numJoinGameTypes].gameType) || !Int_Parse(p, &uiInfo.joinGameTypes[uiInfo.numJoinGameTypes].gtEnum)) {
04744                     return qfalse;
04745                 }
04746             } else {
04747                 if (!String_Parse(p, &uiInfo.gameTypes[uiInfo.numGameTypes].gameType) || !Int_Parse(p, &uiInfo.gameTypes[uiInfo.numGameTypes].gtEnum)) {
04748                     return qfalse;
04749                 }
04750             }
04751     
04752             if (join) {
04753                 if (uiInfo.numJoinGameTypes < MAX_GAMETYPES) {
04754                     uiInfo.numJoinGameTypes++;
04755                 } else {
04756                     Com_Printf("Too many net game types, last one replace!\n");
04757                 }       
04758             } else {
04759                 if (uiInfo.numGameTypes < MAX_GAMETYPES) {
04760                     uiInfo.numGameTypes++;
04761                 } else {
04762                     Com_Printf("Too many game types, last one replace!\n");
04763                 }       
04764             }
04765      
04766             token = COM_ParseExt(p, qtrue);
04767             if (token[0] != '}') {
04768                 return qfalse;
04769             }
04770         }
04771     }
04772     return qfalse;
04773 }

Here is the call graph for this function:

char* GetMenuBuffer const char *  filename  ) 
 

Definition at line 673 of file ui_main.c.

References f, fileHandle_t, FS_READ, MAX_MENUFILE, S_COLOR_RED, trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), trap_Print(), and va().

Referenced by UI_ParseGameInfo(), and UI_ParseTeamInfo().

00673                                           {
00674     int len;
00675     fileHandle_t    f;
00676     static char buf[MAX_MENUFILE];
00677 
00678     len = trap_FS_FOpenFile( filename, &f, FS_READ );
00679     if ( !f ) {
00680         trap_Print( va( S_COLOR_RED "menu file not found: %s, using default\n", filename ) );
00681         return defaultMenu;
00682     }
00683     if ( len >= MAX_MENUFILE ) {
00684         trap_Print( va( S_COLOR_RED "menu file too large: %s is %i, max allowed is %i", filename, len, MAX_MENUFILE ) );
00685         trap_FS_FCloseFile( f );
00686         return defaultMenu;
00687     }
00688 
00689     trap_FS_Read( buf, len, f );
00690     buf[len] = 0;
00691     trap_FS_FCloseFile( f );
00692     //COM_Compress(buf);
00693   return buf;
00694 
00695 }

Here is the call graph for this function:

qboolean Load_Menu int  handle  ) 
 

Definition at line 910 of file ui_main.c.

References pc_token_t, qboolean, pc_token_s::string, token, trap_PC_ReadToken(), and UI_ParseMenu().

Referenced by UI_LoadMenus().

00910                                {
00911     pc_token_t token;
00912 
00913     if (!trap_PC_ReadToken(handle, &token))
00914         return qfalse;
00915     if (token.string[0] != '{') {
00916         return qfalse;
00917     }
00918 
00919     while ( 1 ) {
00920 
00921         if (!trap_PC_ReadToken(handle, &token))
00922             return qfalse;
00923     
00924         if ( token.string[0] == 0 ) {
00925             return qfalse;
00926         }
00927 
00928         if ( token.string[0] == '}' ) {
00929             return qtrue;
00930         }
00931 
00932         UI_ParseMenu(token.string); 
00933     }
00934     return qfalse;
00935 }

Here is the call graph for this function:

qboolean MapList_Parse char **  p  )  [static]
 

Definition at line 4775 of file ui_main.c.

References mapInfo::cinematic, COM_ParseExt(), Com_Printf(), Int_Parse(), mapInfo::levelShot, uiInfo_t::mapCount, uiInfo_t::mapList, p, Q_stricmp(), qboolean, qtrue, String_Parse(), token, trap_R_RegisterShaderNoMip(), mapInfo::typeBits, uiInfo, and va().

Referenced by UI_ParseGameInfo().

04775                                         {
04776     char *token;
04777 
04778     token = COM_ParseExt(p, qtrue);
04779 
04780     if (token[0] != '{') {
04781         return qfalse;
04782     }
04783 
04784     uiInfo.mapCount = 0;
04785 
04786     while ( 1 ) {
04787         token = COM_ParseExt(p, qtrue);
04788 
04789         if (Q_stricmp(token, "}") == 0) {
04790             return qtrue;
04791         }
04792 
04793         if ( !token || token[0] == 0 ) {
04794             return qfalse;
04795         }
04796 
04797         if (token[0] == '{') {
04798             if (!String_Parse(p, &uiInfo.mapList[uiInfo.mapCount].mapName) || !String_Parse(p, &uiInfo.mapList[uiInfo.mapCount].mapLoadName) 
04799                 ||!Int_Parse(p, &uiInfo.mapList[uiInfo.mapCount].teamMembers) ) {
04800                 return qfalse;
04801             }
04802 
04803             if (!String_Parse(p, &uiInfo.mapList[uiInfo.mapCount].opponentName)) {
04804                 return qfalse;
04805             }
04806 
04807             uiInfo.mapList[uiInfo.mapCount].typeBits = 0;
04808 
04809             while (1) {
04810                 token = COM_ParseExt(p, qtrue);
04811                 if (token[0] >= '0' && token[0] <= '9') {
04812                     uiInfo.mapList[uiInfo.mapCount].typeBits |= (1 << (token[0] - 0x030));
04813                     if (!Int_Parse(p, &uiInfo.mapList[uiInfo.mapCount].timeToBeat[token[0] - 0x30])) {
04814                         return qfalse;
04815                     }
04816                 } else {
04817                     break;
04818                 } 
04819             }
04820 
04821             //mapList[mapCount].imageName = String_Alloc(va("levelshots/%s", mapList[mapCount].mapLoadName));
04822             //if (uiInfo.mapCount == 0) {
04823               // only load the first cinematic, selection loads the others
04824             //  uiInfo.mapList[uiInfo.mapCount].cinematic = trap_CIN_PlayCinematic(va("%s.roq",uiInfo.mapList[uiInfo.mapCount].mapLoadName), qfalse, qfalse, qtrue, 0, 0, 0, 0);
04825             //}
04826         uiInfo.mapList[uiInfo.mapCount].cinematic = -1;
04827             uiInfo.mapList[uiInfo.mapCount].levelShot = trap_R_RegisterShaderNoMip(va("levelshots/%s_small", uiInfo.mapList[uiInfo.mapCount].mapLoadName));
04828 
04829             if (uiInfo.mapCount < MAX_MAPS) {
04830                 uiInfo.mapCount++;
04831             } else {
04832                 Com_Printf("Too many maps, last one replaced!\n");
04833             }
04834         }
04835     }
04836     return qfalse;
04837 }

Here is the call graph for this function:

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

char* stristr char *  str,
char *  charset
[static]
 

Definition at line 4003 of file ui_main.c.

References i, and toupper().

Referenced by BotAddressedToBot(), FindClientByName(), FindEnemyByName(), and UI_BuildFindPlayerList().

04003                                                {
04004     int i;
04005 
04006     while(*str) {
04007         for (i = 0; charset[i] && str[i]; i++) {
04008             if (toupper(charset[i]) != toupper(str[i])) break;
04009         }
04010         if (!charset[i]) return str;
04011         str++;
04012     }
04013     return NULL;
04014 }

Here is the call graph for this function:

qboolean Team_Parse char **  p  )  [static]
 

Definition at line 4503 of file ui_main.c.

References teamInfo::cinematic, COM_ParseExt(), Com_Printf(), i, teamInfo::imageName, p, Q_stricmp(), qboolean, qtrue, String_Parse(), uiInfo_t::teamCount, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, teamInfo::teamMembers, token, trap_R_RegisterShaderNoMip(), uiInfo, and va().

Referenced by UI_ParseTeamInfo().

04503                                      {
04504   char *token;
04505   const char *tempStr;
04506     int i;
04507 
04508   token = COM_ParseExt(p, qtrue);
04509 
04510   if (token[0] != '{') {
04511     return qfalse;
04512   }
04513 
04514   while ( 1 ) {
04515 
04516     token = COM_ParseExt(p, qtrue);
04517     
04518     if (Q_stricmp(token, "}") == 0) {
04519       return qtrue;
04520     }
04521 
04522     if ( !token || token[0] == 0 ) {
04523       return qfalse;
04524     }
04525 
04526     if (token[0] == '{') {
04527       // seven tokens per line, team name and icon, and 5 team member names
04528       if (!String_Parse(p, &uiInfo.teamList[uiInfo.teamCount].teamName) || !String_Parse(p, &tempStr)) {
04529         return qfalse;
04530       }
04531     
04532 
04533             uiInfo.teamList[uiInfo.teamCount].imageName = tempStr;
04534         uiInfo.teamList[uiInfo.teamCount].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[uiInfo.teamCount].imageName);
04535           uiInfo.teamList[uiInfo.teamCount].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[uiInfo.teamCount].imageName));
04536             uiInfo.teamList[uiInfo.teamCount].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[uiInfo.teamCount].imageName));
04537 
04538             uiInfo.teamList[uiInfo.teamCount].cinematic = -1;
04539 
04540             for (i = 0; i < TEAM_MEMBERS; i++) {
04541                 uiInfo.teamList[uiInfo.teamCount].teamMembers[i] = NULL;
04542                 if (!String_Parse(p, &uiInfo.teamList[uiInfo.teamCount].teamMembers[i])) {
04543                     return qfalse;
04544                 }
04545             }
04546 
04547       Com_Printf("Loaded team %s with team icon %s.\n", uiInfo.teamList[uiInfo.teamCount].teamName, tempStr);
04548       if (uiInfo.teamCount < MAX_TEAMS) {
04549         uiInfo.teamCount++;
04550       } else {
04551         Com_Printf("Too many teams, last team replaced!\n");
04552       }
04553       token = COM_ParseExt(p, qtrue);
04554       if (token[0] != '}') {
04555         return qfalse;
04556       }
04557     }
04558   }
04559 
04560   return qfalse;
04561 }

Here is the call graph for this function:

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

Definition at line 311 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::bigFont, count, fontInfo_t::glyphs, fontInfo_t::glyphScale, glyphInfo_t::height, limit, max, Q_IsColorString, s, cachedAssets_t::smallFont, strlen(), cachedAssets_t::textFont, ui_bigFont, ui_smallFont, uiInfo_t::uiDC, uiInfo, and vmCvar_t::value.

00311                                                           {
00312   int len, count;
00313     float max;
00314     glyphInfo_t *glyph;
00315     float useScale;
00316     const char *s = text; // bk001206 - unsigned
00317     fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
00318     if (scale <= ui_smallFont.value) {
00319         font = &uiInfo.uiDC.Assets.smallFont;
00320     } else if (scale >= ui_bigFont.value) {
00321         font = &uiInfo.uiDC.Assets.bigFont;
00322     }
00323     useScale = scale * font->glyphScale;
00324   max = 0;
00325   if (text) {
00326     len = strlen(text);
00327         if (limit > 0 && len > limit) {
00328             len = limit;
00329         }
00330         count = 0;
00331         while (s && *s && count < len) {
00332             if ( Q_IsColorString(s) ) {
00333                 s += 2;
00334                 continue;
00335             } else {
00336                 glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
00337           if (max < glyph->height) {
00338               max = glyph->height;
00339               }
00340                 s++;
00341                 count++;
00342             }
00343     }
00344   }
00345   return max * useScale;
00346 }

Here is the call graph for this function:

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

Definition at line 356 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::bigFont, colorBlack, ColorIndex, count, g_color_table, glyphInfo_t::glyph, fontInfo_t::glyphs, fontInfo_t::glyphScale, glyphInfo_t::imageHeight, glyphInfo_t::imageWidth, ITEM_TEXTSTYLE_SHADOWED, limit, memcpy(), NULL, Q_IsColorString, glyphInfo_t::s, s, glyphInfo_t::s2, cachedAssets_t::smallFont, strlen(), glyphInfo_t::t, glyphInfo_t::t2, Text_PaintChar(), cachedAssets_t::textFont, glyphInfo_t::top, trap_R_SetColor(), ui_bigFont, ui_smallFont, uiInfo_t::uiDC, uiInfo, vmCvar_t::value, x, glyphInfo_t::xSkip, and y.

Referenced by Text_PaintCenter(), UI_DrawAllMapsSelection(), UI_DrawBotName(), UI_DrawBotSkill(), UI_DrawClanName(), UI_DrawGameType(), UI_DrawGLInfo(), UI_DrawHandicap(), UI_DrawJoinGameType(), UI_DrawKeyBindStatus(), UI_DrawMapTimeToBeat(), UI_DrawNetFilter(), UI_DrawNetGameType(), UI_DrawNetSource(), UI_DrawOpponentName(), UI_DrawRedBlue(), UI_DrawSelectedPlayer(), UI_DrawServerRefreshDate(), UI_DrawSkill(), UI_DrawTeamMember(), UI_DrawTeamName(), UI_DrawTier(), UI_DrawTierGameType(), and UI_DrawTierMapName().

00356                                                                                                                    {
00357   int len, count;
00358     vec4_t newColor;
00359     glyphInfo_t *glyph;
00360     float useScale;
00361     fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
00362     if (scale <= ui_smallFont.value) {
00363         font = &uiInfo.uiDC.Assets.smallFont;
00364     } else if (scale >= ui_bigFont.value) {
00365         font = &uiInfo.uiDC.Assets.bigFont;
00366     }
00367     useScale = scale * font->glyphScale;
00368   if (text) {
00369     const char *s = text; // bk001206 - unsigned
00370         trap_R_SetColor( color );
00371         memcpy(&newColor[0], &color[0], sizeof(vec4_t));
00372     len = strlen(text);
00373         if (limit > 0 && len > limit) {
00374             len = limit;
00375         }
00376         count = 0;
00377         while (s && *s && count < len) {
00378             glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
00379       //int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top;
00380       //float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height);
00381             if ( Q_IsColorString( s ) ) {
00382                 memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) );
00383                 newColor[3] = color[3];
00384                 trap_R_SetColor( newColor );
00385                 s += 2;
00386                 continue;
00387             } else {
00388                 float yadj = useScale * glyph->top;
00389                 if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) {
00390                     int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2;
00391                     colorBlack[3] = newColor[3];
00392                     trap_R_SetColor( colorBlack );
00393                     Text_PaintChar(x + ofs, y - yadj + ofs, 
00394                                                         glyph->imageWidth,
00395                                                         glyph->imageHeight,
00396                                                         useScale, 
00397                                                         glyph->s,
00398                                                         glyph->t,
00399                                                         glyph->s2,
00400                                                         glyph->t2,
00401                                                         glyph->glyph);
00402                     trap_R_SetColor( newColor );
00403                     colorBlack[3] = 1.0;
00404                 }
00405                 Text_PaintChar(x, y - yadj, 
00406                                                     glyph->imageWidth,
00407                                                     glyph->imageHeight,
00408                                                     useScale, 
00409                                                     glyph->s,
00410                                                     glyph->t,
00411                                                     glyph->s2,
00412                                                     glyph->t2,
00413                                                     glyph->glyph);
00414 
00415                 x += (glyph->xSkip * useScale) + adjust;
00416                 s++;
00417                 count++;
00418             }
00419     }
00420       trap_R_SetColor( NULL );
00421   }
00422 }

Here is the call graph for this function:

void Text_Paint_Limit float *  maxX,
float  x,
float  y,
float  scale,
vec4_t  color,
const char *  text,
float  adjust,
int  limit
[static]
 

Definition at line 523 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::bigFont, ColorIndex, count, g_color_table, glyphInfo_t::glyph, fontInfo_t::glyphs, fontInfo_t::glyphScale, glyphInfo_t::imageHeight, glyphInfo_t::imageWidth, limit, max, memcpy(), NULL, Q_IsColorString, glyphInfo_t::s, s, glyphInfo_t::s2, cachedAssets_t::smallFont, strlen(), glyphInfo_t::t, glyphInfo_t::t2, Text_PaintChar(), Text_Width(), cachedAssets_t::textFont, glyphInfo_t::top, trap_R_SetColor(), ui_bigFont, ui_smallFont, uiInfo_t::uiDC, uiInfo, vmCvar_t::value, x, glyphInfo_t::xSkip, and y.

Referenced by UI_DrawServerMOTD().

00523                                                                                                                                   {
00524   int len, count;
00525     vec4_t newColor;
00526     glyphInfo_t *glyph;
00527   if (text) {
00528     const char *s = text; // bk001206 - unsigned
00529         float max = *maxX;
00530         float useScale;
00531         fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
00532         if (scale <= ui_smallFont.value) {
00533             font = &uiInfo.uiDC.Assets.smallFont;
00534         } else if (scale > ui_bigFont.value) {
00535             font = &uiInfo.uiDC.Assets.bigFont;
00536         }
00537         useScale = scale * font->glyphScale;
00538         trap_R_SetColor( color );
00539     len = strlen(text);                  
00540         if (limit > 0 && len > limit) {
00541             len = limit;
00542         }
00543         count = 0;
00544         while (s && *s && count < len) {
00545             glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
00546             if ( Q_IsColorString( s ) ) {
00547                 memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) );
00548                 newColor[3] = color[3];
00549                 trap_R_SetColor( newColor );
00550                 s += 2;
00551                 continue;
00552             } else {
00553           float yadj = useScale * glyph->top;
00554                 if (Text_Width(s, useScale, 1) + x > max) {
00555                     *maxX = 0;
00556                     break;
00557                 }
00558             Text_PaintChar(x, y - yadj, 
00559                              glyph->imageWidth,
00560                                glyph->imageHeight,
00561                                useScale, 
00562                                    glyph->s,
00563                                        glyph->t,
00564                                        glyph->s2,
00565                                          glyph->t2,
00566                                            glyph->glyph);
00567           x += (glyph->xSkip * useScale) + adjust;
00568                 *maxX = x;
00569                 count++;
00570                 s++;
00571         }
00572         }
00573       trap_R_SetColor( NULL );
00574   }
00575 
00576 }

Here is the call graph for this function:

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

Definition at line 5345 of file ui_main.c.

References ITEM_TEXTSTYLE_SHADOWEDMORE, Text_Paint(), Text_Width(), x, and y.

Referenced by Text_PaintCenter_AutoWrapped(), UI_DisplayDownloadInfo(), and UI_DrawConnectScreen().

05345                                                                                                    {
05346     int len = Text_Width(text, scale, 0);
05347     Text_Paint(x - len / 2, y, scale, color, text, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE);
05348 }

Here is the call graph for this function:

void Text_PaintCenter_AutoWrapped float  x,
float  y,
float  xmax,
float  ystep,
float  scale,
vec4_t  color,
const char *  str,
float  adjust
 

Definition at line 5350 of file ui_main.c.

References Q_strncpyz(), Text_PaintCenter(), Text_Width(), width, x, and y.

Referenced by UI_DrawConnectScreen().

05350                                                                                                                                        {
05351     int width;
05352     char *s1,*s2,*s3;
05353     char c_bcp;
05354     char buf[1024];
05355 
05356     if (!str || str[0]=='\0')
05357         return;
05358 
05359     Q_strncpyz(buf, str, sizeof(buf));
05360     s1 = s2 = s3 = buf;
05361 
05362     while (1) {
05363         do {
05364             s3++;
05365         } while (*s3!=' ' && *s3!='\0');
05366         c_bcp = *s3;
05367         *s3 = '\0';
05368         width = Text_Width(s1, scale, 0);
05369         *s3 = c_bcp;
05370         if (width > xmax) {
05371             if (s1==s2)
05372             {
05373                 // fuck, don't have a clean cut, we'll overflow
05374                 s2 = s3;
05375             }
05376             *s2 = '\0';
05377             Text_PaintCenter(x, y, scale, color, s1, adjust);
05378             y += ystep;
05379             if (c_bcp == '\0')
05380       {
05381                 // that was the last word
05382         // we could start a new loop, but that wouldn't be much use
05383         // even if the word is too long, we would overflow it (see above)
05384         // so just print it now if needed
05385         s2++;
05386         if (*s2 != '\0') // if we are printing an overflowing line we have s2 == s3
05387           Text_PaintCenter(x, y, scale, color, s2, adjust);
05388         break;
05389       }
05390             s2++;
05391             s1 = s2;
05392             s3 = s2;
05393         }
05394         else
05395         {
05396             s2 = s3;
05397             if (c_bcp == '\0') // we reached the end
05398             {
05399                 Text_PaintCenter(x, y, scale, color, s1, adjust);
05400                 break;
05401             }
05402         }
05403     }
05404 }

Here is the call graph for this function:

void Text_PaintChar float  x,
float  y,
float  width,
float  height,
float  scale,
float  s,
float  t,
float  s2,
float  t2,
qhandle_t  hShader
 

Definition at line 348 of file ui_main.c.

References h(), height, s, t, trap_R_DrawStretchPic(), UI_AdjustFrom640(), w, width, x, and y.

Referenced by Text_Paint(), Text_Paint_Limit(), and Text_PaintWithCursor().

00348                                                                                                                                        {
00349   float w, h;
00350   w = width * scale;
00351   h = height * scale;
00352   UI_AdjustFrom640( &x, &y, &w, &h );
00353   trap_R_DrawStretchPic( x, y, w, h, s, t, s2, t2, hShader );
00354 }

Here is the call graph for this function:

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

Definition at line 424 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::bigFont, colorBlack, ColorIndex, count, g_color_table, glyphInfo_t::glyph, fontInfo_t::glyphs, fontInfo_t::glyphScale, glyphInfo_t::imageHeight, glyphInfo_t::imageWidth, ITEM_TEXTSTYLE_SHADOWED, limit, memcpy(), NULL, Q_IsColorString, displayContextDef_t::realTime, glyphInfo_t::s, s, glyphInfo_t::s2, cachedAssets_t::smallFont, strlen(), glyphInfo_t::t, glyphInfo_t::t2, Text_PaintChar(), cachedAssets_t::textFont, glyphInfo_t::top, trap_R_SetColor(), ui_bigFont, ui_smallFont, uiInfo_t::uiDC, uiInfo, vmCvar_t::value, x, glyphInfo_t::xSkip, and y.

00424                                                                                                                                            {
00425   int len, count;
00426     vec4_t newColor;
00427     glyphInfo_t *glyph, *glyph2;
00428     float yadj;
00429     float useScale;
00430     fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
00431     if (scale <= ui_smallFont.value) {
00432         font = &uiInfo.uiDC.Assets.smallFont;
00433     } else if (scale >= ui_bigFont.value) {
00434         font = &uiInfo.uiDC.Assets.bigFont;
00435     }
00436     useScale = scale * font->glyphScale;
00437   if (text) {
00438     const char *s = text; // bk001206 - unsigned
00439         trap_R_SetColor( color );
00440         memcpy(&newColor[0], &color[0], sizeof(vec4_t));
00441     len = strlen(text);
00442         if (limit > 0 && len > limit) {
00443             len = limit;
00444         }
00445         count = 0;
00446         glyph2 = &font->glyphs[ (int) cursor]; // bk001206 - possible signed char
00447         while (s && *s && count < len) {
00448             glyph = &font->glyphs[(int)*s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
00449       //int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top;
00450       //float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height);
00451             if ( Q_IsColorString( s ) ) {
00452                 memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) );
00453                 newColor[3] = color[3];
00454                 trap_R_SetColor( newColor );
00455                 s += 2;
00456                 continue;
00457             } else {
00458                 yadj = useScale * glyph->top;
00459                 if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) {
00460                     int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2;
00461                     colorBlack[3] = newColor[3];
00462                     trap_R_SetColor( colorBlack );
00463                     Text_PaintChar(x + ofs, y - yadj + ofs, 
00464                                                         glyph->imageWidth,
00465                                                         glyph->imageHeight,
00466                                                         useScale, 
00467                                                         glyph->s,
00468                                                         glyph->t,
00469                                                         glyph->s2,
00470                                                         glyph->t2,
00471                                                         glyph->glyph);
00472                     colorBlack[3] = 1.0;
00473                     trap_R_SetColor( newColor );
00474                 }
00475                 Text_PaintChar(x, y - yadj, 
00476                                                     glyph->imageWidth,
00477                                                     glyph->imageHeight,
00478                                                     useScale, 
00479                                                     glyph->s,
00480                                                     glyph->t,
00481                                                     glyph->s2,
00482                                                     glyph->t2,
00483                                                     glyph->glyph);
00484 
00485           yadj = useScale * glyph2->top;
00486             if (count == cursorPos && !((uiInfo.uiDC.realTime/BLINK_DIVISOR) & 1)) {
00487                     Text_PaintChar(x, y - yadj, 
00488                                                         glyph2->imageWidth,
00489                                                         glyph2->imageHeight,
00490                                                         useScale, 
00491                                                         glyph2->s,
00492                                                         glyph2->t,
00493                                                         glyph2->s2,
00494                                                         glyph2->t2,
00495                                                         glyph2->glyph);
00496                 }
00497 
00498                 x += (glyph->xSkip * useScale);
00499                 s++;
00500                 count++;
00501             }
00502     }
00503     // need to paint cursor at end of text
00504     if (cursorPos == len && !((uiInfo.uiDC.realTime/BLINK_DIVISOR) & 1)) {
00505         yadj = useScale * glyph2->top;
00506         Text_PaintChar(x, y - yadj, 
00507                           glyph2->imageWidth,
00508                           glyph2->imageHeight,
00509                           useScale, 
00510                           glyph2->s,
00511                           glyph2->t,
00512                           glyph2->s2,
00513                           glyph2->t2,
00514                           glyph2->glyph);
00515 
00516     }
00517 
00518       trap_R_SetColor( NULL );
00519   }
00520 }

Here is the call graph for this function:

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

Definition at line 276 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::bigFont, count, fontInfo_t::glyphs, fontInfo_t::glyphScale, limit, Q_IsColorString, s, cachedAssets_t::smallFont, strlen(), cachedAssets_t::textFont, ui_bigFont, ui_smallFont, uiInfo_t::uiDC, uiInfo, vmCvar_t::value, and glyphInfo_t::xSkip.

Referenced by Text_Paint_Limit(), Text_PaintCenter(), Text_PaintCenter_AutoWrapped(), UI_DrawServerMOTD(), and UI_OwnerDrawWidth().

00276                                                          {
00277   int count,len;
00278     float out;
00279     glyphInfo_t *glyph;
00280     float useScale;
00281     const char *s = text;
00282     fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
00283     if (scale <= ui_smallFont.value) {
00284         font = &uiInfo.uiDC.Assets.smallFont;
00285     } else if (scale >= ui_bigFont.value) {
00286         font = &uiInfo.uiDC.Assets.bigFont;
00287     }
00288     useScale = scale * font->glyphScale;
00289   out = 0;
00290   if (text) {
00291     len = strlen(text);
00292         if (limit > 0 && len > limit) {
00293             len = limit;
00294         }
00295         count = 0;
00296         while (s && *s && count < len) {
00297             if ( Q_IsColorString(s) ) {
00298                 s += 2;
00299                 continue;
00300             } else {
00301                 glyph = &font->glyphs[(int)*s];
00302                 out += glyph->xSkip;
00303                 s++;
00304                 count++;
00305             }
00306     }
00307   }
00308   return out * useScale;
00309 }

Here is the call graph for this function:

const char* UI_AIFromName const char *  name  )  [static]
 

Definition at line 1423 of file ui_main.c.

References aliasInfo::ai, uiInfo_t::aliasCount, uiInfo_t::aliasList, j, name, aliasInfo::name, Q_stricmp(), and uiInfo.

Referenced by UI_OpponentLeaderHead(), and UI_StartSkirmish().

01423                                                    {
01424     int j;
01425     for (j = 0; j < uiInfo.aliasCount; j++) {
01426         if (Q_stricmp(uiInfo.aliasList[j].name, name) == 0) {
01427             return uiInfo.aliasList[j].ai;
01428         }
01429     }
01430     return "James";
01431 }

Here is the call graph for this function:

const int UI_AIIndex const char *  name  )  [static]
 

Definition at line 1434 of file ui_main.c.

References uiInfo_t::characterCount, uiInfo_t::characterList, j, characterInfo::name, name, Q_stricmp(), and uiInfo.

Referenced by UI_AIIndexFromName().

01434                                               {
01435     int j;
01436     for (j = 0; j < uiInfo.characterCount; j++) {
01437         if (Q_stricmp(name, uiInfo.characterList[j].name) == 0) {
01438             return j;
01439         }
01440     }
01441     return 0;
01442 }

Here is the call graph for this function:

const int UI_AIIndexFromName const char *  name  )  [static]
 

Definition at line 1446 of file ui_main.c.

References aliasInfo::ai, uiInfo_t::aliasCount, uiInfo_t::aliasList, j, name, aliasInfo::name, Q_stricmp(), UI_AIIndex(), and uiInfo.

01446                                                       {
01447     int j;
01448     for (j = 0; j < uiInfo.aliasCount; j++) {
01449         if (Q_stricmp(uiInfo.aliasList[j].name, name) == 0) {
01450             return UI_AIIndex(uiInfo.aliasList[j].ai);
01451         }
01452     }
01453     return 0;
01454 }

Here is the call graph for this function:

void UI_BinaryServerInsertion int  num  )  [static]
 

Definition at line 3692 of file ui_main.c.

References serverStatus_s::displayServers, vmCvar_t::integer, serverStatus_s::numDisplayServers, offset, uiInfo_t::serverStatus, serverStatus_s::sortDir, serverStatus_s::sortKey, trap_LAN_CompareServers(), UI_InsertServerIntoDisplayList(), ui_netSource, and uiInfo.

Referenced by UI_BuildServerDisplayList().

03692                                               {
03693     int mid, offset, res, len;
03694 
03695     // use binary search to insert server
03696     len = uiInfo.serverStatus.numDisplayServers;
03697     mid = len;
03698     offset = 0;
03699     res = 0;
03700     while(mid > 0) {
03701         mid = len >> 1;
03702         //
03703         res = trap_LAN_CompareServers( ui_netSource.integer, uiInfo.serverStatus.sortKey,
03704                     uiInfo.serverStatus.sortDir, num, uiInfo.serverStatus.displayServers[offset+mid]);
03705         // if equal
03706         if (res == 0) {
03707             UI_InsertServerIntoDisplayList(num, offset+mid);
03708             return;
03709         }
03710         // if larger
03711         else if (res == 1) {
03712             offset += mid;
03713             len -= mid;
03714         }
03715         // if smaller
03716         else {
03717             len -= mid;
03718         }
03719     }
03720     if (res == 1) {
03721         offset++;
03722     }
03723     UI_InsertServerIntoDisplayList(num, offset);
03724 }

Here is the call graph for this function:

qboolean UI_BotName_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2556 of file ui_main.c.

References uiInfo_t::botIndex, uiInfo_t::characterCount, K_ENTER, K_MOUSE1, K_MOUSE2, qboolean, trap_Cvar_VariableValue(), UI_GetNumBots(), uiInfo, and value.

Referenced by UI_OwnerDrawHandleKey().

02556                                                                          {
02557   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02558         int game = trap_Cvar_VariableValue("g_gametype");
02559         int value = uiInfo.botIndex;
02560 
02561         if (key == K_MOUSE2) {
02562             value--;
02563         } else {
02564             value++;
02565         }
02566 
02567         if (game >= GT_TEAM) {
02568             if (value >= uiInfo.characterCount + 2) {
02569                 value = 0;
02570             } else if (value < 0) {
02571                 value = uiInfo.characterCount + 2 - 1;
02572             }
02573         } else {
02574             if (value >= UI_GetNumBots() + 2) {
02575                 value = 0;
02576             } else if (value < 0) {
02577                 value = UI_GetNumBots() + 2 - 1;
02578             }
02579         }
02580         uiInfo.botIndex = value;
02581     return qtrue;
02582   }
02583   return qfalse;
02584 }

Here is the call graph for this function:

qboolean UI_BotSkill_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2586 of file ui_main.c.

References K_ENTER, K_MOUSE1, K_MOUSE2, numSkillLevels, qboolean, uiInfo_t::skillIndex, and uiInfo.

Referenced by UI_OwnerDrawHandleKey().

02586                                                                           {
02587   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02588         if (key == K_MOUSE2) {
02589             uiInfo.skillIndex--;
02590         } else {
02591             uiInfo.skillIndex++;
02592         }
02593         if (uiInfo.skillIndex >= numSkillLevels) {
02594             uiInfo.skillIndex = 0;
02595         } else if (uiInfo.skillIndex < 0) {
02596             uiInfo.skillIndex = numSkillLevels-1;
02597         }
02598     return qtrue;
02599   }
02600     return qfalse;
02601 }

void UI_BuildFindPlayerList qboolean  force  )  [static]
 

Definition at line 4021 of file ui_main.c.

References pendingServer_t::adrstr, Com_sprintf(), uiInfo_t::currentFoundPlayerServer, serverStatus_s::displayServers, FEEDER_FINDPLAYER, uiInfo_t::findPlayerName, uiInfo_t::foundPlayerServerAddresses, uiInfo_t::foundPlayerServerNames, i, Info_ValueForKey(), vmCvar_t::integer, j, serverStatusInfo_t::lines, MAX_FOUNDPLAYER_SERVERS, MAX_NAME_LENGTH, memset(), pendingServer_t::name, name, uiInfo_t::nextFindPlayerRefresh, NULL, pendingServerStatus_t::num, serverStatus_s::numDisplayServers, uiInfo_t::numFoundPlayerServers, serverStatusInfo_t::numLines, uiInfo_t::pendingServerStatus, Q_CleanStr(), Q_strncpyz(), displayContextDef_t::realTime, pendingServerStatus_t::server, uiInfo_t::serverStatus, pendingServer_t::startTime, stristr(), strlen(), trap_Cvar_Set(), trap_Cvar_VariableStringBuffer(), trap_LAN_GetServerAddressString(), trap_LAN_GetServerInfo(), trap_LAN_ServerStatus(), UI_FeederSelection(), UI_GetServerStatusInfo(), ui_netSource, ui_serverStatusTimeOut, uiInfo_t::uiDC, uiInfo, va(), and pendingServer_t::valid.

Referenced by _UI_Refresh(), and UI_RunMenuScript().

04021                                                    {
04022     static int numFound, numTimeOuts;
04023     int i, j, resend;
04024     serverStatusInfo_t info;
04025     char name[MAX_NAME_LENGTH+2];
04026     char infoString[MAX_STRING_CHARS];
04027 
04028     if (!force) {
04029         if (!uiInfo.nextFindPlayerRefresh || uiInfo.nextFindPlayerRefresh > uiInfo.uiDC.realTime) {
04030             return;
04031         }
04032     }
04033     else {
04034         memset(&uiInfo.pendingServerStatus, 0, sizeof(uiInfo.pendingServerStatus));
04035         uiInfo.numFoundPlayerServers = 0;
04036         uiInfo.currentFoundPlayerServer = 0;
04037         trap_Cvar_VariableStringBuffer( "ui_findPlayer", uiInfo.findPlayerName, sizeof(uiInfo.findPlayerName));
04038         Q_CleanStr(uiInfo.findPlayerName);
04039         // should have a string of some length
04040         if (!strlen(uiInfo.findPlayerName)) {
04041             uiInfo.nextFindPlayerRefresh = 0;
04042             return;
04043         }
04044         // set resend time
04045         resend = ui_serverStatusTimeOut.integer / 2 - 10;
04046         if (resend < 50) {
04047             resend = 50;
04048         }
04049         trap_Cvar_Set("cl_serverStatusResendTime", va("%d", resend));
04050         // reset all server status requests
04051         trap_LAN_ServerStatus( NULL, NULL, 0);
04052         //
04053         uiInfo.numFoundPlayerServers = 1;
04054         Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1],
04055                         sizeof(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1]),
04056                             "searching %d...", uiInfo.pendingServerStatus.num);
04057         numFound = 0;
04058         numTimeOuts++;
04059     }
04060     for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
04061         // if this pending server is valid
04062         if (uiInfo.pendingServerStatus.server[i].valid) {
04063             // try to get the server status for this server
04064             if (UI_GetServerStatusInfo( uiInfo.pendingServerStatus.server[i].adrstr, &info ) ) {
04065                 //
04066                 numFound++;
04067                 // parse through the server status lines
04068                 for (j = 0; j < info.numLines; j++) {
04069                     // should have ping info
04070                     if ( !info.lines[j][2] || !info.lines[j][2][0] ) {
04071                         continue;
04072                     }
04073                     // clean string first
04074                     Q_strncpyz(name, info.lines[j][3], sizeof(name));
04075                     Q_CleanStr(name);
04076                     // if the player name is a substring
04077                     if (stristr(name, uiInfo.findPlayerName)) {
04078                         // add to found server list if we have space (always leave space for a line with the number found)
04079                         if (uiInfo.numFoundPlayerServers < MAX_FOUNDPLAYER_SERVERS-1) {
04080                             //
04081                             Q_strncpyz(uiInfo.foundPlayerServerAddresses[uiInfo.numFoundPlayerServers-1],
04082                                         uiInfo.pendingServerStatus.server[i].adrstr,
04083                                             sizeof(uiInfo.foundPlayerServerAddresses[0]));
04084                             Q_strncpyz(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1],
04085                                         uiInfo.pendingServerStatus.server[i].name,
04086                                             sizeof(uiInfo.foundPlayerServerNames[0]));
04087                             uiInfo.numFoundPlayerServers++;
04088                         }
04089                         else {
04090                             // can't add any more so we're done
04091                             uiInfo.pendingServerStatus.num = uiInfo.serverStatus.numDisplayServers;
04092                         }
04093                     }
04094                 }
04095                 Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1],
04096                                 sizeof(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1]),
04097                                     "searching %d/%d...", uiInfo.pendingServerStatus.num, numFound);
04098                 // retrieved the server status so reuse this spot
04099                 uiInfo.pendingServerStatus.server[i].valid = qfalse;
04100             }
04101         }
04102         // if empty pending slot or timed out
04103         if (!uiInfo.pendingServerStatus.server[i].valid ||
04104             uiInfo.pendingServerStatus.server[i].startTime < uiInfo.uiDC.realTime - ui_serverStatusTimeOut.integer) {
04105             if (uiInfo.pendingServerStatus.server[i].valid) {
04106                 numTimeOuts++;
04107             }
04108             // reset server status request for this address
04109             UI_GetServerStatusInfo( uiInfo.pendingServerStatus.server[i].adrstr, NULL );
04110             // reuse pending slot
04111             uiInfo.pendingServerStatus.server[i].valid = qfalse;
04112             // if we didn't try to get the status of all servers in the main browser yet
04113             if (uiInfo.pendingServerStatus.num < uiInfo.serverStatus.numDisplayServers) {
04114                 uiInfo.pendingServerStatus.server[i].startTime = uiInfo.uiDC.realTime;
04115                 trap_LAN_GetServerAddressString(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.pendingServerStatus.num],
04116                             uiInfo.pendingServerStatus.server[i].adrstr, sizeof(uiInfo.pendingServerStatus.server[i].adrstr));
04117                 trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[uiInfo.pendingServerStatus.num], infoString, sizeof(infoString));
04118                 Q_strncpyz(uiInfo.pendingServerStatus.server[i].name, Info_ValueForKey(infoString, "hostname"), sizeof(uiInfo.pendingServerStatus.server[0].name));
04119                 uiInfo.pendingServerStatus.server[i].valid = qtrue;
04120                 uiInfo.pendingServerStatus.num++;
04121                 Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1],
04122                                 sizeof(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1]),
04123                                     "searching %d/%d...", uiInfo.pendingServerStatus.num, numFound);
04124             }
04125         }
04126     }
04127     for (i = 0; i < MAX_SERVERSTATUSREQUESTS; i++) {
04128         if (uiInfo.pendingServerStatus.server[i].valid) {
04129             break;
04130         }
04131     }
04132     // if still trying to retrieve server status info
04133     if (i < MAX_SERVERSTATUSREQUESTS) {
04134         uiInfo.nextFindPlayerRefresh = uiInfo.uiDC.realTime + 25;
04135     }
04136     else {
04137         // add a line that shows the number of servers found
04138         if (!uiInfo.numFoundPlayerServers) {
04139             Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], sizeof(uiInfo.foundPlayerServerAddresses[0]), "no servers found");
04140         }
04141         else {
04142             Com_sprintf(uiInfo.foundPlayerServerNames[uiInfo.numFoundPlayerServers-1], sizeof(uiInfo.foundPlayerServerAddresses[0]),
04143                         "%d server%s found with player %s", uiInfo.numFoundPlayerServers-1,
04144                         uiInfo.numFoundPlayerServers == 2 ? "":"s", uiInfo.findPlayerName);
04145         }
04146         uiInfo.nextFindPlayerRefresh = 0;
04147         // show the server status info for the selected server
04148         UI_FeederSelection(FEEDER_FINDPLAYER, uiInfo.currentFoundPlayerServer);
04149     }
04150 }

Here is the call graph for this function:

void UI_BuildPlayerList  )  [static]
 

Definition at line 1790 of file ui_main.c.

References atoi, uiClientState_t::clientNum, count, CS_PLAYERS, CS_SERVERINFO, Info_ValueForKey(), MAX_INFO_STRING, MAX_NAME_LENGTH, uiInfo_t::myTeamCount, n, uiInfo_t::playerCount, uiInfo_t::playerNames, uiInfo_t::playerNumber, Q_CleanStr(), Q_strncpyz(), uiInfo_t::teamClientNums, uiInfo_t::teamLeader, uiInfo_t::teamNames, trap_Cvar_Set(), trap_Cvar_VariableValue(), trap_GetClientState(), trap_GetConfigString(), uiInfo, and va().

Referenced by _UI_SetActiveMenu(), UI_DrawSelectedPlayer(), UI_FeederCount(), and UI_SelectedPlayer_HandleKey().

01790                                  {
01791     uiClientState_t cs;
01792     int     n, count, team, team2, playerTeamNumber;
01793     char    info[MAX_INFO_STRING];
01794 
01795     trap_GetClientState( &cs );
01796     trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING );
01797     uiInfo.playerNumber = cs.clientNum;
01798     uiInfo.teamLeader = atoi(Info_ValueForKey(info, "tl"));
01799     team = atoi(Info_ValueForKey(info, "t"));
01800     trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
01801     count = atoi( Info_ValueForKey( info, "sv_maxclients" ) );
01802     uiInfo.playerCount = 0;
01803     uiInfo.myTeamCount = 0;
01804     playerTeamNumber = 0;
01805     for( n = 0; n < count; n++ ) {
01806         trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING );
01807 
01808         if (info[0]) {
01809             Q_strncpyz( uiInfo.playerNames[uiInfo.playerCount], Info_ValueForKey( info, "n" ), MAX_NAME_LENGTH );
01810             Q_CleanStr( uiInfo.playerNames[uiInfo.playerCount] );
01811             uiInfo.playerCount++;
01812             team2 = atoi(Info_ValueForKey(info, "t"));
01813             if (team2 == team) {
01814                 Q_strncpyz( uiInfo.teamNames[uiInfo.myTeamCount], Info_ValueForKey( info, "n" ), MAX_NAME_LENGTH );
01815                 Q_CleanStr( uiInfo.teamNames[uiInfo.myTeamCount] );
01816                 uiInfo.teamClientNums[uiInfo.myTeamCount] = n;
01817                 if (uiInfo.playerNumber == n) {
01818                     playerTeamNumber = uiInfo.myTeamCount;
01819                 }
01820                 uiInfo.myTeamCount++;
01821             }
01822         }
01823     }
01824 
01825     if (!uiInfo.teamLeader) {
01826         trap_Cvar_Set("cg_selectedPlayer", va("%d", playerTeamNumber));
01827     }
01828 
01829     n = trap_Cvar_VariableValue("cg_selectedPlayer");
01830     if (n < 0 || n > uiInfo.myTeamCount) {
01831         n = 0;
01832     }
01833     if (n < uiInfo.myTeamCount) {
01834         trap_Cvar_Set("cg_selectedPlayerName", uiInfo.teamNames[n]);
01835     }
01836 }

Here is the call graph for this function:

void UI_BuildQ3Model_List void   )  [static]
 

Definition at line 4955 of file ui_main.c.

References Com_sprintf(), COM_StripExtension(), filelist, i, j, k, uiInfo_t::q3HeadCount, uiInfo_t::q3HeadIcons, uiInfo_t::q3HeadNames, Q_stricmp(), Q_stricmpn(), strcmp(), strlen(), trap_FS_GetFileList(), trap_R_RegisterShaderNoMip(), uiInfo, and va().

Referenced by _UI_Init().

04956 {
04957     int     numdirs;
04958     int     numfiles;
04959     char    dirlist[2048];
04960     char    filelist[2048];
04961     char    skinname[64];
04962     char    scratch[256];
04963     char*   dirptr;
04964     char*   fileptr;
04965     int     i;
04966     int     j, k, dirty;
04967     int     dirlen;
04968     int     filelen;
04969 
04970     uiInfo.q3HeadCount = 0;
04971 
04972     // iterate directory of all player models
04973     numdirs = trap_FS_GetFileList("models/players", "/", dirlist, 2048 );
04974     dirptr  = dirlist;
04975     for (i=0; i<numdirs && uiInfo.q3HeadCount < MAX_PLAYERMODELS; i++,dirptr+=dirlen+1)
04976     {
04977         dirlen = strlen(dirptr);
04978         
04979         if (dirlen && dirptr[dirlen-1]=='/') dirptr[dirlen-1]='\0';
04980 
04981         if (!strcmp(dirptr,".") || !strcmp(dirptr,".."))
04982             continue;
04983             
04984         // iterate all skin files in directory
04985         numfiles = trap_FS_GetFileList( va("models/players/%s",dirptr), "tga", filelist, 2048 );
04986         fileptr  = filelist;
04987         for (j=0; j<numfiles && uiInfo.q3HeadCount < MAX_PLAYERMODELS;j++,fileptr+=filelen+1)
04988         {
04989             filelen = strlen(fileptr);
04990 
04991             COM_StripExtension(fileptr,skinname);
04992 
04993             // look for icon_????
04994             if (Q_stricmpn(skinname, "icon_", 5) == 0 && !(Q_stricmp(skinname,"icon_blue") == 0 || Q_stricmp(skinname,"icon_red") == 0))
04995             {
04996                 if (Q_stricmp(skinname, "icon_default") == 0) {
04997                     Com_sprintf( scratch, sizeof(scratch), dirptr);
04998                 } else {
04999                     Com_sprintf( scratch, sizeof(scratch), "%s/%s",dirptr, skinname + 5);
05000                 }
05001                 dirty = 0;
05002                 for(k=0;k<uiInfo.q3HeadCount;k++) {
05003                     if (!Q_stricmp(scratch, uiInfo.q3HeadNames[uiInfo.q3HeadCount])) {
05004                         dirty = 1;
05005                         break;
05006                     }
05007                 }
05008                 if (!dirty) {
05009                     Com_sprintf( uiInfo.q3HeadNames[uiInfo.q3HeadCount], sizeof(uiInfo.q3HeadNames[uiInfo.q3HeadCount]), scratch);
05010                     uiInfo.q3HeadIcons[uiInfo.q3HeadCount++] = trap_R_RegisterShaderNoMip(va("models/players/%s/%s",dirptr,skinname));
05011                 }
05012             }
05013 
05014         }
05015     }   
05016 
05017 }

Here is the call graph for this function:

void UI_BuildServerDisplayList qboolean  force  )  [static]
 

Definition at line 3731 of file ui_main.c.

References AS_LOCAL, atoi, count, FEEDER_SERVERS, gameTypeInfo::gtEnum, i, Info_ValueForKey(), vmCvar_t::integer, uiInfo_t::joinGameTypes, MAX_STRING_CHARS, Menu_SetFeederSelection(), serverStatus_s::motd, serverStatus_s::motdLen, serverStatus_s::motdWidth, serverStatus_s::nextDisplayRefresh, NULL, serverStatus_s::numDisplayServers, serverStatus_s::numPlayersOnServers, Q_stricmp(), qfalse, qtrue, displayContextDef_t::realTime, serverStatus_s::refreshtime, serverFilters, uiInfo_t::serverStatus, strcpy(), strlen(), trap_Cvar_VariableStringBuffer(), trap_LAN_GetServerCount(), trap_LAN_GetServerInfo(), trap_LAN_GetServerPing(), trap_LAN_MarkServerVisible(), trap_LAN_ServerIsVisible(), UI_BinaryServerInsertion(), ui_browserShowEmpty, ui_browserShowFull, ui_joinGameType, ui_netSource, UI_RemoveServerFromDisplayList(), ui_serverFilterType, uiInfo_t::uiDC, and uiInfo.

Referenced by UI_DoServerRefresh(), UI_JoinGameType_HandleKey(), UI_NetFilter_HandleKey(), UI_NetSource_HandleKey(), and UI_RunMenuScript().

03731                                                       {
03732     int i, count, clients, maxClients, ping, game, len, visible;
03733     char info[MAX_STRING_CHARS];
03734 //  qboolean startRefresh = qtrue; TTimo: unused
03735     static int numinvisible;
03736 
03737     if (!(force || uiInfo.uiDC.realTime > uiInfo.serverStatus.nextDisplayRefresh)) {
03738         return;
03739     }
03740     // if we shouldn't reset
03741     if ( force == 2 ) {
03742         force = 0;
03743     }
03744 
03745     // do motd updates here too
03746     trap_Cvar_VariableStringBuffer( "cl_motdString", uiInfo.serverStatus.motd, sizeof(uiInfo.serverStatus.motd) );
03747     len = strlen(uiInfo.serverStatus.motd);
03748     if (len == 0) {
03749         strcpy(uiInfo.serverStatus.motd, "Welcome to Team Arena!");
03750         len = strlen(uiInfo.serverStatus.motd);
03751     } 
03752     if (len != uiInfo.serverStatus.motdLen) {
03753         uiInfo.serverStatus.motdLen = len;
03754         uiInfo.serverStatus.motdWidth = -1;
03755     } 
03756 
03757     if (force) {
03758         numinvisible = 0;
03759         // clear number of displayed servers
03760         uiInfo.serverStatus.numDisplayServers = 0;
03761         uiInfo.serverStatus.numPlayersOnServers = 0;
03762         // set list box index to zero
03763         Menu_SetFeederSelection(NULL, FEEDER_SERVERS, 0, NULL);
03764         // mark all servers as visible so we store ping updates for them
03765         trap_LAN_MarkServerVisible(ui_netSource.integer, -1, qtrue);
03766     }
03767 
03768     // get the server count (comes from the master)
03769     count = trap_LAN_GetServerCount(ui_netSource.integer);
03770     if (count == -1 || (ui_netSource.integer == AS_LOCAL && count == 0) ) {
03771         // still waiting on a response from the master
03772         uiInfo.serverStatus.numDisplayServers = 0;
03773         uiInfo.serverStatus.numPlayersOnServers = 0;
03774         uiInfo.serverStatus.nextDisplayRefresh = uiInfo.uiDC.realTime + 500;
03775         return;
03776     }
03777 
03778     visible = qfalse;
03779     for (i = 0; i < count; i++) {
03780         // if we already got info for this server
03781         if (!trap_LAN_ServerIsVisible(ui_netSource.integer, i)) {
03782             continue;
03783         }
03784         visible = qtrue;
03785         // get the ping for this server
03786         ping = trap_LAN_GetServerPing(ui_netSource.integer, i);
03787         if (ping > 0 || ui_netSource.integer == AS_FAVORITES) {
03788 
03789             trap_LAN_GetServerInfo(ui_netSource.integer, i, info, MAX_STRING_CHARS);
03790 
03791             clients = atoi(Info_ValueForKey(info, "clients"));
03792             uiInfo.serverStatus.numPlayersOnServers += clients;
03793 
03794             if (ui_browserShowEmpty.integer == 0) {
03795                 if (clients == 0) {
03796                     trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse);
03797                     continue;
03798                 }
03799             }
03800 
03801             if (ui_browserShowFull.integer == 0) {
03802                 maxClients = atoi(Info_ValueForKey(info, "sv_maxclients"));
03803                 if (clients == maxClients) {
03804                     trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse);
03805                     continue;
03806                 }
03807             }
03808 
03809             if (uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum != -1) {
03810                 game = atoi(Info_ValueForKey(info, "gametype"));
03811                 if (game != uiInfo.joinGameTypes[ui_joinGameType.integer].gtEnum) {
03812                     trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse);
03813                     continue;
03814                 }
03815             }
03816                 
03817             if (ui_serverFilterType.integer > 0) {
03818                 if (Q_stricmp(Info_ValueForKey(info, "game"), serverFilters[ui_serverFilterType.integer].basedir) != 0) {
03819                     trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse);
03820                     continue;
03821                 }
03822             }
03823             // make sure we never add a favorite server twice
03824             if (ui_netSource.integer == AS_FAVORITES) {
03825                 UI_RemoveServerFromDisplayList(i);
03826             }
03827             // insert the server into the list
03828             UI_BinaryServerInsertion(i);
03829             // done with this server
03830             if (ping > 0) {
03831                 trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse);
03832                 numinvisible++;
03833             }
03834         }
03835     }
03836 
03837     uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime;
03838 
03839     // if there were no servers visible for ping updates
03840     if (!visible) {
03841 //      UI_StopServerRefresh();
03842 //      uiInfo.serverStatus.nextDisplayRefresh = 0;
03843     }
03844 }

Here is the call graph for this function:

void UI_BuildServerStatus qboolean  force  )  [static]
 

Definition at line 4157 of file ui_main.c.

References serverStatus_s::currentServer, FEEDER_SERVERSTATUS, Menu_SetFeederSelection(), uiInfo_t::nextFindPlayerRefresh, uiInfo_t::nextServerStatusRefresh, NULL, serverStatus_s::numDisplayServers, serverStatusInfo_t::numLines, displayContextDef_t::realTime, uiInfo_t::serverStatus, uiInfo_t::serverStatusAddress, uiInfo_t::serverStatusInfo, trap_LAN_ServerStatus(), UI_GetServerStatusInfo(), uiInfo_t::uiDC, and uiInfo.

Referenced by _UI_Refresh(), UI_FeederSelection(), and UI_RunMenuScript().

04157                                                  {
04158 
04159     if (uiInfo.nextFindPlayerRefresh) {
04160         return;
04161     }
04162     if (!force) {
04163         if (!uiInfo.nextServerStatusRefresh || uiInfo.nextServerStatusRefresh > uiInfo.uiDC.realTime) {
04164             return;
04165         }
04166     }
04167     else {
04168         Menu_SetFeederSelection(NULL, FEEDER_SERVERSTATUS, 0, NULL);
04169         uiInfo.serverStatusInfo.numLines = 0;
04170         // reset all server status requests
04171         trap_LAN_ServerStatus( NULL, NULL, 0);
04172     }
04173     if (uiInfo.serverStatus.currentServer < 0 || uiInfo.serverStatus.currentServer > uiInfo.serverStatus.numDisplayServers || uiInfo.serverStatus.numDisplayServers == 0) {
04174         return;
04175     }
04176     if (UI_GetServerStatusInfo( uiInfo.serverStatusAddress, &uiInfo.serverStatusInfo ) ) {
04177         uiInfo.nextServerStatusRefresh = 0;
04178         UI_GetServerStatusInfo( uiInfo.serverStatusAddress, NULL );
04179     }
04180     else {
04181         uiInfo.nextServerStatusRefresh = uiInfo.uiDC.realTime + 500;
04182     }
04183 }

Here is the call graph for this function:

qboolean UI_ClanName_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2300 of file ui_main.c.

References teamInfo::cinematic, FEEDER_HEADS, i, K_ENTER, K_MOUSE1, K_MOUSE2, qboolean, uiInfo_t::teamCount, uiInfo_t::teamList, teamInfo::teamName, trap_CIN_StopCinematic(), trap_Cvar_Set(), UI_Cvar_VariableString(), UI_FeederSelection(), UI_HeadCountByTeam(), UI_TeamIndexFromName(), uiInfo, and updateModel.

Referenced by UI_OwnerDrawHandleKey().

02300                                                                           {
02301   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02302     int i;
02303     i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName"));
02304         if (uiInfo.teamList[i].cinematic >= 0) {
02305           trap_CIN_StopCinematic(uiInfo.teamList[i].cinematic);
02306             uiInfo.teamList[i].cinematic = -1;
02307         }
02308         if (key == K_MOUSE2) {
02309         i--;
02310         } else {
02311         i++;
02312         }
02313     if (i >= uiInfo.teamCount) {
02314       i = 0;
02315     } else if (i < 0) {
02316             i = uiInfo.teamCount - 1;
02317         }
02318     trap_Cvar_Set( "ui_teamName", uiInfo.teamList[i].teamName);
02319     UI_HeadCountByTeam();
02320     UI_FeederSelection(FEEDER_HEADS, 0);
02321     updateModel = qtrue;
02322     return qtrue;
02323   }
02324   return qfalse;
02325 }

Here is the call graph for this function:

qboolean UI_Crosshair_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2611 of file ui_main.c.

References uiInfo_t::currentCrosshair, K_ENTER, K_MOUSE1, K_MOUSE2, NUM_CROSSHAIRS, qboolean, trap_Cvar_Set(), uiInfo, and va().

Referenced by UI_OwnerDrawHandleKey().

02611                                                                            {
02612   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02613         if (key == K_MOUSE2) {
02614             uiInfo.currentCrosshair--;
02615         } else {
02616             uiInfo.currentCrosshair++;
02617         }
02618 
02619         if (uiInfo.currentCrosshair >= NUM_CROSSHAIRS) {
02620             uiInfo.currentCrosshair = 0;
02621         } else if (uiInfo.currentCrosshair < 0) {
02622             uiInfo.currentCrosshair = NUM_CROSSHAIRS - 1;
02623         }
02624         trap_Cvar_Set("cg_drawCrosshair", va("%d", uiInfo.currentCrosshair)); 
02625         return qtrue;
02626     }
02627     return qfalse;
02628 }

Here is the call graph for this function:

void UI_DisplayDownloadInfo const char *  downloadName,
float  centerPoint,
float  yStart,
float  scale
[static]
 

Definition at line 5406 of file ui_main.c.

References colorWhite, n, displayContextDef_t::realTime, s, Text_PaintCenter(), trap_Cvar_VariableValue(), UI_PrintTime(), UI_ReadableSize(), UI_SetColor(), uiInfo_t::uiDC, uiInfo, and va().

Referenced by UI_DrawConnectScreen().

05406                                                                                                              {
05407     static char dlText[]    = "Downloading:";
05408     static char etaText[]   = "Estimated time left:";
05409     static char xferText[]  = "Transfer rate:";
05410 
05411     int downloadSize, downloadCount, downloadTime;
05412     char dlSizeBuf[64], totalSizeBuf[64], xferRateBuf[64], dlTimeBuf[64];
05413     int xferRate;
05414     int leftWidth;
05415     const char *s;
05416 
05417     downloadSize = trap_Cvar_VariableValue( "cl_downloadSize" );
05418     downloadCount = trap_Cvar_VariableValue( "cl_downloadCount" );
05419     downloadTime = trap_Cvar_VariableValue( "cl_downloadTime" );
05420 
05421     leftWidth = 320;
05422 
05423     UI_SetColor(colorWhite);
05424     Text_PaintCenter(centerPoint, yStart + 112, scale, colorWhite, dlText, 0);
05425     Text_PaintCenter(centerPoint, yStart + 192, scale, colorWhite, etaText, 0);
05426     Text_PaintCenter(centerPoint, yStart + 248, scale, colorWhite, xferText, 0);
05427 
05428     if (downloadSize > 0) {
05429         s = va( "%s (%d%%)", downloadName, downloadCount * 100 / downloadSize );
05430     } else {
05431         s = downloadName;
05432     }
05433 
05434     Text_PaintCenter(centerPoint, yStart+136, scale, colorWhite, s, 0);
05435 
05436     UI_ReadableSize( dlSizeBuf,     sizeof dlSizeBuf,       downloadCount );
05437     UI_ReadableSize( totalSizeBuf,  sizeof totalSizeBuf,    downloadSize );
05438 
05439     if (downloadCount < 4096 || !downloadTime) {
05440         Text_PaintCenter(leftWidth, yStart+216, scale, colorWhite, "estimating", 0);
05441         Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), 0);
05442     } else {
05443         if ((uiInfo.uiDC.realTime - downloadTime) / 1000) {
05444             xferRate = downloadCount / ((uiInfo.uiDC.realTime - downloadTime) / 1000);
05445         } else {
05446             xferRate = 0;
05447         }
05448         UI_ReadableSize( xferRateBuf, sizeof xferRateBuf, xferRate );
05449 
05450         // Extrapolate estimated completion time
05451         if (downloadSize && xferRate) {
05452             int n = downloadSize / xferRate; // estimated time for entire d/l in secs
05453 
05454             // We do it in K (/1024) because we'd overflow around 4MB
05455             UI_PrintTime ( dlTimeBuf, sizeof dlTimeBuf, 
05456                 (n - (((downloadCount/1024) * n) / (downloadSize/1024))) * 1000);
05457 
05458             Text_PaintCenter(leftWidth, yStart+216, scale, colorWhite, dlTimeBuf, 0);
05459             Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), 0);
05460         } else {
05461             Text_PaintCenter(leftWidth, yStart+216, scale, colorWhite, "estimating", 0);
05462             if (downloadSize) {
05463                 Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s of %s copied)", dlSizeBuf, totalSizeBuf), 0);
05464             } else {
05465                 Text_PaintCenter(leftWidth, yStart+160, scale, colorWhite, va("(%s copied)", dlSizeBuf), 0);
05466             }
05467         }
05468 
05469         if (xferRate) {
05470             Text_PaintCenter(leftWidth, yStart+272, scale, colorWhite, va("%s/Sec", xferRateBuf), 0);
05471         }
05472     }
05473 }

Here is the call graph for this function:

void UI_DoServerRefresh void   )  [static]
 

Definition at line 5906 of file ui_main.c.

References vmCvar_t::integer, qboolean, qfalse, displayContextDef_t::realTime, serverStatus_s::refreshActive, serverStatus_s::refreshtime, uiInfo_t::serverStatus, trap_LAN_GetServerCount(), trap_LAN_UpdateVisiblePings(), UI_BuildServerDisplayList(), ui_netSource, UI_StopServerRefresh(), uiInfo_t::uiDC, uiInfo, and wait().

Referenced by _UI_Refresh().

05907 {
05908     qboolean wait = qfalse;
05909 
05910     if (!uiInfo.serverStatus.refreshActive) {
05911         return;
05912     }
05913     if (ui_netSource.integer != AS_FAVORITES) {
05914         if (ui_netSource.integer == AS_LOCAL) {
05915             if (!trap_LAN_GetServerCount(ui_netSource.integer)) {
05916                 wait = qtrue;
05917             }
05918         } else {
05919             if (trap_LAN_GetServerCount(ui_netSource.integer) < 0) {
05920                 wait = qtrue;
05921             }
05922         }
05923     }
05924 
05925     if (uiInfo.uiDC.realTime < uiInfo.serverStatus.refreshtime) {
05926         if (wait) {
05927             return;
05928         }
05929     }
05930 
05931     // if still trying to retrieve pings
05932     if (trap_LAN_UpdateVisiblePings(ui_netSource.integer)) {
05933         uiInfo.serverStatus.refreshtime = uiInfo.uiDC.realTime + 1000;
05934     } else if (!wait) {
05935         // get the last servers in the list
05936         UI_BuildServerDisplayList(2);
05937         // stop the refresh
05938         UI_StopServerRefresh();
05939     }
05940     //
05941     UI_BuildServerDisplayList(qfalse);
05942 }

Here is the call graph for this function:

void UI_DrawAllMapsSelection rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle,
qboolean  net
[static]
 

Definition at line 1620 of file ui_main.c.

References vmCvar_t::integer, uiInfo_t::mapCount, uiInfo_t::mapList, mapInfo::mapName, rect, Text_Paint(), ui_currentMap, ui_currentNetMap, and uiInfo.

Referenced by UI_OwnerDraw().

01620                                                                                                              {
01621     int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer;
01622     if (map >= 0 && map < uiInfo.mapCount) {
01623       Text_Paint(rect->x, rect->y, scale, color, uiInfo.mapList[map].mapName, 0, 0, textStyle);
01624     }
01625 }

Here is the call graph for this function:

void UI_DrawBotName rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1748 of file ui_main.c.

References uiInfo_t::botIndex, uiInfo_t::characterCount, uiInfo_t::characterList, characterInfo::name, rect, Text_Paint(), trap_Cvar_VariableValue(), UI_GetBotNameByNumber(), UI_GetNumBots(), uiInfo, and value.

Referenced by UI_OwnerDraw().

01748                                                                                       {
01749     int value = uiInfo.botIndex;
01750     int game = trap_Cvar_VariableValue("g_gametype");
01751     const char *text = "";
01752     if (game >= GT_TEAM) {
01753         if (value >= uiInfo.characterCount) {
01754             value = 0;
01755         }
01756         text = uiInfo.characterList[value].name;
01757     } else {
01758         if (value >= UI_GetNumBots()) {
01759             value = 0;
01760         }
01761         text = UI_GetBotNameByNumber(value);
01762     }
01763   Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle);
01764 }

Here is the call graph for this function:

void UI_DrawBotSkill rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1766 of file ui_main.c.

References rect, uiInfo_t::skillIndex, skillLevels, Text_Paint(), and uiInfo.

Referenced by UI_OwnerDraw().

01766                                                                                        {
01767     if (uiInfo.skillIndex >= 0 && uiInfo.skillIndex < numSkillLevels) {
01768       Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, textStyle);
01769     }
01770 }

Here is the call graph for this function:

void UI_DrawCenteredPic qhandle_t  image,
int  w,
int  h
 

Definition at line 592 of file ui_main.c.

References h(), SCREEN_HEIGHT, SCREEN_WIDTH, UI_DrawHandlePic(), w, x, and y.

00592                                                        {
00593   int x, y;
00594   x = (SCREEN_WIDTH - w) / 2;
00595   y = (SCREEN_HEIGHT - h) / 2;
00596   UI_DrawHandlePic(x, y, w, h, image);
00597 }

Here is the call graph for this function:

void UI_DrawCinematic int  handle,
float  x,
float  y,
float  w,
float  h
[static]
 

Definition at line 4939 of file ui_main.c.

References h(), trap_CIN_DrawCinematic(), trap_CIN_SetExtents(), w, x, and y.

04939                                                                              {
04940     trap_CIN_SetExtents(handle, x, y, w, h);
04941   trap_CIN_DrawCinematic(handle);
04942 }

Here is the call graph for this function:

void UI_DrawClanCinematic rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1099 of file ui_main.c.

References CIN_loop, CIN_silent, teamInfo::cinematic, i, teamInfo::imageName, NULL, rect, uiInfo_t::teamCount, teamInfo::teamIcon, teamInfo::teamIcon_Metal, uiInfo_t::teamList, trap_CIN_DrawCinematic(), trap_CIN_PlayCinematic(), trap_CIN_RunCinematic(), trap_CIN_SetExtents(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01099                                                                              {
01100   int i;
01101   i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName"));
01102   if (i >= 0 && i < uiInfo.teamCount) {
01103 
01104         if (uiInfo.teamList[i].cinematic >= -2) {
01105             if (uiInfo.teamList[i].cinematic == -1) {
01106                 uiInfo.teamList[i].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.teamList[i].imageName), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
01107             }
01108             if (uiInfo.teamList[i].cinematic >= 0) {
01109               trap_CIN_RunCinematic(uiInfo.teamList[i].cinematic);
01110                 trap_CIN_SetExtents(uiInfo.teamList[i].cinematic, rect->x, rect->y, rect->w, rect->h);
01111                 trap_CIN_DrawCinematic(uiInfo.teamList[i].cinematic);
01112             } else {
01113                 trap_R_SetColor( color );
01114                 UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Metal);
01115                 trap_R_SetColor(NULL);
01116                 uiInfo.teamList[i].cinematic = -2;
01117             }
01118         } else {
01119         trap_R_SetColor( color );
01120             UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon);
01121             trap_R_SetColor(NULL);
01122         }
01123     }
01124 
01125 }

Here is the call graph for this function:

void UI_DrawClanLogo rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1082 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, uiInfo_t::teamCount, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01082                                                                         {
01083   int i;
01084   i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName"));
01085   if (i >= 0 && i < uiInfo.teamCount) {
01086     trap_R_SetColor( color );
01087 
01088         if (uiInfo.teamList[i].teamIcon == -1) {
01089       uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName);
01090       uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName));
01091       uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName));
01092         }
01093 
01094     UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon);
01095     trap_R_SetColor(NULL);
01096   }
01097 }

Here is the call graph for this function:

void UI_DrawClanName rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1024 of file ui_main.c.

References rect, Text_Paint(), and UI_Cvar_VariableString().

Referenced by UI_OwnerDraw().

01024                                                                                        {
01025   Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_teamName"), 0, 0, textStyle);
01026 }

Here is the call graph for this function:

void UI_DrawConnectScreen qboolean  overlay  ) 
 

Definition at line 5483 of file ui_main.c.

References mfield_t::buffer, CA_CHALLENGING, CA_CONNECTED, CA_CONNECTING, CA_LOADING, CA_PRIMED, menucommon_s::callback, color_white, colorWhite, uiClientState_t::connectPacketCount, uiClientState_t::connState, CS_SERVERINFO, Cvar_VariableString(), menufield_s::field, Field_Clear(), menufield_s::generic, Info_ValueForKey(), ITEM_TEXTSTYLE_SHADOWEDMORE, lastConnState, lastLoadingText, Menu_AddItem(), Menu_Cache(), Menu_Paint(), menu_text_color, uiStatic_t::menuBackShader, Menus_FindByName(), uiClientState_t::messageString, MField_Draw(), menucommon_s::name, passwordField, Q_stricmp(), Q_strncpyz(), qtrue, s, SCREEN_HEIGHT, SCREEN_WIDTH, uiClientState_t::servername, strcpy(), Text_PaintCenter(), Text_PaintCenter_AutoWrapped(), trap_Cvar_VariableStringBuffer(), trap_GetClientState(), trap_GetConfigString(), menucommon_s::type, UI_BIGFONT, UI_CENTER, UI_DisplayDownloadInfo(), UI_DrawHandlePic(), UI_DrawProportionalString(), UI_DrawProportionalString_AutoWrapped(), UI_DROPSHADOW, UI_SetColor(), UI_SMALLFONT, uis, uiClientState_t::updateInfoString, va(), mfield_t::widthInChars, menucommon_s::x, and menucommon_s::y.

Referenced by vmMain().

05483                                               {
05484     char            *s;
05485     uiClientState_t cstate;
05486     char            info[MAX_INFO_VALUE];
05487     char text[256];
05488     float centerPoint, yStart, scale;
05489     
05490     menuDef_t *menu = Menus_FindByName("Connect");
05491 
05492 
05493     if ( !overlay && menu ) {
05494         Menu_Paint(menu, qtrue);
05495     }
05496 
05497     if (!overlay) {
05498         centerPoint = 320;
05499         yStart = 130;
05500         scale = 0.5f;
05501     } else {
05502         centerPoint = 320;
05503         yStart = 32;
05504         scale = 0.6f;
05505         return;
05506     }
05507 
05508     // see what information we should display
05509     trap_GetClientState( &cstate );
05510 
05511     info[0] = '\0';
05512     if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) {
05513         Text_PaintCenter(centerPoint, yStart, scale, colorWhite, va( "Loading %s", Info_ValueForKey( info, "mapname" )), 0);
05514     }
05515 
05516     if (!Q_stricmp(cstate.servername,"localhost")) {
05517         Text_PaintCenter(centerPoint, yStart + 48, scale, colorWhite, va("Starting up..."), ITEM_TEXTSTYLE_SHADOWEDMORE);
05518     } else {
05519         strcpy(text, va("Connecting to %s", cstate.servername));
05520         Text_PaintCenter(centerPoint, yStart + 48, scale, colorWhite,text , ITEM_TEXTSTYLE_SHADOWEDMORE);
05521     }
05522 
05523     // display global MOTD at bottom
05524     Text_PaintCenter(centerPoint, 600, scale, colorWhite, Info_ValueForKey( cstate.updateInfoString, "motd" ), 0);
05525     // print any server info (server full, bad version, etc)
05526     if ( cstate.connState < CA_CONNECTED ) {
05527         Text_PaintCenter_AutoWrapped(centerPoint, yStart + 176, 630, 20, scale, colorWhite, cstate.messageString, 0);
05528     }
05529 
05530     if ( lastConnState > cstate.connState ) {
05531         lastLoadingText[0] = '\0';
05532     }
05533     lastConnState = cstate.connState;
05534 
05535     switch ( cstate.connState ) {
05536     case CA_CONNECTING:
05537         s = va("Awaiting connection...%i", cstate.connectPacketCount);
05538         break;
05539     case CA_CHALLENGING:
05540         s = va("Awaiting challenge...%i", cstate.connectPacketCount);
05541         break;
05542     case CA_CONNECTED: {
05543         char downloadName[MAX_INFO_VALUE];
05544 
05545             trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) );
05546             if (*downloadName) {
05547                 UI_DisplayDownloadInfo( downloadName, centerPoint, yStart, scale );
05548                 return;
05549             }
05550         }
05551         s = "Awaiting gamestate...";
05552         break;
05553     case CA_LOADING:
05554         return;
05555     case CA_PRIMED:
05556         return;
05557     default:
05558         return;
05559     }
05560 
05561 
05562     if (Q_stricmp(cstate.servername,"localhost")) {
05563         Text_PaintCenter(centerPoint, yStart + 80, scale, colorWhite, s, 0);
05564     }
05565 
05566     // password required / connection rejected information goes here
05567 }

Here is the call graph for this function:

void UI_DrawCrosshair rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1776 of file ui_main.c.

References displayContextDef_t::Assets, cachedAssets_t::crosshairShader, uiInfo_t::currentCrosshair, NULL, rect, trap_R_SetColor(), UI_DrawHandlePic(), uiInfo_t::uiDC, and uiInfo.

Referenced by UI_OwnerDraw().

01776                                                                          {
01777     trap_R_SetColor( color );
01778     if (uiInfo.currentCrosshair < 0 || uiInfo.currentCrosshair >= NUM_CROSSHAIRS) {
01779         uiInfo.currentCrosshair = 0;
01780     }
01781     UI_DrawHandlePic( rect->x, rect->y - rect->h, rect->w, rect->h, uiInfo.uiDC.Assets.crosshairShader[uiInfo.currentCrosshair]);
01782     trap_R_SetColor( NULL );
01783 }

Here is the call graph for this function:

void UI_DrawEffects rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1189 of file ui_main.c.

References displayContextDef_t::Assets, uiInfo_t::effectsColor, cachedAssets_t::fxBasePic, cachedAssets_t::fxPic, rect, UI_DrawHandlePic(), uiInfo_t::uiDC, and uiInfo.

Referenced by UI_OwnerDraw().

01189                                                                        {
01190     UI_DrawHandlePic( rect->x, rect->y - 14, 128, 8, uiInfo.uiDC.Assets.fxBasePic );
01191     UI_DrawHandlePic( rect->x + uiInfo.effectsColor * 16 + 8, rect->y - 16, 16, 12, uiInfo.uiDC.Assets.fxPic[uiInfo.effectsColor] );
01192 }

Here is the call graph for this function:

void UI_DrawGameType rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1046 of file ui_main.c.

References uiInfo_t::gameTypes, vmCvar_t::integer, rect, Text_Paint(), ui_gameType, and uiInfo.

Referenced by UI_OwnerDraw().

01046                                                                                        {
01047   Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_gameType.integer].gameType, 0, 0, textStyle);
01048 }

Here is the call graph for this function:

void UI_DrawGLInfo rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1931 of file ui_main.c.

References glconfig_t::colorBits, glconfig_t::depthBits, glconfig_t::extensions_string, displayContextDef_t::glconfig, i, Q_strncpyz(), rect, glconfig_t::renderer_string, glconfig_t::stencilBits, Text_Paint(), uiInfo_t::uiDC, uiInfo, va(), glconfig_t::vendor_string, glconfig_t::version_string, and y.

Referenced by UI_OwnerDraw().

01931                                                                                      {
01932     char * eptr;
01933     char buff[1024];
01934     const char *lines[64];
01935     int y, numLines, i;
01936 
01937     Text_Paint(rect->x + 2, rect->y, scale, color, va("VENDOR: %s", uiInfo.uiDC.glconfig.vendor_string), 0, 30, textStyle);
01938     Text_Paint(rect->x + 2, rect->y + 15, scale, color, va("VERSION: %s: %s", uiInfo.uiDC.glconfig.version_string,uiInfo.uiDC.glconfig.renderer_string), 0, 30, textStyle);
01939     Text_Paint(rect->x + 2, rect->y + 30, scale, color, va ("PIXELFORMAT: color(%d-bits) Z(%d-bits) stencil(%d-bits)", uiInfo.uiDC.glconfig.colorBits, uiInfo.uiDC.glconfig.depthBits, uiInfo.uiDC.glconfig.stencilBits), 0, 30, textStyle);
01940 
01941     // build null terminated extension strings
01942   // TTimo: https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=399
01943   // in TA this was not directly crashing, but displaying a nasty broken shader right in the middle
01944   // brought down the string size to 1024, there's not much that can be shown on the screen anyway
01945     Q_strncpyz(buff, uiInfo.uiDC.glconfig.extensions_string, 1024);
01946     eptr = buff;
01947     y = rect->y + 45;
01948     numLines = 0;
01949     while ( y < rect->y + rect->h && *eptr )
01950     {
01951         while ( *eptr && *eptr == ' ' )
01952             *eptr++ = '\0';
01953 
01954         // track start of valid string
01955         if (*eptr && *eptr != ' ') {
01956             lines[numLines++] = eptr;
01957         }
01958 
01959         while ( *eptr && *eptr != ' ' )
01960             eptr++;
01961     }
01962 
01963     i = 0;
01964     while (i < numLines) {
01965         Text_Paint(rect->x + 2, y, scale, color, lines[i++], 0, 20, textStyle);
01966         if (i < numLines) {
01967             Text_Paint(rect->x + rect->w / 2, y, scale, color, lines[i++], 0, 20, textStyle);
01968         }
01969         y += 10;
01970         if (y > rect->y + rect->h - 11) {
01971             break;
01972         }
01973     }
01974 
01975 
01976 }

Here is the call graph for this function:

void UI_DrawHandicap rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1015 of file ui_main.c.

References Com_Clamp(), h(), handicapValues, i, rect, Text_Paint(), and trap_Cvar_VariableValue().

Referenced by UI_OwnerDraw().

01015                                                                                        {
01016   int i, h;
01017 
01018   h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") );
01019   i = 20 - h / 5;
01020 
01021   Text_Paint(rect->x, rect->y, scale, color, handicapValues[i], 0, 0, textStyle);
01022 }

Here is the call graph for this function:

void UI_DrawJoinGameType rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1058 of file ui_main.c.

References vmCvar_t::integer, uiInfo_t::joinGameTypes, uiInfo_t::numJoinGameTypes, rect, Text_Paint(), trap_Cvar_Set(), ui_joinGameType, and uiInfo.

Referenced by UI_OwnerDraw().

01058                                                                                            {
01059     if (ui_joinGameType.integer < 0 || ui_joinGameType.integer > uiInfo.numJoinGameTypes) {
01060         trap_Cvar_Set("ui_joinGameType", "0");
01061     }
01062   Text_Paint(rect->x, rect->y, scale, color, uiInfo.joinGameTypes[ui_joinGameType.integer].gameType , 0, 0, textStyle);
01063 }

Here is the call graph for this function:

void UI_DrawKeyBindStatus rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1922 of file ui_main.c.

References Display_KeyBindPending(), rect, and Text_Paint().

Referenced by UI_OwnerDraw().

01922                                                                                             {
01923 //  int ofs = 0; TTimo: unused
01924     if (Display_KeyBindPending()) {
01925         Text_Paint(rect->x, rect->y, scale, color, "Waiting for new key... Press ESCAPE to cancel", 0, 0, textStyle);
01926     } else {
01927         Text_Paint(rect->x, rect->y, scale, color, "Press ENTER or CLICK to change, Press BACKSPACE to clear", 0, 0, textStyle);
01928     }
01929 }

Here is the call graph for this function:

void UI_DrawMapCinematic rectDef_t rect,
float  scale,
vec4_t  color,
qboolean  net
[static]
 

Definition at line 1236 of file ui_main.c.

References CIN_loop, CIN_silent, mapInfo::cinematic, vmCvar_t::integer, uiInfo_t::mapCount, uiInfo_t::mapList, mapInfo::mapLoadName, rect, trap_CIN_DrawCinematic(), trap_CIN_PlayCinematic(), trap_CIN_RunCinematic(), trap_CIN_SetExtents(), trap_Cvar_Set(), ui_currentMap, ui_currentNetMap, UI_DrawMapPreview(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01236                                                                                           {
01237 
01238     int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer; 
01239     if (map < 0 || map > uiInfo.mapCount) {
01240         if (net) {
01241             ui_currentNetMap.integer = 0;
01242             trap_Cvar_Set("ui_currentNetMap", "0");
01243         } else {
01244             ui_currentMap.integer = 0;
01245             trap_Cvar_Set("ui_currentMap", "0");
01246         }
01247         map = 0;
01248     }
01249 
01250     if (uiInfo.mapList[map].cinematic >= -1) {
01251         if (uiInfo.mapList[map].cinematic == -1) {
01252             uiInfo.mapList[map].cinematic = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.mapList[map].mapLoadName), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
01253         }
01254         if (uiInfo.mapList[map].cinematic >= 0) {
01255           trap_CIN_RunCinematic(uiInfo.mapList[map].cinematic);
01256           trap_CIN_SetExtents(uiInfo.mapList[map].cinematic, rect->x, rect->y, rect->w, rect->h);
01257             trap_CIN_DrawCinematic(uiInfo.mapList[map].cinematic);
01258         } else {
01259             uiInfo.mapList[map].cinematic = -2;
01260         }
01261     } else {
01262         UI_DrawMapPreview(rect, scale, color, net);
01263     }
01264 }

Here is the call graph for this function:

void UI_DrawMapPreview rectDef_t rect,
float  scale,
vec4_t  color,
qboolean  net
[static]
 

Definition at line 1194 of file ui_main.c.

References mapInfo::imageName, vmCvar_t::integer, mapInfo::levelShot, uiInfo_t::mapCount, uiInfo_t::mapList, rect, trap_Cvar_Set(), trap_R_RegisterShaderNoMip(), ui_currentMap, ui_currentNetMap, UI_DrawHandlePic(), and uiInfo.

Referenced by UI_DrawMapCinematic(), and UI_OwnerDraw().

01194                                                                                         {
01195     int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer;
01196     if (map < 0 || map > uiInfo.mapCount) {
01197         if (net) {
01198             ui_currentNetMap.integer = 0;
01199             trap_Cvar_Set("ui_currentNetMap", "0");
01200         } else {
01201             ui_currentMap.integer = 0;
01202             trap_Cvar_Set("ui_currentMap", "0");
01203         }
01204         map = 0;
01205     }
01206 
01207     if (uiInfo.mapList[map].levelShot == -1) {
01208         uiInfo.mapList[map].levelShot = trap_R_RegisterShaderNoMip(uiInfo.mapList[map].imageName);
01209     }
01210 
01211     if (uiInfo.mapList[map].levelShot > 0) {
01212         UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.mapList[map].levelShot);
01213     } else {
01214         UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("menu/art/unknownmap"));
01215     }
01216 }                        

Here is the call graph for this function:

void UI_DrawMapTimeToBeat rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1219 of file ui_main.c.

References uiInfo_t::gameTypes, gameTypeInfo::gtEnum, vmCvar_t::integer, uiInfo_t::mapCount, uiInfo_t::mapList, rect, Text_Paint(), time(), mapInfo::timeToBeat, trap_Cvar_Set(), ui_currentMap, ui_gameType, uiInfo, and va().

Referenced by UI_OwnerDraw().

01219                                                                                             {
01220     int minutes, seconds, time;
01221     if (ui_currentMap.integer < 0 || ui_currentMap.integer > uiInfo.mapCount) {
01222         ui_currentMap.integer = 0;
01223         trap_Cvar_Set("ui_currentMap", "0");
01224     }
01225 
01226     time = uiInfo.mapList[ui_currentMap.integer].timeToBeat[uiInfo.gameTypes[ui_gameType.integer].gtEnum];
01227 
01228     minutes = time / 60;
01229     seconds = time % 60;
01230 
01231   Text_Paint(rect->x, rect->y, scale, color, va("%02i:%02i", minutes, seconds), 0, 0, textStyle);
01232 }

Here is the call graph for this function:

void UI_DrawNetFilter rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1346 of file ui_main.c.

References vmCvar_t::integer, rect, serverFilters, Text_Paint(), ui_serverFilterType, and va().

Referenced by UI_OwnerDraw().

01346                                                                                         {
01347     if (ui_serverFilterType.integer < 0 || ui_serverFilterType.integer > numServerFilters) {
01348         ui_serverFilterType.integer = 0;
01349     }
01350   Text_Paint(rect->x, rect->y, scale, color, va("Filter: %s", serverFilters[ui_serverFilterType.integer].description), 0, 0, textStyle);
01351 }

Here is the call graph for this function:

void UI_DrawNetGameType rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1050 of file ui_main.c.

References uiInfo_t::gameTypes, vmCvar_t::integer, uiInfo_t::numGameTypes, rect, Text_Paint(), trap_Cvar_Set(), ui_netGameType, and uiInfo.

Referenced by UI_OwnerDraw().

01050                                                                                           {
01051     if (ui_netGameType.integer < 0 || ui_netGameType.integer > uiInfo.numGameTypes) {
01052         trap_Cvar_Set("ui_netGameType", "0");
01053         trap_Cvar_Set("ui_actualNetGameType", "0");
01054     }
01055   Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_netGameType.integer].gameType , 0, 0, textStyle);
01056 }

Here is the call graph for this function:

void UI_DrawNetMapCinematic rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1329 of file ui_main.c.

References serverStatus_s::currentServerCinematic, vmCvar_t::integer, uiInfo_t::mapCount, rect, uiInfo_t::serverStatus, trap_CIN_DrawCinematic(), trap_CIN_RunCinematic(), trap_CIN_SetExtents(), trap_Cvar_Set(), ui_currentNetMap, UI_DrawNetMapPreview(), and uiInfo.

Referenced by UI_OwnerDraw().

Here is the call graph for this function:

void UI_DrawNetMapPreview rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1320 of file ui_main.c.

References serverStatus_s::currentServerPreview, rect, uiInfo_t::serverStatus, trap_R_RegisterShaderNoMip(), UI_DrawHandlePic(), and uiInfo.

Referenced by UI_DrawNetMapCinematic(), and UI_OwnerDraw().

01320                                                                              {
01321 
01322     if (uiInfo.serverStatus.currentServerPreview > 0) {
01323         UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.serverStatus.currentServerPreview);
01324     } else {
01325         UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("menu/art/unknownmap"));
01326     }
01327 }

Here is the call graph for this function:

void UI_DrawNetSource rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1313 of file ui_main.c.

References vmCvar_t::integer, netSources, rect, Text_Paint(), ui_netSource, and va().

Referenced by UI_OwnerDraw().

01313                                                                                         {
01314     if (ui_netSource.integer < 0 || ui_netSource.integer > numNetSources) {
01315         ui_netSource.integer = 0;
01316     }
01317   Text_Paint(rect->x, rect->y, scale, color, va("Source: %s", netSources[ui_netSource.integer]), 0, 0, textStyle);
01318 }

Here is the call graph for this function:

void UI_DrawOpponent rectDef_t rect  )  [static]
 

Definition at line 1480 of file ui_main.c.

References LEGS_IDLE, memset(), qfalse, displayContextDef_t::realTime, rect, strcpy(), TORSO_STAND, UI_Cvar_VariableString(), UI_DrawPlayer(), UI_PlayerInfo_SetInfo(), UI_PlayerInfo_SetModel(), UI_RegisterClientModelname(), uiInfo_t::uiDC, uiInfo, updateOpponentModel, vec3_origin, vec3_t, VectorClear, and WP_MACHINEGUN.

Referenced by UI_OwnerDraw().

01480                                              {
01481   static playerInfo_t info2;
01482   char model[MAX_QPATH];
01483   char headmodel[MAX_QPATH];
01484   char team[256];
01485     vec3_t  viewangles;
01486     vec3_t  moveangles;
01487   
01488     if (updateOpponentModel) {
01489         
01490         strcpy(model, UI_Cvar_VariableString("ui_opponentModel"));
01491       strcpy(headmodel, UI_Cvar_VariableString("ui_opponentModel"));
01492         team[0] = '\0';
01493 
01494     memset( &info2, 0, sizeof(playerInfo_t) );
01495     viewangles[YAW]   = 180 - 10;
01496     viewangles[PITCH] = 0;
01497     viewangles[ROLL]  = 0;
01498     VectorClear( moveangles );
01499     UI_PlayerInfo_SetModel( &info2, model, headmodel, "");
01500     UI_PlayerInfo_SetInfo( &info2, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse );
01501         UI_RegisterClientModelname( &info2, model, headmodel, team);
01502     updateOpponentModel = qfalse;
01503   }
01504 
01505   UI_DrawPlayer( rect->x, rect->y, rect->w, rect->h, &info2, uiInfo.uiDC.realTime / 2);
01506 
01507 }

Here is the call graph for this function:

void UI_DrawOpponentLogo rectDef_t rect,
vec3_t  color
[static]
 

Definition at line 1581 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01581                                                                {
01582   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName"));
01583     if (uiInfo.teamList[i].teamIcon == -1) {
01584     uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName);
01585     uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName));
01586     uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName));
01587     }
01588 
01589     trap_R_SetColor( color );
01590     UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon );
01591     trap_R_SetColor( NULL );
01592 }

Here is the call graph for this function:

void UI_DrawOpponentLogoMetal rectDef_t rect,
vec3_t  color
[static]
 

Definition at line 1594 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01594                                                                     {
01595   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName"));
01596     if (uiInfo.teamList[i].teamIcon == -1) {
01597     uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName);
01598     uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName));
01599     uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName));
01600     }
01601 
01602     trap_R_SetColor( color );
01603     UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Metal );
01604     trap_R_SetColor( NULL );
01605 }

Here is the call graph for this function:

void UI_DrawOpponentLogoName rectDef_t rect,
vec3_t  color
[static]
 

Definition at line 1607 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01607                                                                    {
01608   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName"));
01609     if (uiInfo.teamList[i].teamIcon == -1) {
01610     uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName);
01611     uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName));
01612     uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName));
01613     }
01614 
01615     trap_R_SetColor( color );
01616     UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon_Name );
01617     trap_R_SetColor( NULL );
01618 }

Here is the call graph for this function:

void UI_DrawOpponentName rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1627 of file ui_main.c.

References rect, Text_Paint(), and UI_Cvar_VariableString().

Referenced by UI_OwnerDraw().

01627                                                                                            {
01628   Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_opponentName"), 0, 0, textStyle);
01629 }

Here is the call graph for this function:

void UI_DrawPlayerLogo rectDef_t rect,
vec3_t  color
[static]
 

Definition at line 1541 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01541                                                              {
01542   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName"));
01543 
01544     if (uiInfo.teamList[i].teamIcon == -1) {
01545     uiInfo.teamList[i].teamIcon = trap_R_RegisterShaderNoMip(uiInfo.teamList[i].imageName);
01546     uiInfo.teamList[i].teamIcon_Metal = trap_R_RegisterShaderNoMip(va("%s_metal",uiInfo.teamList[i].imageName));
01547     uiInfo.teamList[i].teamIcon_Name = trap_R_RegisterShaderNoMip(va("%s_name", uiInfo.teamList[i].imageName));
01548     }
01549 
01550     trap_R_SetColor( color );
01551     UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.teamList[i].teamIcon );
01552     trap_R_SetColor( NULL );
01553 }

Here is the call graph for this function:

void UI_DrawPlayerLogoMetal rectDef_t rect,
vec3_t  color
[static]
 

Definition at line 1555 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

Here is the call graph for this function:

void UI_DrawPlayerLogoName rectDef_t rect,
vec3_t  color
[static]
 

Definition at line 1568 of file ui_main.c.

References i, teamInfo::imageName, NULL, rect, teamInfo::teamIcon, teamInfo::teamIcon_Metal, teamInfo::teamIcon_Name, uiInfo_t::teamList, trap_R_RegisterShaderNoMip(), trap_R_SetColor(), UI_Cvar_VariableString(), UI_DrawHandlePic(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

Here is the call graph for this function:

void UI_DrawPlayerModel rectDef_t rect  )  [static]
 

Definition at line 1271 of file ui_main.c.

References head, LEGS_IDLE, memset(), q3Model, qfalse, displayContextDef_t::realTime, rect, strcpy(), TORSO_STAND, trap_Cvar_VariableValue(), UI_Cvar_VariableString(), UI_DrawPlayer(), UI_PlayerInfo_SetInfo(), UI_PlayerInfo_SetModel(), uiInfo_t::uiDC, uiInfo, updateModel, vec3_origin, vec3_t, VectorClear, and WP_MACHINEGUN.

Referenced by UI_OwnerDraw().

01271                                                 {
01272   static playerInfo_t info;
01273   char model[MAX_QPATH];
01274   char team[256];
01275     char head[256];
01276     vec3_t  viewangles;
01277     vec3_t  moveangles;
01278 
01279       if (trap_Cvar_VariableValue("ui_Q3Model")) {
01280       strcpy(model, UI_Cvar_VariableString("model"));
01281         strcpy(head, UI_Cvar_VariableString("headmodel"));
01282         if (!q3Model) {
01283             q3Model = qtrue;
01284             updateModel = qtrue;
01285         }
01286         team[0] = '\0';
01287     } else {
01288 
01289         strcpy(team, UI_Cvar_VariableString("ui_teamName"));
01290         strcpy(model, UI_Cvar_VariableString("team_model"));
01291         strcpy(head, UI_Cvar_VariableString("team_headmodel"));
01292         if (q3Model) {
01293             q3Model = qfalse;
01294             updateModel = qtrue;
01295         }
01296     }
01297   if (updateModel) {
01298     memset( &info, 0, sizeof(playerInfo_t) );
01299     viewangles[YAW]   = 180 - 10;
01300     viewangles[PITCH] = 0;
01301     viewangles[ROLL]  = 0;
01302     VectorClear( moveangles );
01303     UI_PlayerInfo_SetModel( &info, model, head, team);
01304     UI_PlayerInfo_SetInfo( &info, LEGS_IDLE, TORSO_STAND, viewangles, vec3_origin, WP_MACHINEGUN, qfalse );
01305 //      UI_RegisterClientModelname( &info, model, head, team);
01306     updateModel = qfalse;
01307   }
01308 
01309   UI_DrawPlayer( rect->x, rect->y, rect->w, rect->h, &info, uiInfo.uiDC.realTime / 2);
01310 
01311 }

Here is the call graph for this function:

void UI_DrawPreviewCinematic rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1127 of file ui_main.c.

References CIN_loop, CIN_silent, uiInfo_t::movieIndex, uiInfo_t::movieList, uiInfo_t::previewMovie, rect, trap_CIN_DrawCinematic(), trap_CIN_PlayCinematic(), trap_CIN_RunCinematic(), trap_CIN_SetExtents(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01127                                                                                 {
01128     if (uiInfo.previewMovie > -2) {
01129         uiInfo.previewMovie = trap_CIN_PlayCinematic(va("%s.roq", uiInfo.movieList[uiInfo.movieIndex]), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
01130         if (uiInfo.previewMovie >= 0) {
01131           trap_CIN_RunCinematic(uiInfo.previewMovie);
01132             trap_CIN_SetExtents(uiInfo.previewMovie, rect->x, rect->y, rect->w, rect->h);
01133             trap_CIN_DrawCinematic(uiInfo.previewMovie);
01134         } else {
01135             uiInfo.previewMovie = -2;
01136         }
01137     } 
01138 
01139 }

Here is the call graph for this function:

void UI_DrawRedBlue rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1772 of file ui_main.c.

References rect, uiInfo_t::redBlue, Text_Paint(), and uiInfo.

Referenced by UI_OwnerDraw().

01772                                                                                       {
01773   Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "Red" : "Blue", 0, 0, textStyle);
01774 }

Here is the call graph for this function:

void UI_DrawSelectedPlayer rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1839 of file ui_main.c.

References uiInfo_t::playerRefresh, displayContextDef_t::realTime, rect, uiInfo_t::teamLeader, Text_Paint(), UI_BuildPlayerList(), UI_Cvar_VariableString(), uiInfo_t::uiDC, and uiInfo.

Referenced by UI_OwnerDraw().

01839                                                                                              {
01840     if (uiInfo.uiDC.realTime > uiInfo.playerRefresh) {
01841         uiInfo.playerRefresh = uiInfo.uiDC.realTime + 3000;
01842         UI_BuildPlayerList();
01843     }
01844   Text_Paint(rect->x, rect->y, scale, color, (uiInfo.teamLeader) ? UI_Cvar_VariableString("cg_selectedPlayerName") : UI_Cvar_VariableString("name") , 0, 0, textStyle);
01845 }

Here is the call graph for this function:

void UI_DrawServerMOTD rectDef_t rect,
float  scale,
vec4_t  color
[static]
 

Definition at line 1863 of file ui_main.c.

References serverStatus_s::motd, serverStatus_s::motdLen, serverStatus_s::motdOffset, serverStatus_s::motdPaintX, serverStatus_s::motdPaintX2, serverStatus_s::motdTime, serverStatus_s::motdWidth, displayContextDef_t::realTime, rect, uiInfo_t::serverStatus, Text_Paint_Limit(), Text_Width(), uiInfo_t::uiDC, and uiInfo.

Referenced by UI_OwnerDraw().

01863                                                                           {
01864     if (uiInfo.serverStatus.motdLen) {
01865         float maxX;
01866      
01867         if (uiInfo.serverStatus.motdWidth == -1) {
01868             uiInfo.serverStatus.motdWidth = 0;
01869             uiInfo.serverStatus.motdPaintX = rect->x + 1;
01870             uiInfo.serverStatus.motdPaintX2 = -1;
01871         }
01872 
01873         if (uiInfo.serverStatus.motdOffset > uiInfo.serverStatus.motdLen) {
01874             uiInfo.serverStatus.motdOffset = 0;
01875             uiInfo.serverStatus.motdPaintX = rect->x + 1;
01876             uiInfo.serverStatus.motdPaintX2 = -1;
01877         }
01878 
01879         if (uiInfo.uiDC.realTime > uiInfo.serverStatus.motdTime) {
01880             uiInfo.serverStatus.motdTime = uiInfo.uiDC.realTime + 10;
01881             if (uiInfo.serverStatus.motdPaintX <= rect->x + 2) {
01882                 if (uiInfo.serverStatus.motdOffset < uiInfo.serverStatus.motdLen) {
01883                     uiInfo.serverStatus.motdPaintX += Text_Width(&uiInfo.serverStatus.motd[uiInfo.serverStatus.motdOffset], scale, 1) - 1;
01884                     uiInfo.serverStatus.motdOffset++;
01885                 } else {
01886                     uiInfo.serverStatus.motdOffset = 0;
01887                     if (uiInfo.serverStatus.motdPaintX2 >= 0) {
01888                         uiInfo.serverStatus.motdPaintX = uiInfo.serverStatus.motdPaintX2;
01889                     } else {
01890                         uiInfo.serverStatus.motdPaintX = rect->x + rect->w - 2;
01891                     }
01892                     uiInfo.serverStatus.motdPaintX2 = -1;
01893                 }
01894             } else {
01895                 //serverStatus.motdPaintX--;
01896                 uiInfo.serverStatus.motdPaintX -= 2;
01897                 if (uiInfo.serverStatus.motdPaintX2 >= 0) {
01898                     //serverStatus.motdPaintX2--;
01899                     uiInfo.serverStatus.motdPaintX2 -= 2;
01900                 }
01901             }
01902         }
01903 
01904         maxX = rect->x + rect->w - 2;
01905         Text_Paint_Limit(&maxX, uiInfo.serverStatus.motdPaintX, rect->y + rect->h - 3, scale, color, &uiInfo.serverStatus.motd[uiInfo.serverStatus.motdOffset], 0, 0); 
01906         if (uiInfo.serverStatus.motdPaintX2 >= 0) {
01907             float maxX2 = rect->x + rect->w - 2;
01908             Text_Paint_Limit(&maxX2, uiInfo.serverStatus.motdPaintX2, rect->y + rect->h - 3, scale, color, uiInfo.serverStatus.motd, 0, uiInfo.serverStatus.motdOffset); 
01909         }
01910         if (uiInfo.serverStatus.motdOffset && maxX > 0) {
01911             // if we have an offset ( we are skipping the first part of the string ) and we fit the string
01912             if (uiInfo.serverStatus.motdPaintX2 == -1) {
01913                         uiInfo.serverStatus.motdPaintX2 = rect->x + rect->w - 2;
01914             }
01915         } else {
01916             uiInfo.serverStatus.motdPaintX2 = -1;
01917         }
01918 
01919     }
01920 }

Here is the call graph for this function:

void UI_DrawServerRefreshDate rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1847 of file ui_main.c.

References vmCvar_t::integer, LerpColor(), PULSE_DIVISOR, Q_strncpyz(), displayContextDef_t::realTime, rect, serverStatus_s::refreshActive, uiInfo_t::serverStatus, sin(), Text_Paint(), trap_LAN_GetServerCount(), UI_Cvar_VariableString(), ui_netSource, uiInfo_t::uiDC, uiInfo, and va().

Referenced by UI_OwnerDraw().

01847                                                                                                 {
01848     if (uiInfo.serverStatus.refreshActive) {
01849         vec4_t lowLight, newColor;
01850         lowLight[0] = 0.8 * color[0]; 
01851         lowLight[1] = 0.8 * color[1]; 
01852         lowLight[2] = 0.8 * color[2]; 
01853         lowLight[3] = 0.8 * color[3]; 
01854         LerpColor(color,lowLight,newColor,0.5+0.5*sin(uiInfo.uiDC.realTime / PULSE_DIVISOR));
01855       Text_Paint(rect->x, rect->y, scale, newColor, va("Getting info for %d servers (ESC to cancel)", trap_LAN_GetServerCount(ui_netSource.integer)), 0, 0, textStyle);
01856     } else {
01857         char buff[64];
01858         Q_strncpyz(buff, UI_Cvar_VariableString(va("ui_lastServerRefresh_%i", ui_netSource.integer)), 64);
01859       Text_Paint(rect->x, rect->y, scale, color, va("Refresh Time: %s", buff), 0, 0, textStyle);
01860     }
01861 }

Here is the call graph for this function:

void UI_DrawSkill rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1143 of file ui_main.c.

References i, rect, skillLevels, Text_Paint(), and trap_Cvar_VariableValue().

Referenced by UI_OwnerDraw().

01143                                                                                     {
01144   int i;
01145     i = trap_Cvar_VariableValue( "g_spSkill" );
01146   if (i < 1 || i > numSkillLevels) {
01147     i = 1;
01148   }
01149   Text_Paint(rect->x, rect->y, scale, color, skillLevels[i-1],0, 0, textStyle);
01150 }

Here is the call graph for this function:

void UI_DrawTeamMember rectDef_t rect,
float  scale,
vec4_t  color,
qboolean  blue,
int  num,
int  textStyle
[static]
 

Definition at line 1161 of file ui_main.c.

References blue, uiInfo_t::characterCount, uiInfo_t::characterList, vmCvar_t::integer, characterInfo::name, rect, Text_Paint(), trap_Cvar_VariableValue(), ui_actualNetGameType, UI_GetBotNameByNumber(), UI_GetNumBots(), uiInfo, va(), and value.

Referenced by UI_OwnerDraw().

01161                                                                                                                  {
01162     // 0 - None
01163     // 1 - Human
01164     // 2..NumCharacters - Bot
01165     int value = trap_Cvar_VariableValue(va(blue ? "ui_blueteam%i" : "ui_redteam%i", num));
01166     const char *text;
01167     if (value <= 0) {
01168         text = "Closed";
01169     } else if (value == 1) {
01170         text = "Human";
01171     } else {
01172         value -= 2;
01173 
01174         if (ui_actualNetGameType.integer >= GT_TEAM) {
01175             if (value >= uiInfo.characterCount) {
01176                 value = 0;
01177             }
01178             text = uiInfo.characterList[value].name;
01179         } else {
01180             if (value >= UI_GetNumBots()) {
01181                 value = 0;
01182             }
01183             text = UI_GetBotNameByNumber(value);
01184         }
01185     }
01186   Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle);
01187 }

Here is the call graph for this function:

void UI_DrawTeamName rectDef_t rect,
float  scale,
vec4_t  color,
qboolean  blue,
int  textStyle
[static]
 

Definition at line 1153 of file ui_main.c.

References blue, i, rect, uiInfo_t::teamCount, uiInfo_t::teamList, teamInfo::teamName, Text_Paint(), UI_Cvar_VariableString(), UI_TeamIndexFromName(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01153                                                                                                       {
01154   int i;
01155   i = UI_TeamIndexFromName(UI_Cvar_VariableString((blue) ? "ui_blueTeam" : "ui_redTeam"));
01156   if (i >= 0 && i < uiInfo.teamCount) {
01157     Text_Paint(rect->x, rect->y, scale, color, va("%s: %s", (blue) ? "Blue" : "Red", uiInfo.teamList[i].teamName),0, 0, textStyle);
01158   }
01159 }

Here is the call graph for this function:

void UI_DrawTier rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1354 of file ui_main.c.

References i, rect, Text_Paint(), uiInfo_t::tierCount, uiInfo_t::tierList, tierInfo::tierName, trap_Cvar_VariableValue(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01354                                                                                    {
01355   int i;
01356     i = trap_Cvar_VariableValue( "ui_currentTier" );
01357   if (i < 0 || i >= uiInfo.tierCount) {
01358     i = 0;
01359   }
01360   Text_Paint(rect->x, rect->y, scale, color, va("Tier: %s", uiInfo.tierList[i].tierName),0, 0, textStyle);
01361 }

Here is the call graph for this function:

void UI_DrawTierGameType rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1401 of file ui_main.c.

References tierInfo::gameTypes, uiInfo_t::gameTypes, i, j, rect, Text_Paint(), uiInfo_t::tierCount, uiInfo_t::tierList, trap_Cvar_VariableValue(), and uiInfo.

Referenced by UI_OwnerDraw().

01401                                                                                            {
01402   int i, j;
01403     i = trap_Cvar_VariableValue( "ui_currentTier" );
01404   if (i < 0 || i >= uiInfo.tierCount) {
01405     i = 0;
01406   }
01407     j = trap_Cvar_VariableValue("ui_currentMap");
01408     if (j < 0 || j > MAPS_PER_TIER) {
01409         j = 0;
01410     }
01411 
01412   Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[uiInfo.tierList[i].gameTypes[j]].gameType , 0, 0, textStyle);
01413 }

Here is the call graph for this function:

void UI_DrawTierMap rectDef_t rect,
int  index
[static]
 

Definition at line 1363 of file ui_main.c.

References i, tierInfo::mapHandles, tierInfo::maps, rect, uiInfo_t::tierCount, uiInfo_t::tierList, trap_Cvar_VariableValue(), trap_R_RegisterShaderNoMip(), UI_DrawHandlePic(), uiInfo, and va().

Referenced by UI_OwnerDraw().

01363                                                        {
01364   int i;
01365     i = trap_Cvar_VariableValue( "ui_currentTier" );
01366   if (i < 0 || i >= uiInfo.tierCount) {
01367     i = 0;
01368   }
01369 
01370     if (uiInfo.tierList[i].mapHandles[index] == -1) {
01371         uiInfo.tierList[i].mapHandles[index] = trap_R_RegisterShaderNoMip(va("levelshots/%s", uiInfo.tierList[i].maps[index]));
01372     }
01373                                                  
01374     UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.tierList[i].mapHandles[index]);
01375 }

Here is the call graph for this function:

void UI_DrawTierMapName rectDef_t rect,
float  scale,
vec4_t  color,
int  textStyle
[static]
 

Definition at line 1387 of file ui_main.c.

References i, j, tierInfo::maps, rect, Text_Paint(), uiInfo_t::tierCount, uiInfo_t::tierList, trap_Cvar_VariableValue(), UI_EnglishMapName(), and uiInfo.

Referenced by UI_OwnerDraw().

01387                                                                                           {
01388   int i, j;
01389     i = trap_Cvar_VariableValue( "ui_currentTier" );
01390   if (i < 0 || i >= uiInfo.tierCount) {
01391     i = 0;
01392   }
01393     j = trap_Cvar_VariableValue("ui_currentMap");
01394     if (j < 0 || j > MAPS_PER_TIER) {
01395         j = 0;
01396     }
01397 
01398   Text_Paint(rect->x, rect->y, scale, color, UI_EnglishMapName(uiInfo.tierList[i].maps[j]), 0, 0, textStyle);
01399 }

Here is the call graph for this function:

qboolean UI_Effects_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2279 of file ui_main.c.

References uiInfo_t::effectsColor, K_ENTER, K_MOUSE1, K_MOUSE2, qboolean, trap_Cvar_SetValue(), uiInfo, and uitogamecode.

Referenced by UI_OwnerDrawHandleKey().

02279                                                                          {
02280   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02281 
02282         if (key == K_MOUSE2) {
02283         uiInfo.effectsColor--;
02284         } else {
02285         uiInfo.effectsColor++;
02286         }
02287 
02288     if( uiInfo.effectsColor > 6 ) {
02289         uiInfo.effectsColor = 0;
02290         } else if (uiInfo.effectsColor < 0) {
02291         uiInfo.effectsColor = 6;
02292         }
02293 
02294       trap_Cvar_SetValue( "color1", uitogamecode[uiInfo.effectsColor] );
02295     return qtrue;
02296   }
02297   return qfalse;
02298 }

Here is the call graph for this function:

const char* UI_EnglishMapName const char *  map  )  [static]
 

Definition at line 1377 of file ui_main.c.

References i, uiInfo_t::mapCount, uiInfo_t::mapList, mapInfo::mapLoadName, mapInfo::mapName, Q_stricmp(), and uiInfo.

Referenced by UI_DrawTierMapName().

01377                                                       {
01378     int i;
01379     for (i = 0; i < uiInfo.mapCount; i++) {
01380         if (Q_stricmp(map, uiInfo.mapList[i].mapLoadName) == 0) {
01381             return uiInfo.mapList[i].mapName;
01382         }
01383     }
01384     return "";
01385 }

Here is the call graph for this function:

int UI_FeederCount float  feederID  )  [static]
 

Definition at line 4190 of file ui_main.c.

References uiInfo_t::demoCount, FEEDER_MAPS, uiInfo_t::modCount, uiInfo_t::movieCount, uiInfo_t::myTeamCount, serverStatus_s::numDisplayServers, uiInfo_t::numFoundPlayerServers, serverStatusInfo_t::numLines, uiInfo_t::playerCount, uiInfo_t::playerRefresh, uiInfo_t::q3HeadCount, qfalse, qtrue, displayContextDef_t::realTime, uiInfo_t::serverStatus, uiInfo_t::serverStatusInfo, UI_BuildPlayerList(), UI_HeadCountByTeam(), UI_MapCountByGameType(), uiInfo_t::uiDC, and uiInfo.

04190                                           {
04191     if (feederID == FEEDER_HEADS) {
04192         return UI_HeadCountByTeam();
04193     } else if (feederID == FEEDER_Q3HEADS) {
04194         return uiInfo.q3HeadCount;
04195     } else if (feederID == FEEDER_CINEMATICS) {
04196         return uiInfo.movieCount;
04197     } else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS) {
04198         return UI_MapCountByGameType(feederID == FEEDER_MAPS ? qtrue : qfalse);
04199     } else if (feederID == FEEDER_SERVERS) {
04200         return uiInfo.serverStatus.numDisplayServers;
04201     } else if (feederID == FEEDER_SERVERSTATUS) {
04202         return uiInfo.serverStatusInfo.numLines;
04203     } else if (feederID == FEEDER_FINDPLAYER) {
04204         return uiInfo.numFoundPlayerServers;
04205     } else if (feederID == FEEDER_PLAYER_LIST) {
04206         if (uiInfo.uiDC.realTime > uiInfo.playerRefresh) {
04207             uiInfo.playerRefresh = uiInfo.uiDC.realTime + 3000;
04208             UI_BuildPlayerList();
04209         }
04210         return uiInfo.playerCount;
04211     } else if (feederID == FEEDER_TEAM_LIST) {
04212         if (uiInfo.uiDC.realTime > uiInfo.playerRefresh) {
04213             uiInfo.playerRefresh = uiInfo.uiDC.realTime + 3000;
04214             UI_BuildPlayerList();
04215         }
04216         return uiInfo.myTeamCount;
04217     } else if (feederID == FEEDER_MODS) {
04218         return uiInfo.modCount;
04219     } else if (feederID == FEEDER_DEMOS) {
04220         return uiInfo.demoCount;
04221     }
04222     return 0;
04223 }

Here is the call graph for this function:

qhandle_t UI_FeederItemImage float  feederID,
int  index
[static]
 

Definition at line 4392 of file ui_main.c.

References uiInfo_t::characterCount, uiInfo_t::characterList, FEEDER_ALLMAPS, characterInfo::headImage, mapInfo::imageName, characterInfo::imageName, mapInfo::levelShot, uiInfo_t::mapCount, uiInfo_t::mapList, uiInfo_t::q3HeadCount, uiInfo_t::q3HeadIcons, qhandle_t, trap_R_RegisterShaderNoMip(), UI_SelectedHead(), UI_SelectedMap(), and uiInfo.

04392                                                                {
04393   if (feederID == FEEDER_HEADS) {
04394     int actual;
04395     UI_SelectedHead(index, &actual);
04396     index = actual;
04397     if (index >= 0 && index < uiInfo.characterCount) {
04398         if (uiInfo.characterList[index].headImage == -1) {
04399             uiInfo.characterList[index].headImage = trap_R_RegisterShaderNoMip(uiInfo.characterList[index].imageName);
04400         }
04401         return uiInfo.characterList[index].headImage;
04402     }
04403   } else if (feederID == FEEDER_Q3HEADS) {
04404     if (index >= 0 && index < uiInfo.q3HeadCount) {
04405       return uiInfo.q3HeadIcons[index];
04406     }
04407     } else if (feederID == FEEDER_ALLMAPS || feederID == FEEDER_MAPS) {
04408         int actual;
04409         UI_SelectedMap(index, &actual);
04410         index = actual;
04411         if (index >= 0 && index < uiInfo.mapCount) {
04412             if (uiInfo.mapList[index].levelShot == -1) {
04413                 uiInfo.mapList[index].levelShot = trap_R_RegisterShaderNoMip(uiInfo.mapList[index].imageName);
04414             }
04415             return uiInfo.mapList[index].levelShot;
04416         }
04417     }
04418   return 0;
04419 }

Here is the call graph for this function:

const char* UI_FeederItemText float  feederID,
int  index,
int  column,
qhandle_t handle
[static]
 

Definition at line 4280 of file ui_main.c.

References atoi, Com_sprintf(), uiInfo_t::demoCount, uiInfo_t::demoList, serverStatus_s::displayServers, FEEDER_MAPS, uiInfo_t::foundPlayerServerNames, Info_ValueForKey(), vmCvar_t::integer, serverStatusInfo_t::lines, MAX_STRING_CHARS, uiInfo_t::modCount, modInfo_t::modDescr, uiInfo_t::modList, modInfo_t::modName, uiInfo_t::movieCount, uiInfo_t::movieList, uiInfo_t::myTeamCount, netnames, serverStatus_s::numDisplayServers, uiInfo_t::numFoundPlayerServers, serverStatusInfo_t::numLines, uiInfo_t::playerCount, uiInfo_t::playerNames, uiInfo_t::q3HeadCount, uiInfo_t::q3HeadNames, displayContextDef_t::realTime, uiInfo_t::serverStatus, uiInfo_t::serverStatusInfo, SORT_CLIENTS, SORT_GAME, SORT_HOST, SORT_MAP, SORT_PING, SORT_PUNKBUSTER, teamArenaGameTypes, uiInfo_t::teamNames, trap_LAN_GetServerInfo(), ui_netSource, UI_SelectedHead(), UI_SelectedMap(), uiInfo_t::uiDC, and uiInfo.

04280                                                                                                {
04281     static char info[MAX_STRING_CHARS];
04282     static char hostname[1024];
04283     static char clientBuff[32];
04284     static int lastColumn = -1;
04285     static int lastTime = 0;
04286     *handle = -1;
04287     if (feederID == FEEDER_HEADS) {
04288         int actual;
04289         return UI_SelectedHead(index, &actual);
04290     } else if (feederID == FEEDER_Q3HEADS) {
04291         if (index >= 0 && index < uiInfo.q3HeadCount) {
04292             return uiInfo.q3HeadNames[index];
04293         }
04294     } else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS) {
04295         int actual;
04296         return UI_SelectedMap(index, &actual);
04297     } else if (feederID == FEEDER_SERVERS) {
04298         if (index >= 0 && index < uiInfo.serverStatus.numDisplayServers) {
04299             int ping, game, punkbuster;
04300             if (lastColumn != column || lastTime > uiInfo.uiDC.realTime + 5000) {
04301                 trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[index], info, MAX_STRING_CHARS);
04302                 lastColumn = column;
04303                 lastTime = uiInfo.uiDC.realTime;
04304             }
04305             ping = atoi(Info_ValueForKey(info, "ping"));
04306             if (ping == -1) {
04307                 // if we ever see a ping that is out of date, do a server refresh
04308                 // UI_UpdatePendingPings();
04309             }
04310             switch (column) {
04311                 case SORT_HOST : 
04312                     if (ping <= 0) {
04313                         return Info_ValueForKey(info, "addr");
04314                     } else {
04315                         if ( ui_netSource.integer == AS_LOCAL ) {
04316                             Com_sprintf( hostname, sizeof(hostname), "%s [%s]",
04317                                             Info_ValueForKey(info, "hostname"),
04318                                             netnames[atoi(Info_ValueForKey(info, "nettype"))] );
04319                             return hostname;
04320                         }
04321                         else {
04322                             Com_sprintf( hostname, sizeof(hostname), "%s", Info_ValueForKey(info, "hostname"));
04323                             return hostname;
04324                         }
04325                     }
04326                 case SORT_MAP : return Info_ValueForKey(info, "mapname");
04327                 case SORT_CLIENTS : 
04328                     Com_sprintf( clientBuff, sizeof(clientBuff), "%s (%s)", Info_ValueForKey(info, "clients"), Info_ValueForKey(info, "sv_maxclients"));
04329                     return clientBuff;
04330                 case SORT_GAME : 
04331                     game = atoi(Info_ValueForKey(info, "gametype"));
04332                     if (game >= 0 && game < numTeamArenaGameTypes) {
04333                         return teamArenaGameTypes[game];
04334                     } else {
04335                         return "Unknown";
04336                     }
04337                 case SORT_PING : 
04338                     if (ping <= 0) {
04339                         return "...";
04340                     } else {
04341                         return Info_ValueForKey(info, "ping");
04342                     }
04343                 case SORT_PUNKBUSTER:
04344                     punkbuster = atoi(Info_ValueForKey(info, "punkbuster"));
04345                     if ( punkbuster ) {
04346                         return "Yes";
04347                     } else {
04348                         return "No";
04349                     }
04350             }
04351         }
04352     } else if (feederID == FEEDER_SERVERSTATUS) {
04353         if ( index >= 0 && index < uiInfo.serverStatusInfo.numLines ) {
04354             if ( column >= 0 && column < 4 ) {
04355                 return uiInfo.serverStatusInfo.lines[index][column];
04356             }
04357         }
04358     } else if (feederID == FEEDER_FINDPLAYER) {
04359         if ( index >= 0 && index < uiInfo.numFoundPlayerServers ) {
04360             //return uiInfo.foundPlayerServerAddresses[index];
04361             return uiInfo.foundPlayerServerNames[index];
04362         }
04363     } else if (feederID == FEEDER_PLAYER_LIST) {
04364         if (index >= 0 && index < uiInfo.playerCount) {
04365             return uiInfo.playerNames[index];
04366         }
04367     } else if (feederID == FEEDER_TEAM_LIST) {
04368         if (index >= 0 && index < uiInfo.myTeamCount) {
04369             return uiInfo.teamNames[index];
04370         }
04371     } else if (feederID == FEEDER_MODS) {
04372         if (index >= 0 && index < uiInfo.modCount) {
04373             if (uiInfo.modList[index].modDescr && *uiInfo.modList[index].modDescr) {
04374                 return uiInfo.modList[index].modDescr;
04375             } else {
04376                 return uiInfo.modList[index].modName;
04377             }
04378         }
04379     } else if (feederID == FEEDER_CINEMATICS) {
04380         if (index >= 0 && index < uiInfo.movieCount) {
04381             return uiInfo.movieList[index];
04382         }
04383     } else if (feederID == FEEDER_DEMOS) {
04384         if (index >= 0 && index < uiInfo.demoCount) {
04385             return uiInfo.demoList[index];
04386         }
04387     }
04388     return "";
04389 }

Here is the call graph for this function:

void UI_FeederSelection float  feederID,
int  index
[static]
 

Definition at line 4421 of file ui_main.c.

References characterInfo::base, uiInfo_t::characterCount, uiInfo_t::characterList, CIN_loop, CIN_silent, mapInfo::cinematic, uiInfo_t::currentFoundPlayerServer, serverStatus_s::currentServer, serverStatus_s::currentServerCinematic, serverStatus_s::currentServerPreview, uiInfo_t::demoIndex, serverStatus_s::displayServers, FEEDER_MAPS, FEEDER_SERVERSTATUS, uiInfo_t::foundPlayerServerAddresses, uiInfo_t::gameTypes, Info_ValueForKey(), vmCvar_t::integer, uiInfo_t::mapList, MAX_STRING_CHARS, Menu_SetFeederSelection(), uiInfo_t::modIndex, uiInfo_t::movieIndex, characterInfo::name, NULL, uiInfo_t::numFoundPlayerServers, uiInfo_t::playerIndex, uiInfo_t::previewMovie, uiInfo_t::q3HeadCount, uiInfo_t::q3HeadNames, Q_strncpyz(), qtrue, uiInfo_t::serverStatus, uiInfo_t::serverStatusAddress, uiInfo_t::teamIndex, trap_CIN_PlayCinematic(), trap_CIN_StopCinematic(), trap_Cvar_Set(), trap_LAN_GetServerInfo(), trap_R_RegisterShaderNoMip(), UI_BuildServerStatus(), ui_currentMap, ui_currentNetMap, ui_gameType, UI_LoadBestScores(), ui_mapIndex, ui_netSource, UI_SelectedHead(), UI_SelectedMap(), uiInfo, updateModel, updateOpponentModel, and va().

Referenced by UI_BuildFindPlayerList(), UI_ClanName_HandleKey(), and UI_RunMenuScript().

04421                                                           {
04422     static char info[MAX_STRING_CHARS];
04423   if (feederID == FEEDER_HEADS) {
04424     int actual;
04425     UI_SelectedHead(index, &actual);
04426     index = actual;
04427     if (index >= 0 && index < uiInfo.characterCount) {
04428         trap_Cvar_Set( "team_model", va("%s", uiInfo.characterList[index].base));
04429         trap_Cvar_Set( "team_headmodel", va("*%s", uiInfo.characterList[index].name)); 
04430         updateModel = qtrue;
04431     }
04432   } else if (feederID == FEEDER_Q3HEADS) {
04433     if (index >= 0 && index < uiInfo.q3HeadCount) {
04434       trap_Cvar_Set( "model", uiInfo.q3HeadNames[index]);
04435       trap_Cvar_Set( "headmodel", uiInfo.q3HeadNames[index]);
04436             updateModel = qtrue;
04437         }
04438   } else if (feederID == FEEDER_MAPS || feederID == FEEDER_ALLMAPS) {
04439         int actual, map;
04440         map = (feederID == FEEDER_ALLMAPS) ? ui_currentNetMap.integer : ui_currentMap.integer;
04441         if (uiInfo.mapList[map].cinematic >= 0) {
04442           trap_CIN_StopCinematic(uiInfo.mapList[map].cinematic);
04443           uiInfo.mapList[map].cinematic = -1;
04444         }
04445         UI_SelectedMap(index, &actual);
04446         trap_Cvar_Set("ui_mapIndex", va("%d", index));
04447         ui_mapIndex.integer = index;
04448 
04449         if (feederID == FEEDER_MAPS) {
04450             ui_currentMap.integer = actual;
04451             trap_Cvar_Set("ui_currentMap", va("%d", actual));
04452         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) );
04453             UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum);
04454             trap_Cvar_Set("ui_opponentModel", uiInfo.mapList[ui_currentMap.integer].opponentName);
04455             updateOpponentModel = qtrue;
04456         } else {
04457             ui_currentNetMap.integer = actual;
04458             trap_Cvar_Set("ui_currentNetMap", va("%d", actual));
04459         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) );
04460         }
04461 
04462   } else if (feederID == FEEDER_SERVERS) {
04463         const char *mapName = NULL;
04464         uiInfo.serverStatus.currentServer = index;
04465         trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[index], info, MAX_STRING_CHARS);
04466         uiInfo.serverStatus.currentServerPreview = trap_R_RegisterShaderNoMip(va("levelshots/%s", Info_ValueForKey(info, "mapname")));
04467         if (uiInfo.serverStatus.currentServerCinematic >= 0) {
04468           trap_CIN_StopCinematic(uiInfo.serverStatus.currentServerCinematic);
04469             uiInfo.serverStatus.currentServerCinematic = -1;
04470         }
04471         mapName = Info_ValueForKey(info, "mapname");
04472         if (mapName && *mapName) {
04473             uiInfo.serverStatus.currentServerCinematic = trap_CIN_PlayCinematic(va("%s.roq", mapName), 0, 0, 0, 0, (CIN_loop | CIN_silent) );
04474         }
04475   } else if (feederID == FEEDER_SERVERSTATUS) {
04476         //
04477   } else if (feederID == FEEDER_FINDPLAYER) {
04478       uiInfo.currentFoundPlayerServer = index;
04479       //
04480       if ( index < uiInfo.numFoundPlayerServers-1) {
04481             // build a new server status for this server
04482             Q_strncpyz(uiInfo.serverStatusAddress, uiInfo.foundPlayerServerAddresses[uiInfo.currentFoundPlayerServer], sizeof(uiInfo.serverStatusAddress));
04483             Menu_SetFeederSelection(NULL, FEEDER_SERVERSTATUS, 0, NULL);
04484             UI_BuildServerStatus(qtrue);
04485       }
04486   } else if (feederID == FEEDER_PLAYER_LIST) {
04487         uiInfo.playerIndex = index;
04488   } else if (feederID == FEEDER_TEAM_LIST) {
04489         uiInfo.teamIndex = index;
04490   } else if (feederID == FEEDER_MODS) {
04491         uiInfo.modIndex = index;
04492   } else if (feederID == FEEDER_CINEMATICS) {
04493         uiInfo.movieIndex = index;
04494         if (uiInfo.previewMovie >= 0) {
04495           trap_CIN_StopCinematic(uiInfo.previewMovie);
04496         }
04497         uiInfo.previewMovie = -1;
04498   } else if (feederID == FEEDER_DEMOS) {
04499         uiInfo.demoIndex = index;
04500     }
04501 }

Here is the call graph for this function:

qboolean UI_GameType_HandleKey int  flags,
float *  special,
int  key,
qboolean  resetMap
[static]
 

Definition at line 2327 of file ui_main.c.

References FEEDER_MAPS, uiInfo_t::gameTypes, gameTypeInfo::gtEnum, vmCvar_t::integer, K_ENTER, K_MOUSE1, K_MOUSE2, uiInfo_t::mapList, Menu_SetFeederSelection(), NULL, uiInfo_t::numGameTypes, qboolean, qtrue, trap_Cvar_Set(), ui_currentMap, ui_gameType, UI_LoadBestScores(), UI_MapCountByGameType(), UI_SetCapFragLimits(), uiInfo, and va().

Referenced by UI_OwnerDrawHandleKey(), UI_RunMenuScript(), and UI_StartSkirmish().

02327                                                                                              {
02328   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02329         int oldCount = UI_MapCountByGameType(qtrue);
02330 
02331         // hard coded mess here
02332         if (key == K_MOUSE2) {
02333             ui_gameType.integer--;
02334             if (ui_gameType.integer == 2) {
02335                 ui_gameType.integer = 1;
02336             } else if (ui_gameType.integer < 2) {
02337                 ui_gameType.integer = uiInfo.numGameTypes - 1;
02338             }
02339         } else {
02340             ui_gameType.integer++;
02341             if (ui_gameType.integer >= uiInfo.numGameTypes) {
02342                 ui_gameType.integer = 1;
02343             } else if (ui_gameType.integer == 2) {
02344                 ui_gameType.integer = 3;
02345             }
02346         }
02347     
02348         if (uiInfo.gameTypes[ui_gameType.integer].gtEnum == GT_TOURNAMENT) {
02349             trap_Cvar_Set("ui_Q3Model", "1");
02350         } else {
02351             trap_Cvar_Set("ui_Q3Model", "0");
02352         }
02353 
02354         trap_Cvar_Set("ui_gameType", va("%d", ui_gameType.integer));
02355         UI_SetCapFragLimits(qtrue);
02356         UI_LoadBestScores(uiInfo.mapList[ui_currentMap.integer].mapLoadName, uiInfo.gameTypes[ui_gameType.integer].gtEnum);
02357         if (resetMap && oldCount != UI_MapCountByGameType(qtrue)) {
02358         trap_Cvar_Set( "ui_currentMap", "0");
02359             Menu_SetFeederSelection(NULL, FEEDER_MAPS, 0, NULL);
02360         }
02361     return qtrue;
02362   }
02363   return qfalse;
02364 }

Here is the call graph for this function:

int UI_GetIndexFromSelection int  actual  )  [static]
 

Definition at line 4259 of file ui_main.c.

References mapInfo::active, c, i, uiInfo_t::mapCount, uiInfo_t::mapList, and uiInfo.

Referenced by UI_RunMenuScript().

04259                                                 {
04260     int i, c;
04261     c = 0;
04262     for (i = 0; i < uiInfo.mapCount; i++) {
04263         if (uiInfo.mapList[i].active) {
04264             if (i == actual) {
04265                 return c;
04266             }
04267                 c++;
04268         }
04269     }
04270   return 0;
04271 }

int UI_GetServerStatusInfo const char *  serverAddress,
serverStatusInfo_t info
[static]
 

Definition at line 3905 of file ui_main.c.

References Com_sprintf(), i, MAX_SERVERSTATUS_LINES, memset(), name, NULL, p, Q_strncpyz(), strchr(), strlen(), trap_LAN_ServerStatus(), and UI_SortServerStatusInfo().

Referenced by UI_BuildFindPlayerList(), and UI_BuildServerStatus().

03905                                                                                          {
03906     char *p, *score, *ping, *name;
03907     int i, len;
03908 
03909     if (!info) {
03910         trap_LAN_ServerStatus( serverAddress, NULL, 0);
03911         return qfalse;
03912     }
03913     memset(info, 0, sizeof(*info));
03914     if ( trap_LAN_ServerStatus( serverAddress, info->text, sizeof(info->text)) ) {
03915         Q_strncpyz(info->address, serverAddress, sizeof(info->address));
03916         p = info->text;
03917         info->numLines = 0;
03918         info->lines[info->numLines][0] = "Address";
03919         info->lines[info->numLines][1] = "";
03920         info->lines[info->numLines][2] = "";
03921         info->lines[info->numLines][3] = info->address;
03922         info->numLines++;
03923         // get the cvars
03924         while (p && *p) {
03925             p = strchr(p, '\\');
03926             if (!p) break;
03927             *p++ = '\0';
03928             if (*p == '\\')
03929                 break;
03930             info->lines[info->numLines][0] = p;
03931             info->lines[info->numLines][1] = "";
03932             info->lines[info->numLines][2] = "";
03933             p = strchr(p, '\\');
03934             if (!p) break;
03935             *p++ = '\0';
03936             info->lines[info->numLines][3] = p;
03937 
03938             info->numLines++;
03939             if (info->numLines >= MAX_SERVERSTATUS_LINES)
03940                 break;
03941         }
03942         // get the player list
03943         if (info->numLines < MAX_SERVERSTATUS_LINES-3) {
03944             // empty line
03945             info->lines[info->numLines][0] = "";
03946             info->lines[info->numLines][1] = "";
03947             info->lines[info->numLines][2] = "";
03948             info->lines[info->numLines][3] = "";
03949             info->numLines++;
03950             // header
03951             info->lines[info->numLines][0] = "num";
03952             info->lines[info->numLines][1] = "score";
03953             info->lines[info->numLines][2] = "ping";
03954             info->lines[info->numLines][3] = "name";
03955             info->numLines++;
03956             // parse players
03957             i = 0;
03958             len = 0;
03959             while (p && *p) {
03960                 if (*p == '\\')
03961                     *p++ = '\0';
03962                 if (!p)
03963                     break;
03964                 score = p;
03965                 p = strchr(p, ' ');
03966                 if (!p)
03967                     break;
03968                 *p++ = '\0';
03969                 ping = p;
03970                 p = strchr(p, ' ');
03971                 if (!p)
03972                     break;
03973                 *p++ = '\0';
03974                 name = p;
03975                 Com_sprintf(&info->pings[len], sizeof(info->pings)-len, "%d", i);
03976                 info->lines[info->numLines][0] = &info->pings[len];
03977                 len += strlen(&info->pings[len]) + 1;
03978                 info->lines[info->numLines][1] = score;
03979                 info->lines[info->numLines][2] = ping;
03980                 info->lines[info->numLines][3] = name;
03981                 info->numLines++;
03982                 if (info->numLines >= MAX_SERVERSTATUS_LINES)
03983                     break;
03984                 p = strchr(p, '\\');
03985                 if (!p)
03986                     break;
03987                 *p++ = '\0';
03988                 //
03989                 i++;
03990             }
03991         }
03992         UI_SortServerStatusInfo( info );
03993         return qtrue;
03994     }
03995     return qfalse;
03996 }

Here is the call graph for this function:

void UI_GetTeamColor vec4_t color  )  [static]
 

Definition at line 3540 of file ui_main.c.

03540                                            {
03541 }

float UI_GetValue int  ownerDraw  )  [static]
 

Definition at line 2740 of file ui_main.c.

02740                                         {
02741   return 0;
02742 }

qboolean UI_Handicap_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2259 of file ui_main.c.

References Com_Clamp(), h(), K_ENTER, K_MOUSE1, K_MOUSE2, qboolean, trap_Cvar_Set(), trap_Cvar_VariableValue(), and va().

Referenced by UI_OwnerDrawHandleKey().

02259                                                                           {
02260   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02261     int h;
02262     h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") );
02263         if (key == K_MOUSE2) {
02264         h -= 5;
02265         } else {
02266         h += 5;
02267         }
02268     if (h > 100) {
02269       h = 5;
02270     } else if (h < 0) {
02271             h = 100;
02272         }
02273     trap_Cvar_Set( "handicap", va( "%i", h) );
02274     return qtrue;
02275   }
02276   return qfalse;
02277 }

Here is the call graph for this function:

qboolean UI_hasSkinForBase const char *  base,
const char *  team
 

Definition at line 3574 of file ui_main.c.

References Com_sprintf(), FS_READ, qboolean, test(), and trap_FS_FOpenFile().

Referenced by UI_HeadCountByTeam().

03574                                                                {
03575     char    test[1024];
03576     
03577     Com_sprintf( test, sizeof( test ), "models/players/%s/%s/lower_default.skin", base, team );
03578 
03579     if (trap_FS_FOpenFile(test, 0, FS_READ)) {
03580         return qtrue;
03581     }
03582     Com_sprintf( test, sizeof( test ), "models/players/characters/%s/%s/lower_default.skin", base, team );
03583 
03584     if (trap_FS_FOpenFile(test, 0, FS_READ)) {
03585         return qtrue;
03586     }
03587     return qfalse;
03588 }

Here is the call graph for this function:

int UI_HeadCountByTeam void   )  [static]
 

Definition at line 3595 of file ui_main.c.

References characterInfo::active, aliasInfo::ai, uiInfo_t::aliasCount, uiInfo_t::aliasList, characterInfo::base, c, uiInfo_t::characterCount, uiInfo_t::characterList, characterInfo::headImage, i, init(), j, k, characterInfo::name, aliasInfo::name, Q_stricmp(), characterInfo::reference, uiInfo_t::teamCount, uiInfo_t::teamList, teamInfo::teamMembers, teamInfo::teamName, UI_Cvar_VariableString(), UI_hasSkinForBase(), UI_TeamIndexFromName(), and uiInfo.

Referenced by UI_ClanName_HandleKey(), and UI_FeederCount().

03595                                 {
03596     static int init = 0;
03597     int i, j, k, c, tIndex;
03598     
03599     c = 0;
03600     if (!init) {
03601         for (i = 0; i < uiInfo.characterCount; i++) {
03602             uiInfo.characterList[i].reference = 0;
03603             for (j = 0; j < uiInfo.teamCount; j++) {
03604               if (UI_hasSkinForBase(uiInfo.characterList[i].base, uiInfo.teamList[j].teamName)) {
03605                     uiInfo.characterList[i].reference |= (1<<j);
03606               }
03607             }
03608         }
03609         init = 1;
03610     }
03611 
03612     tIndex = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName"));
03613 
03614     // do names
03615     for (i = 0; i < uiInfo.characterCount; i++) {
03616         uiInfo.characterList[i].active = qfalse;
03617         for(j = 0; j < TEAM_MEMBERS; j++) {
03618             if (uiInfo.teamList[tIndex].teamMembers[j] != NULL) {
03619                 if (uiInfo.characterList[i].reference&(1<<tIndex)) {// && Q_stricmp(uiInfo.teamList[tIndex].teamMembers[j], uiInfo.characterList[i].name)==0) {
03620                     uiInfo.characterList[i].active = qtrue;
03621                     c++;
03622                     break;
03623                 }
03624             }
03625         }
03626     }
03627 
03628     // and then aliases
03629     for(j = 0; j < TEAM_MEMBERS; j++) {
03630         for(k = 0; k < uiInfo.aliasCount; k++) {
03631             if (uiInfo.aliasList[k].name != NULL) {
03632                 if (Q_stricmp(uiInfo.teamList[tIndex].teamMembers[j], uiInfo.aliasList[k].name)==0) {
03633                     for (i = 0; i < uiInfo.characterCount; i++) {
03634                         if (uiInfo.characterList[i].headImage != -1 && uiInfo.characterList[i].reference&(1<<tIndex) && Q_stricmp(uiInfo.aliasList[k].ai, uiInfo.characterList[i].name)==0) {
03635                             if (uiInfo.characterList[i].active == qfalse) {
03636                                 uiInfo.characterList[i].active = qtrue;
03637                                 c++;
03638                             }
03639                             break;
03640                         }
03641                     }
03642                 }
03643             }
03644         }
03645     }
03646     return c;
03647 }

Here is the call graph for this function:

void UI_InsertServerIntoDisplayList int  num,
int  position
[static]
 

Definition at line 3654 of file ui_main.c.

References serverStatus_s::displayServers, i, serverStatus_s::numDisplayServers, uiInfo_t::serverStatus, and uiInfo.

Referenced by UI_BinaryServerInsertion().

03654                                                                   {
03655     int i;
03656 
03657     if (position < 0 || position > uiInfo.serverStatus.numDisplayServers ) {
03658         return;
03659     }
03660     //
03661     uiInfo.serverStatus.numDisplayServers++;
03662     for (i = uiInfo.serverStatus.numDisplayServers; i > position; i--) {
03663         uiInfo.serverStatus.displayServers[i] = uiInfo.serverStatus.displayServers[i-1];
03664     }
03665     uiInfo.serverStatus.displayServers[position] = num;
03666 }

qboolean UI_JoinGameType_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2391 of file ui_main.c.

References vmCvar_t::integer, K_ENTER, K_MOUSE1, K_MOUSE2, uiInfo_t::numJoinGameTypes, qboolean, qtrue, trap_Cvar_Set(), UI_BuildServerDisplayList(), ui_joinGameType, uiInfo, and va().

Referenced by UI_OwnerDrawHandleKey().

02391                                                                               {
02392     if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02393 
02394         if (key == K_MOUSE2) {
02395             ui_joinGameType.integer--;
02396         } else {
02397             ui_joinGameType.integer++;
02398         }
02399 
02400         if (ui_joinGameType.integer < 0) {
02401             ui_joinGameType.integer = uiInfo.numJoinGameTypes - 1;
02402         } else if (ui_joinGameType.integer >= uiInfo.numJoinGameTypes) {
02403             ui_joinGameType.integer = 0;
02404         }
02405 
02406         trap_Cvar_Set( "ui_joinGameType", va("%d", ui_joinGameType.integer));
02407         UI_BuildServerDisplayList(qtrue);
02408         return qtrue;
02409     }
02410     return qfalse;
02411 }

Here is the call graph for this function:

void UI_Load  ) 
 

Definition at line 984 of file ui_main.c.

References Menu_GetFocused(), Menus_ActivateByName(), Menus_CloseAll(), windowDef_t::name, NULL, qtrue, strcpy(), String_Init(), UI_Cvar_VariableString(), UI_LoadArenas(), UI_LoadMenus(), UI_ParseGameInfo(), and menuDef_t::window.

Referenced by UI_ConsoleCommand().

00984                {
00985     char lastName[1024];
00986   menuDef_t *menu = Menu_GetFocused();
00987     char *menuSet = UI_Cvar_VariableString("ui_menuFiles");
00988     if (menu && menu->window.name) {
00989         strcpy(lastName, menu->window.name);
00990     }
00991     if (menuSet == NULL || menuSet[0] == '\0') {
00992         menuSet = "ui/menus.txt";
00993     }
00994 
00995     String_Init();
00996 
00997 #ifdef PRE_RELEASE_TADEMO
00998     UI_ParseGameInfo("demogameinfo.txt");
00999 #else
01000     UI_ParseGameInfo("gameinfo.txt");
01001     UI_LoadArenas();
01002 #endif
01003 
01004     UI_LoadMenus(menuSet, qtrue);
01005     Menus_CloseAll();
01006     Menus_ActivateByName(lastName);
01007 
01008 }

Here is the call graph for this function:

void UI_LoadDemos  )  [static]
 

Definition at line 2903 of file ui_main.c.

References Com_sprintf(), uiInfo_t::demoCount, uiInfo_t::demoList, i, Q_stricmp(), Q_strupr(), String_Alloc(), strlen(), trap_Cvar_VariableValue(), trap_FS_GetFileList(), and uiInfo.

Referenced by UI_RunMenuScript().

02903                            {
02904     char    demolist[4096];
02905     char demoExt[32];
02906     char    *demoname;
02907     int     i, len;
02908 
02909     Com_sprintf(demoExt, sizeof(demoExt), "dm_%d", (int)trap_Cvar_VariableValue("protocol"));
02910 
02911     uiInfo.demoCount = trap_FS_GetFileList( "demos", demoExt, demolist, 4096 );
02912 
02913     Com_sprintf(demoExt, sizeof(demoExt), ".dm_%d", (int)trap_Cvar_VariableValue("protocol"));
02914 
02915     if (uiInfo.demoCount) {
02916         if (uiInfo.demoCount > MAX_DEMOS) {
02917             uiInfo.demoCount = MAX_DEMOS;
02918         }
02919         demoname = demolist;
02920         for ( i = 0; i < uiInfo.demoCount; i++ ) {
02921             len = strlen( demoname );
02922             if (!Q_stricmp(demoname +  len - strlen(demoExt), demoExt)) {
02923                 demoname[len-strlen(demoExt)] = '\0';
02924             }
02925             Q_strupr(demoname);
02926             uiInfo.demoList[i] = String_Alloc(demoname);
02927             demoname += len + 1;
02928         }
02929     }
02930 
02931 }

Here is the call graph for this function:

void UI_LoadMenus const char *  menuFile,
qboolean  reset
 

Definition at line 937 of file ui_main.c.

References Com_Printf(), vmCvar_t::integer, Load_Menu(), Menu_Reset(), pc_token_t, Q_stricmp(), S_COLOR_RED, S_COLOR_YELLOW, pc_token_s::string, token, trap_Error(), trap_Milliseconds(), trap_PC_FreeSource(), trap_PC_LoadSource(), trap_PC_ReadToken(), ui_new, and va().

Referenced by _UI_Init(), UI_Load(), and UI_LoadNonIngame().

00937                                                         {
00938     pc_token_t token;
00939     int handle;
00940     int start;
00941 
00942     start = trap_Milliseconds();
00943 
00944     handle = trap_PC_LoadSource( menuFile );
00945     if (!handle) {
00946         trap_Error( va( S_COLOR_YELLOW "menu file not found: %s, using default\n", menuFile ) );
00947         handle = trap_PC_LoadSource( "ui/menus.txt" );
00948         if (!handle) {
00949             trap_Error( va( S_COLOR_RED "default menu file not found: ui/menus.txt, unable to continue!\n", menuFile ) );
00950         }
00951     }
00952 
00953     ui_new.integer = 1;
00954 
00955     if (reset) {
00956         Menu_Reset();
00957     }
00958 
00959     while ( 1 ) {
00960         if (!trap_PC_ReadToken(handle, &token))
00961             break;
00962         if( token.string[0] == 0 || token.string[0] == '}') {
00963             break;
00964         }
00965 
00966         if ( token.string[0] == '}' ) {
00967             break;
00968         }
00969 
00970         if (Q_stricmp(token.string, "loadmenu") == 0) {
00971             if (Load_Menu(handle)) {
00972                 continue;
00973             } else {
00974                 break;
00975             }
00976         }
00977     }
00978 
00979     Com_Printf("UI menu load time = %d milli seconds\n", trap_Milliseconds() - start);
00980 
00981     trap_PC_FreeSource( handle );
00982 }

Here is the call graph for this function:

void UI_LoadMods  )  [static]
 

Definition at line 2816 of file ui_main.c.

References i, uiInfo_t::modCount, modInfo_t::modDescr, uiInfo_t::modList, modInfo_t::modName, String_Alloc(), strlen(), trap_FS_GetFileList(), and uiInfo.

Referenced by UI_RunMenuScript().

02816                           {
02817     int     numdirs;
02818     char    dirlist[2048];
02819     char    *dirptr;
02820   char  *descptr;
02821     int     i;
02822     int     dirlen;
02823 
02824     uiInfo.modCount = 0;
02825     numdirs = trap_FS_GetFileList( "$modlist", "", dirlist, sizeof(dirlist) );
02826     dirptr  = dirlist;
02827     for( i = 0; i < numdirs; i++ ) {
02828         dirlen = strlen( dirptr ) + 1;
02829     descptr = dirptr + dirlen;
02830         uiInfo.modList[uiInfo.modCount].modName = String_Alloc(dirptr);
02831         uiInfo.modList[uiInfo.modCount].modDescr = String_Alloc(descptr);
02832     dirptr += dirlen + strlen(descptr) + 1;
02833         uiInfo.modCount++;
02834         if (uiInfo.modCount >= MAX_MODS) {
02835             break;
02836         }
02837     }
02838 
02839 }

Here is the call graph for this function:

void UI_LoadMovies  )  [static]
 

Definition at line 2871 of file ui_main.c.

References i, uiInfo_t::movieCount, uiInfo_t::movieList, Q_stricmp(), Q_strupr(), String_Alloc(), strlen(), trap_FS_GetFileList(), and uiInfo.

Referenced by UI_RunMenuScript().

02871                             {
02872     char    movielist[4096];
02873     char    *moviename;
02874     int     i, len;
02875 
02876     uiInfo.movieCount = trap_FS_GetFileList( "video", "roq", movielist, 4096 );
02877 
02878     if (uiInfo.movieCount) {
02879         if (uiInfo.movieCount > MAX_MOVIES) {
02880             uiInfo.movieCount = MAX_MOVIES;
02881         }
02882         moviename = movielist;
02883         for ( i = 0; i < uiInfo.movieCount; i++ ) {
02884             len = strlen( moviename );
02885             if (!Q_stricmp(moviename +  len - 4,".roq")) {
02886                 moviename[len-4] = '\0';
02887             }
02888             Q_strupr(moviename);
02889             uiInfo.movieList[i] = String_Alloc(moviename);
02890             moviename += len + 1;
02891         }
02892     }
02893 
02894 }

Here is the call graph for this function:

void UI_LoadNonIngame  ) 
 

Definition at line 5225 of file ui_main.c.

References uiInfo_t::inGameLoad, NULL, qfalse, UI_Cvar_VariableString(), UI_LoadMenus(), and uiInfo.

Referenced by _UI_SetActiveMenu().

05225                         {
05226     const char *menuSet = UI_Cvar_VariableString("ui_menuFiles");
05227     if (menuSet == NULL || menuSet[0] == '\0') {
05228         menuSet = "ui/menus.txt";
05229     }
05230     UI_LoadMenus(menuSet, qfalse);
05231     uiInfo.inGameLoad = qfalse;
05232 }

Here is the call graph for this function:

void UI_LoadTeams  )  [static]
 

Definition at line 2847 of file ui_main.c.

References count, i, strlen(), trap_FS_GetFileList(), and UI_ParseTeamInfo().

Referenced by _UI_Init().

02847                            {
02848     char    teamList[4096];
02849     char    *teamName;
02850     int     i, len, count;
02851 
02852     count = trap_FS_GetFileList( "", "team", teamList, 4096 );
02853 
02854     if (count) {
02855         teamName = teamList;
02856         for ( i = 0; i < count; i++ ) {
02857             len = strlen( teamName );
02858             UI_ParseTeamInfo(teamName);
02859             teamName += len + 1;
02860         }
02861     }
02862 
02863 }

Here is the call graph for this function:

int UI_MapCountByGameType qboolean  singlePlayer  )  [static]
 

Definition at line 3548 of file ui_main.c.

References mapInfo::active, c, uiInfo_t::gameTypes, gameTypeInfo::gtEnum, i, vmCvar_t::integer, uiInfo_t::mapCount, uiInfo_t::mapList, mapInfo::typeBits, ui_gameType, ui_netGameType, and uiInfo.

Referenced by UI_FeederCount(), UI_GameType_HandleKey(), UI_NetGameType_HandleKey(), UI_RunMenuScript(), and UI_StartSkirmish().

03548                                                         {
03549     int i, c, game;
03550     c = 0;
03551     game = singlePlayer ? uiInfo.gameTypes[ui_gameType.integer].gtEnum : uiInfo.gameTypes[ui_netGameType.integer].gtEnum;
03552     if (game == GT_SINGLE_PLAYER) {
03553         game++;
03554     } 
03555     if (game == GT_TEAM) {
03556         game = GT_FFA;
03557     }
03558 
03559     for (i = 0; i < uiInfo.mapCount; i++) {
03560         uiInfo.mapList[i].active = qfalse;
03561         if ( uiInfo.mapList[i].typeBits & (1 << game)) {
03562             if (singlePlayer) {
03563                 if (!(uiInfo.mapList[i].typeBits & (1 << GT_SINGLE_PLAYER))) {
03564                     continue;
03565                 }
03566             }
03567             c++;
03568             uiInfo.mapList[i].active = qtrue;
03569         }
03570     }
03571     return c;
03572 }

qboolean UI_NetFilter_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2524 of file ui_main.c.

References vmCvar_t::integer, K_ENTER, K_MOUSE1, K_MOUSE2, numServerFilters, qboolean, qtrue, UI_BuildServerDisplayList(), and ui_serverFilterType.

Referenced by UI_OwnerDrawHandleKey().

02524                                                                            {
02525   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02526 
02527         if (key == K_MOUSE2) {
02528             ui_serverFilterType.integer--;
02529         } else {
02530             ui_serverFilterType.integer++;
02531         }
02532 
02533     if (ui_serverFilterType.integer >= numServerFilters) {
02534       ui_serverFilterType.integer = 0;
02535     } else if (ui_serverFilterType.integer < 0) {
02536       ui_serverFilterType.integer = numServerFilters - 1;
02537         }
02538         UI_BuildServerDisplayList(qtrue);
02539     return qtrue;
02540   }
02541   return qfalse;
02542 }

Here is the call graph for this function:

qboolean UI_NetGameType_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2366 of file ui_main.c.

References FEEDER_ALLMAPS, uiInfo_t::gameTypes, vmCvar_t::integer, K_ENTER, K_MOUSE1, K_MOUSE2, Menu_SetFeederSelection(), NULL, uiInfo_t::numGameTypes, qboolean, qfalse, trap_Cvar_Set(), UI_MapCountByGameType(), ui_netGameType, uiInfo, and va().

Referenced by UI_OwnerDrawHandleKey().

02366                                                                              {
02367   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02368 
02369         if (key == K_MOUSE2) {
02370             ui_netGameType.integer--;
02371         } else {
02372             ui_netGameType.integer++;
02373         }
02374 
02375     if (ui_netGameType.integer < 0) {
02376       ui_netGameType.integer = uiInfo.numGameTypes - 1;
02377         } else if (ui_netGameType.integer >= uiInfo.numGameTypes) {
02378       ui_netGameType.integer = 0;
02379     } 
02380 
02381     trap_Cvar_Set( "ui_netGameType", va("%d", ui_netGameType.integer));
02382     trap_Cvar_Set( "ui_actualnetGameType", va("%d", uiInfo.gameTypes[ui_netGameType.integer].gtEnum));
02383     trap_Cvar_Set( "ui_currentNetMap", "0");
02384         UI_MapCountByGameType(qfalse);
02385         Menu_SetFeederSelection(NULL, FEEDER_ALLMAPS, 0, NULL);
02386     return qtrue;
02387   }
02388   return qfalse;
02389 }

Here is the call graph for this function:

qboolean UI_NetSource_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2495 of file ui_main.c.

References vmCvar_t::integer, K_ENTER, K_MOUSE1, K_MOUSE2, numNetSources, qboolean, qtrue, trap_Cvar_Set(), UI_BuildServerDisplayList(), ui_netSource, UI_StartServerRefresh(), and va().

Referenced by UI_OwnerDrawHandleKey().

02495                                                                            {
02496   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02497         
02498         if (key == K_MOUSE2) {
02499             ui_netSource.integer--;
02500             if (ui_netSource.integer == AS_MPLAYER)
02501                 ui_netSource.integer--;
02502         } else {
02503             ui_netSource.integer++;
02504             if (ui_netSource.integer == AS_MPLAYER)
02505                 ui_netSource.integer++;
02506         }
02507     
02508         if (ui_netSource.integer >= numNetSources) {
02509       ui_netSource.integer = 0;
02510     } else if (ui_netSource.integer < 0) {
02511       ui_netSource.integer = numNetSources - 1;
02512         }
02513 
02514         UI_BuildServerDisplayList(qtrue);
02515         if (ui_netSource.integer != AS_GLOBAL) {
02516             UI_StartServerRefresh(qtrue);
02517         }
02518     trap_Cvar_Set( "ui_netSource", va("%d", ui_netSource.integer));
02519     return qtrue;
02520   }
02521   return qfalse;
02522 }

Here is the call graph for this function:

void UI_NextOpponent  )  [static]
 

Definition at line 1509 of file ui_main.c.

References i, j, uiInfo_t::teamCount, uiInfo_t::teamList, teamInfo::teamName, trap_Cvar_Set(), UI_Cvar_VariableString(), UI_TeamIndexFromName(), and uiInfo.

Referenced by UI_OpponentName_HandleKey().

01509                               {
01510   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName"));
01511   int j = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_teamName"));
01512     i++;
01513     if (i >= uiInfo.teamCount) {
01514         i = 0;
01515     }
01516     if (i == j) {
01517         i++;
01518         if ( i >= uiInfo.teamCount) {
01519             i = 0;
01520         }
01521     }
01522     trap_Cvar_Set( "ui_opponentName", uiInfo.teamList[i].teamName );
01523 }

Here is the call graph for this function:

const char* UI_OpponentLeaderHead  )  [static]
 

Definition at line 1459 of file ui_main.c.

References UI_AIFromName(), and UI_OpponentLeaderName().

Referenced by UI_OpponentLeaderModel().

01459                                            {
01460     const char *leader = UI_OpponentLeaderName();
01461     return UI_AIFromName(leader);
01462 }

Here is the call graph for this function:

const char* UI_OpponentLeaderModel  )  [static]
 

Definition at line 1466 of file ui_main.c.

References characterInfo::base, uiInfo_t::characterCount, uiInfo_t::characterList, head, i, characterInfo::name, Q_stricmp(), UI_OpponentLeaderHead(), and uiInfo.

01466                                             {
01467     int i;
01468     const char *head = UI_OpponentLeaderHead();
01469     for (i = 0; i < uiInfo.characterCount; i++) {
01470         if (Q_stricmp(head, uiInfo.characterList[i].name) == 0) {
01471             return uiInfo.characterList[i].base;
01472         }
01473     }
01474     return "James";
01475 }

Here is the call graph for this function:

const char* UI_OpponentLeaderName  )  [static]
 

Definition at line 1417 of file ui_main.c.

References i, uiInfo_t::teamList, teamInfo::teamMembers, UI_Cvar_VariableString(), UI_TeamIndexFromName(), and uiInfo.

Referenced by UI_OpponentLeaderHead().

01417                                            {
01418   int i = UI_TeamIndexFromName(UI_Cvar_VariableString("ui_opponentName"));
01419     return uiInfo.teamList[i].teamMembers[0];
01420 }

Here is the call graph for this function:

qboolean UI_OpponentName_HandleKey int  flags,
float *  special,
int  key
[static]
 

Definition at line 2544 of file ui_main.c.

References K_ENTER, K_MOUSE1, K_MOUSE2, qboolean, UI_NextOpponent(), and UI_PriorOpponent().

Referenced by UI_OwnerDrawHandleKey().

02544                                                                               {
02545   if (key == K_MOUSE1 || key == K_MOUSE2 || key == K_ENTER || key == K_KP_ENTER) {
02546         if (key == K_MOUSE2) {
02547             UI_PriorOpponent();
02548         } else {
02549             UI_NextOpponent();
02550         }
02551     return qtrue;
02552   }
02553   return qfalse;
02554 }

Here is the call graph for this function:

void UI_OwnerDraw float  x,
float  y,
float  w,
float  h,
float  text_x,
float  text_y,
int  ownerDraw,
int  ownerDrawFlags,
int  align,
float  special,
float  scale,
vec4_t  color,
qhandle_t  shader,
int  textStyle
[static]
 

Definition at line 1980 of file ui_main.c.

References qfalse, qtrue, rect, UI_ALLMAPS_SELECTION, UI_BLUETEAM1, UI_BLUETEAM2, UI_BLUETEAM3, UI_BLUETEAM4, UI_BLUETEAM5, UI_BLUETEAMNAME, UI_BOTNAME, UI_BOTSKILL, UI_CLANCINEMATIC, UI_CLANLOGO, UI_CLANNAME, UI_CROSSHAIR, UI_DrawAllMapsSelection(), UI_DrawBotName(), UI_DrawBotSkill(), UI_DrawClanCinematic(), UI_DrawClanLogo(), UI_DrawClanName(), UI_DrawCrosshair(), UI_DrawEffects(), UI_DrawGameType(), UI_DrawGLInfo(), UI_DrawHandicap(), UI_DrawJoinGameType(), UI_DrawKeyBindStatus(), UI_DrawMapCinematic(), UI_DrawMapPreview(), UI_DrawMapTimeToBeat(), UI_DrawNetFilter(), UI_DrawNetGameType(), UI_DrawNetMapCinematic(), UI_DrawNetMapPreview(), UI_DrawNetSource(), UI_DrawOpponent(), UI_DrawOpponentLogo(), UI_DrawOpponentLogoMetal(), UI_DrawOpponentLogoName(), UI_DrawOpponentName(), UI_DrawPlayerLogo(), UI_DrawPlayerLogoMetal(), UI_DrawPlayerLogoName(), UI_DrawPlayerModel(), UI_DrawPreviewCinematic(), UI_DrawRedBlue(), UI_DrawSelectedPlayer(), UI_DrawServerMOTD(), UI_DrawServerRefreshDate(), UI_DrawSkill(), UI_DrawTeamMember(), UI_DrawTeamName(), UI_DrawTier(), UI_DrawTierGameType(), UI_DrawTierMap(), UI_DrawTierMapName(), UI_EFFECTS, UI_GAMETYPE, UI_GLINFO, UI_HANDICAP, UI_JOINGAMETYPE, UI_KEYBINDSTATUS, UI_MAP_TIMETOBEAT, UI_MAPCINEMATIC, UI_MAPPREVIEW, UI_MAPS_SELECTION, UI_NETFILTER, UI_NETGAMETYPE, UI_NETMAPCINEMATIC, UI_NETMAPPREVIEW, UI_NETSOURCE, UI_OPPONENT_NAME, UI_OPPONENTLOGO, UI_OPPONENTLOGO_METAL, UI_OPPONENTLOGO_NAME, UI_OPPONENTMODEL, UI_PLAYERLOGO, UI_PLAYERLOGO_METAL, UI_PLAYERLOGO_NAME, UI_PLAYERMODEL, UI_PREVIEWCINEMATIC, UI_REDBLUE, UI_REDTEAM1, UI_REDTEAM2, UI_REDTEAM3, UI_REDTEAM4, UI_REDTEAM5, UI_REDTEAMNAME, UI_SELECTEDPLAYER, UI_SERVERMOTD, UI_SERVERREFRESHDATE, UI_SKILL, UI_STARTMAPCINEMATIC, UI_TIER, UI_TIER_GAMETYPE, UI_TIER_MAPNAME, UI_TIERMAP1, UI_TIERMAP2, UI_TIERMAP3, x, and y.

01980                                                                                                                                                                                                                   {
01981     rectDef_t rect;
01982 
01983   rect.x = x + text_x;
01984   rect.y = y + text_y;
01985   rect.w = w;
01986   rect.h = h;
01987 
01988   switch (ownerDraw) {
01989     case UI_HANDICAP:
01990       UI_DrawHandicap(&rect, scale, color, textStyle);
01991       break;
01992     case UI_EFFECTS:
01993       UI_DrawEffects(&rect, scale, color);
01994       break;
01995     case UI_PLAYERMODEL:
01996       UI_DrawPlayerModel(&rect);
01997       break;
01998     case UI_CLANNAME:
01999       UI_DrawClanName(&rect, scale, color, textStyle);
02000       break;
02001     case UI_CLANLOGO:
02002       UI_DrawClanLogo(&rect, scale, color);
02003       break;
02004     case UI_CLANCINEMATIC:
02005       UI_DrawClanCinematic(&rect, scale, color);
02006       break;
02007     case UI_PREVIEWCINEMATIC:
02008       UI_DrawPreviewCinematic(&rect, scale, color);
02009       break;
02010     case UI_GAMETYPE:
02011       UI_DrawGameType(&rect, scale, color, textStyle);
02012       break;
02013     case UI_NETGAMETYPE:
02014       UI_DrawNetGameType(&rect, scale, color, textStyle);
02015       break;
02016