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

ui_local.h File Reference

#include "../game/q_shared.h"
#include "../cgame/tr_types.h"
#include "../ui/ui_public.h"
#include "keycodes.h"
#include "../game/bg_public.h"

Include dependency graph for ui_local.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  _tag_menuframework
struct  lerpFrame_t
struct  menuaction_s
struct  menubitmap_s
struct  menucommon_s
struct  menufield_s
struct  menulist_s
struct  menuradiobutton_s
struct  menuslider_s
struct  menutext_s
struct  mfield_t
struct  playerInfo_t
struct  uiStatic_t

Defines

#define LCOLUMN_OFFSET   (-BIGCHAR_WIDTH )
#define MAX_EDIT_LINE   256
#define MAX_FAVORITESERVERS   16
#define MAX_MENUDEPTH   8
#define MAX_MENUITEMS   64
#define MTYPE_ACTION   2
#define MTYPE_BITMAP   6
#define MTYPE_BTEXT   10
#define MTYPE_FIELD   4
#define MTYPE_NULL   0
#define MTYPE_PTEXT   9
#define MTYPE_RADIOBUTTON   5
#define MTYPE_SCROLLLIST   8
#define MTYPE_SLIDER   1
#define MTYPE_SPINCONTROL   3
#define MTYPE_TEXT   7
#define QM_ACTIVATED   3
#define QM_GOTFOCUS   1
#define QM_LOSTFOCUS   2
#define QMF_BLINK   0x00000001
#define QMF_CENTER_JUSTIFY   0x00000008
#define QMF_GRAYED   0x00002000
#define QMF_HASMOUSEFOCUS   0x00000200
#define QMF_HIDDEN   0x00001000
#define QMF_HIGHLIGHT   0x00000040
#define QMF_HIGHLIGHT_IF_FOCUS   0x00000080
#define QMF_INACTIVE   0x00004000
#define QMF_LEFT_JUSTIFY   0x00000004
#define QMF_LOWERCASE   0x00040000
#define QMF_MOUSEONLY   0x00000800
#define QMF_NODEFAULTINIT   0x00008000
#define QMF_NOONOFFTEXT   0x00000400
#define QMF_NUMBERSONLY   0x00000020
#define QMF_OWNERDRAW   0x00010000
#define QMF_PULSE   0x00020000
#define QMF_PULSEIFFOCUS   0x00000100
#define QMF_RIGHT_JUSTIFY   0x00000010
#define QMF_SILENT   0x00100000
#define QMF_SMALLFONT   0x00000002
#define QMF_UPPERCASE   0x00080000
#define RCOLUMN_OFFSET   ( BIGCHAR_WIDTH )
#define SLIDER_RANGE   10
#define UI_API_VERSION   4

Typedefs

typedef _tag_menuframework menuframework_s
typedef void(* voidfunc_f )(void)

Enumerations

enum  awardType_t {
  AWARD_ACCURACY, AWARD_IMPRESSIVE, AWARD_EXCELLENT, AWARD_GAUNTLET,
  AWARD_FRAGS, AWARD_PERFECT
}

Functions

void ArenaServers_Cache (void)
void Bitmap_Draw (menubitmap_s *b)
void Bitmap_Init (menubitmap_s *b)
void ConfirmMenu_Cache (void)
void Controls_Cache (void)
void Demos_Cache (void)
void DriverInfo_Cache (void)
void GraphicsOptions_Cache (void)
void InGame_Cache (void)
void Login_Cache (void)
void MainMenu_Cache (void)
sfxHandle_t Menu_ActivateItem (menuframework_s *s, menucommon_s *item)
void Menu_AddItem (menuframework_s *menu, void *item)
void Menu_AdjustCursor (menuframework_s *menu, int dir)
void Menu_Cache (void)
sfxHandle_t Menu_DefaultKey (menuframework_s *s, int key)
void Menu_Draw (menuframework_s *menu)
void Menu_Focus (menucommon_s *m)
void * Menu_ItemAtCursor (menuframework_s *m)
void Menu_SetCursor (menuframework_s *s, int cursor)
void Menu_SetCursorToItem (menuframework_s *m, void *ptr)
void MenuField_Draw (menufield_s *f)
void MenuField_Init (menufield_s *m)
sfxHandle_t MenuField_Key (menufield_s *m, int *key)
void MField_CharEvent (mfield_t *edit, int ch)
void MField_Clear (mfield_t *edit)
void MField_Draw (mfield_t *edit, int x, int y, int style, vec4_t color)
void MField_KeyDownEvent (mfield_t *edit, int key)
void PlayerModel_Cache (void)
void PlayerSettings_Cache (void)
void Preferences_Cache (void)
void Rankings_Cache (void)
void Rankings_DrawName (void *self)
void Rankings_DrawPassword (void *self)
void Rankings_DrawText (void *self)
void RankStatus_Cache (void)
void ScrollList_Draw (menulist_s *l)
sfxHandle_t ScrollList_Key (menulist_s *l, int key)
void ServerInfo_Cache (void)
void ServerOptions_Cache (void)
void Signup_Cache (void)
void SpecifyLeague_Cache (void)
void SpecifyServer_Cache (void)
void StartServer_Cache (void)
void TeamMain_Cache (void)
int trap_Argc (void)
void trap_Argv (int n, char *buffer, int bufferLength)
int trap_CM_LerpTag (orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName)
void trap_Cmd_ExecuteText (int exec_when, const char *text)
void trap_Cvar_Create (const char *var_name, const char *var_value, int flags)
void trap_Cvar_InfoStringBuffer (int bit, char *buffer, int bufsize)
void trap_Cvar_Register (vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags)
void trap_Cvar_Reset (const char *name)
void trap_Cvar_Set (const char *var_name, const char *value)
void trap_Cvar_SetValue (const char *var_name, float value)
void trap_Cvar_Update (vmCvar_t *vmCvar)
void trap_Cvar_VariableStringBuffer (const char *var_name, char *buffer, int bufsize)
float trap_Cvar_VariableValue (const char *var_name)
void trap_Error (const char *string)
void trap_FS_FCloseFile (fileHandle_t f)
int trap_FS_FOpenFile (const char *qpath, fileHandle_t *f, fsMode_t mode)
int trap_FS_GetFileList (const char *path, const char *extension, char *listbuf, int bufsize)
void trap_FS_Read (void *buffer, int len, fileHandle_t f)
int trap_FS_Seek (fileHandle_t f, long offset, int origin)
void trap_FS_Write (const void *buffer, int len, fileHandle_t f)
void trap_GetCDKey (char *buf, int buflen)
void trap_GetClientState (uiClientState_t *state)
void trap_GetClipboardData (char *buf, int bufsize)
int trap_GetConfigString (int index, char *buff, int buffsize)
void trap_GetGlconfig (glconfig_t *glconfig)
void trap_Key_ClearStates (void)
void trap_Key_GetBindingBuf (int keynum, char *buf, int buflen)
int trap_Key_GetCatcher (void)
qboolean trap_Key_GetOverstrikeMode (void)
qboolean trap_Key_IsDown (int keynum)
void trap_Key_KeynumToStringBuf (int keynum, char *buf, int buflen)
void trap_Key_SetBinding (int keynum, const char *binding)
void trap_Key_SetCatcher (int catcher)
void trap_Key_SetOverstrikeMode (qboolean state)
void trap_LAN_ClearPing (int n)
void trap_LAN_GetPing (int n, char *buf, int buflen, int *pingtime)
void trap_LAN_GetPingInfo (int n, char *buf, int buflen)
int trap_LAN_GetPingQueueCount (void)
void trap_LAN_GetServerAddressString (int source, int n, char *buf, int buflen)
int trap_LAN_GetServerCount (int source)
void trap_LAN_GetServerInfo (int source, int n, char *buf, int buflen)
int trap_LAN_ServerStatus (const char *serverAddress, char *serverStatus, int maxLen)
int trap_MemoryRemaining (void)
int trap_Milliseconds (void)
void trap_Print (const char *string)
void trap_R_AddLightToScene (const vec3_t org, float intensity, float r, float g, float b)
void trap_R_AddPolyToScene (qhandle_t hShader, int numVerts, const polyVert_t *verts)
void trap_R_AddRefEntityToScene (const refEntity_t *re)
void trap_R_ClearScene (void)
void trap_R_DrawStretchPic (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader)
qhandle_t trap_R_RegisterModel (const char *name)
qhandle_t trap_R_RegisterShaderNoMip (const char *name)
qhandle_t trap_R_RegisterSkin (const char *name)
void trap_R_RenderScene (const refdef_t *fd)
void trap_R_SetColor (const float *rgba)
sfxHandle_t trap_S_RegisterSound (const char *sample, qboolean compressed)
void trap_S_StartLocalSound (sfxHandle_t sfx, int channelNum)
void trap_SetCDKey (char *buf)
void trap_SetPbClStatus (int status)
void trap_UpdateScreen (void)
qboolean trap_VerifyCDKey (const char *key, const char *chksum)
void UI_AddBots_Cache (void)
void UI_AddBotsMenu (void)
void UI_AdjustFrom640 (float *x, float *y, float *w, float *h)
void UI_ArenaServersMenu (void)
char * UI_Argv (int arg)
void UI_BotSelectMenu (char *bot)
void UI_BotSelectMenu_Cache (void)
qboolean UI_CanShowTierVideo (int tier)
void UI_CDKeyMenu (void)
void UI_CDKeyMenu_Cache (void)
void UI_CDKeyMenu_f (void)
void UI_CinematicsMenu (void)
void UI_CinematicsMenu_Cache (void)
void UI_CinematicsMenu_f (void)
float UI_ClampCvar (float min, float max, float value)
void UI_ConfirmMenu (const char *question, void(*draw)(void), void(*action)(qboolean result))
void UI_ConfirmMenu_Style (const char *question, int style, void(*draw)(void), void(*action)(qboolean result))
qboolean UI_ConsoleCommand (int realTime)
void UI_ControlsMenu (void)
void UI_CreditMenu (void)
qboolean UI_CursorInRect (int x, int y, int width, int height)
char * UI_Cvar_VariableString (const char *var_name)
void UI_DemosMenu (void)
void UI_DisplayOptionsMenu (void)
void UI_DisplayOptionsMenu_Cache (void)
void UI_DrawBannerString (int x, int y, const char *str, int style, vec4_t color)
void UI_DrawChar (int x, int y, int ch, int style, vec4_t color)
void UI_DrawConnectScreen (qboolean overlay)
void UI_DrawHandlePic (float x, float y, float w, float h, qhandle_t hShader)
void UI_DrawNamedPic (float x, float y, float width, float height, const char *picname)
void UI_DrawPlayer (float x, float y, float w, float h, playerInfo_t *pi, int time)
void UI_DrawProportionalString (int x, int y, const char *str, int style, vec4_t color)
void UI_DrawProportionalString_AutoWrapped (int x, int ystart, int xmax, int ystep, const char *str, int style, vec4_t color)
void UI_DrawRect (float x, float y, float width, float height, const float *color)
void UI_DrawString (int x, int y, const char *str, int style, vec4_t color)
void UI_DrawTextBox (int x, int y, int width, int lines)
void UI_FillRect (float x, float y, float width, float height, const float *color)
void UI_ForceMenuOff (void)
const char * UI_GetArenaInfoByMap (const char *map)
const char * UI_GetArenaInfoByNumber (int num)
int UI_GetAwardLevel (int award)
void UI_GetBestScore (int level, int *score, int *skill)
char * UI_GetBotInfoByName (const char *name)
char * UI_GetBotInfoByNumber (int num)
int UI_GetCurrentGame (void)
int UI_GetNumArenas (void)
int UI_GetNumBots (void)
int UI_GetNumSPArenas (void)
int UI_GetNumSPTiers (void)
const char * UI_GetSpecialArenaInfo (const char *tag)
void UI_GraphicsOptionsMenu (void)
void UI_InGameMenu (void)
void UI_Init (void)
void UI_InitGameinfo (void)
qboolean UI_IsFullscreen (void)
void UI_KeyEvent (int key, int down)
void UI_LerpColor (vec4_t a, vec4_t b, vec4_t c, float t)
void UI_LoadConfig_Cache (void)
void UI_LoadConfigMenu (void)
void UI_LogAwardData (int award, int data)
void UI_LoginMenu (void)
void UI_MainMenu (void)
void UI_Message (const char **lines)
void UI_ModsMenu (void)
void UI_ModsMenu_Cache (void)
void UI_MouseEvent (int dx, int dy)
void UI_NetworkOptionsMenu (void)
void UI_NetworkOptionsMenu_Cache (void)
void UI_NewGame (void)
void UI_PlayerInfo_SetInfo (playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat)
void UI_PlayerInfo_SetModel (playerInfo_t *pi, const char *model)
void UI_PlayerModelMenu (void)
void UI_PlayerSettingsMenu (void)
void UI_PopMenu (void)
void UI_PreferencesMenu (void)
float UI_ProportionalSizeScale (int style)
int UI_ProportionalStringWidth (const char *str)
void UI_PushMenu (menuframework_s *menu)
void UI_RankingsMenu (void)
void UI_RankStatusMenu (void)
void UI_Refresh (int realtime)
qboolean UI_RegisterClientModelname (playerInfo_t *pi, const char *modelSkinName)
void UI_RegisterCvars (void)
void UI_RemoveBots_Cache (void)
void UI_RemoveBotsMenu (void)
void UI_SaveConfigMenu (void)
void UI_SaveConfigMenu_Cache (void)
void UI_ServerInfoMenu (void)
void UI_SetActiveMenu (uiMenuCommand_t menu)
void UI_SetBestScore (int level, int score)
void UI_SetColor (const float *rgba)
void UI_SetupMenu (void)
void UI_SetupMenu_Cache (void)
qboolean UI_ShowTierVideo (int tier)
void UI_Shutdown (void)
void UI_SignupMenu (void)
void UI_SoundOptionsMenu (void)
void UI_SoundOptionsMenu_Cache (void)
void UI_SPArena_Start (const char *arenaInfo)
void UI_SpecifyLeagueMenu (void)
void UI_SpecifyServerMenu (void)
void UI_SPLevelMenu (void)
void UI_SPLevelMenu_Cache (void)
void UI_SPLevelMenu_f (void)
void UI_SPLevelMenu_ReInit (void)
void UI_SPPostgameMenu_Cache (void)
void UI_SPPostgameMenu_f (void)
void UI_SPSkillMenu (const char *arenaInfo)
void UI_SPSkillMenu_Cache (void)
void UI_SPUnlock_f (void)
void UI_SPUnlockMedals_f (void)
void UI_StartDemoLoop (void)
void UI_StartServerMenu (qboolean multiplayer)
void UI_TeamMainMenu (void)
void UI_TeamOrdersMenu (void)
void UI_TeamOrdersMenu_Cache (void)
void UI_TeamOrdersMenu_f (void)
int UI_TierCompleted (int levelWon)
void UI_UpdateCvars (void)
void UI_UpdateScreen (void)

Variables

vec4_t color_black
vec4_t color_blue
vec4_t color_dim
vec4_t color_orange
vec4_t color_red
vec4_t color_white
vec4_t color_yellow
vec4_t list_color
vec4_t listbar_color
qboolean m_entersound
vec4_t menu_black_color
sfxHandle_t menu_buzz_sound
vec4_t menu_dark_color
vec4_t menu_dim_color
vec4_t menu_grayed_color
vec4_t menu_highlight_color
sfxHandle_t menu_in_sound
sfxHandle_t menu_move_sound
sfxHandle_t menu_null_sound
sfxHandle_t menu_out_sound
vec4_t menu_red_color
vec4_t menu_text_color
vec4_t name_color
vec4_t text_color_disabled
vec4_t text_color_highlight
vec4_t text_color_normal
vmCvar_t ui_arenasFile
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_cdkey
vmCvar_t ui_cdkeychecked
vmCvar_t ui_ctf_capturelimit
vmCvar_t ui_ctf_friendly
vmCvar_t ui_ctf_timelimit
vmCvar_t ui_drawCrosshair
vmCvar_t ui_drawCrosshairNames
vmCvar_t ui_ffa_fraglimit
vmCvar_t ui_ffa_timelimit
vmCvar_t ui_marks
char * ui_medalNames []
char * ui_medalPicNames []
char * ui_medalSounds []
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_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_tourney_fraglimit
vmCvar_t ui_tourney_timelimit
uiStatic_t uis
sfxHandle_t weaponChangeSound


Define Documentation

#define LCOLUMN_OFFSET   (-BIGCHAR_WIDTH )
 

Definition at line 102 of file ui_local.h.

#define MAX_EDIT_LINE   256
 

Definition at line 105 of file ui_local.h.

Referenced by Field_CharEvent(), Field_Clear(), and MField_CharEvent().

#define MAX_FAVORITESERVERS   16
 

Definition at line 422 of file ui_local.h.

Referenced by ArenaServers_LoadFavorites().

#define MAX_MENUDEPTH   8
 

Definition at line 107 of file ui_local.h.

#define MAX_MENUITEMS   64
 

Definition at line 108 of file ui_local.h.

#define MTYPE_ACTION   2
 

Definition at line 112 of file ui_local.h.

Referenced by Menu_AddItem(), and Menu_Draw().

#define MTYPE_BITMAP   6
 

Definition at line 116 of file ui_local.h.

Referenced by Menu_AddItem(), and Menu_Draw().

#define MTYPE_BTEXT   10
 

Definition at line 120 of file ui_local.h.

Referenced by Menu_AddItem(), and Menu_Draw().

#define MTYPE_FIELD   4
 

Definition at line 114 of file ui_local.h.

Referenced by Menu_AddItem(), Menu_DefaultKey(), and Menu_Draw().

#define MTYPE_NULL   0
 

Definition at line 110 of file ui_local.h.

#define MTYPE_PTEXT   9
 

Definition at line 119 of file ui_local.h.

Referenced by Menu_AddItem(), and Menu_Draw().

#define MTYPE_RADIOBUTTON   5
 

Definition at line 115 of file ui_local.h.

Referenced by Menu_AddItem(), Menu_DefaultKey(), and Menu_Draw().

#define MTYPE_SCROLLLIST   8
 

Definition at line 118 of file ui_local.h.

Referenced by Menu_AddItem(), Menu_DefaultKey(), and Menu_Draw().

#define MTYPE_SLIDER   1
 

Definition at line 111 of file ui_local.h.

Referenced by Menu_AddItem(), Menu_DefaultKey(), and Menu_Draw().

#define MTYPE_SPINCONTROL   3
 

Definition at line 113 of file ui_local.h.

Referenced by Menu_AddItem(), Menu_DefaultKey(), and Menu_Draw().

#define MTYPE_TEXT   7
 

Definition at line 117 of file ui_local.h.

Referenced by Menu_AddItem(), and Menu_Draw().

#define QM_ACTIVATED   3
 

Definition at line 147 of file ui_local.h.

Referenced by ArenaServers_Event(), ConfirmMenu_Key(), Menu_ActivateItem(), RadioButton_Key(), Reset_MenuKey(), Slider_Key(), SpinControl_Key(), StartServer_MenuInit(), and UI_TeamOrdersMenu_Key().

#define QM_GOTFOCUS   1
 

Definition at line 145 of file ui_local.h.

Referenced by Menu_CursorMoved(), and ScrollList_Key().

#define QM_LOSTFOCUS   2
 

Definition at line 146 of file ui_local.h.

Referenced by Menu_CursorMoved().

#define QMF_BLINK   0x00000001
 

Definition at line 122 of file ui_local.h.

#define QMF_CENTER_JUSTIFY   0x00000008
 

Definition at line 125 of file ui_local.h.

Referenced by Controls_MenuInit(), GraphicsOptions_MenuInit(), InGame_MenuInit(), Options_MenuInit(), PlayerModel_MenuInit(), Rankings_MenuInit(), RankStatus_MenuInit(), StartServer_MenuInit(), TeamMain_MenuInit(), UI_CinematicsMenu_Init(), UI_MainMenu(), UI_ServerInfoMenu(), UI_SetupMenu_Init(), UI_SPPostgameMenu_Init(), and UI_SPSkillMenu_Init().

#define QMF_GRAYED   0x00002000
 

Definition at line 135 of file ui_local.h.

Referenced by Controls_MenuInit(), Controls_Update(), Menu_AdjustCursor(), Menu_DefaultKey(), Menu_SetCursor(), ServerOptions_MenuInit(), UI_MouseEvent(), and UI_PushMenu().

#define QMF_HASMOUSEFOCUS   0x00000200
 

Definition at line 131 of file ui_local.h.

#define QMF_HIDDEN   0x00001000
 

Definition at line 134 of file ui_local.h.

Referenced by Controls_Update(), GraphicsOptions_MenuInit(), GraphicsOptions_UpdateMenuItems(), and Rankings_MenuInit().

#define QMF_HIGHLIGHT   0x00000040
 

Definition at line 128 of file ui_local.h.

Referenced by Controls_Update().

#define QMF_HIGHLIGHT_IF_FOCUS   0x00000080
 

Definition at line 129 of file ui_local.h.

Referenced by Controls_MenuInit().

#define QMF_INACTIVE   0x00004000
 

Definition at line 136 of file ui_local.h.

Referenced by ArenaServers_SetType(), Demos_MenuInit(), LoadConfig_MenuInit(), Rankings_MenuInit(), ServerOptions_InitPlayerItems(), ServerOptions_MenuInit(), ServerOptions_SetPlayerItems(), and UI_SPLevelMenu_SetMenuItems().

#define QMF_LEFT_JUSTIFY   0x00000004
 

Definition at line 124 of file ui_local.h.

Referenced by ArenaServers_MenuInit(), Controls_MenuInit(), Demos_MenuInit(), GraphicsOptions_MenuInit(), LoadConfig_MenuInit(), Login_MenuInit(), Options_MenuInit(), PlayerModel_MenuInit(), PlayerSettings_MenuInit(), Preferences_MenuInit(), ServerOptions_MenuInit(), Signup_MenuInit(), SpecifyLeague_MenuInit(), SpecifyServer_MenuInit(), StartServer_MenuInit(), UI_AddBotsMenu_Init(), UI_BotSelectMenu_Init(), UI_CDKeyMenu_Init(), UI_CinematicsMenu_Init(), UI_ConfirmMenu_Style(), UI_DisplayOptionsMenu_Init(), UI_DriverInfo_Menu(), UI_Message(), UI_Mods_MenuInit(), UI_NetworkOptionsMenu_Init(), UI_RemoveBotsMenu_Init(), UI_ResetMenu(), UI_SaveConfigMenu_Init(), UI_ServerInfoMenu(), UI_SetupMenu_Init(), UI_SoundOptionsMenu_Init(), UI_SPLevelMenu_Init(), UI_SPPostgameMenu_Init(), UI_SPSkillMenu_Init(), and UI_TeamOrdersMenu_Init().

#define QMF_LOWERCASE   0x00040000
 

Definition at line 140 of file ui_local.h.

#define QMF_MOUSEONLY   0x00000800
 

Definition at line 133 of file ui_local.h.

Referenced by Menu_AdjustCursor(), Menu_DefaultKey(), PlayerSettings_MenuInit(), StartServer_MenuInit(), UI_PushMenu(), and UI_SPLevelMenu_Init().

#define QMF_NODEFAULTINIT   0x00008000
 

Definition at line 137 of file ui_local.h.

Referenced by PlayerModel_MenuInit(), Preferences_MenuInit(), UI_BotSelectMenu_Init(), and UI_SaveConfigMenu_Init().

#define QMF_NOONOFFTEXT   0x00000400
 

Definition at line 132 of file ui_local.h.

#define QMF_NUMBERSONLY   0x00000020
 

Definition at line 127 of file ui_local.h.

Referenced by ServerOptions_MenuInit().

#define QMF_OWNERDRAW   0x00010000
 

Definition at line 138 of file ui_local.h.

#define QMF_PULSE   0x00020000
 

Definition at line 139 of file ui_local.h.

#define QMF_PULSEIFFOCUS   0x00000100
 

Definition at line 130 of file ui_local.h.

Referenced by ArenaServers_MenuInit(), Controls_MenuInit(), Demos_MenuInit(), GraphicsOptions_MenuInit(), LoadConfig_MenuInit(), Preferences_MenuInit(), ServerOptions_MenuInit(), SpecifyLeague_MenuInit(), SpecifyServer_MenuInit(), StartServer_MenuInit(), UI_AddBotsMenu_Init(), UI_DisplayOptionsMenu_Init(), UI_Mods_MenuInit(), UI_NetworkOptionsMenu_Init(), UI_SoundOptionsMenu_Init(), and UI_SPPostgameMenu_Init().

#define QMF_RIGHT_JUSTIFY   0x00000010
 

Definition at line 126 of file ui_local.h.

Referenced by ArenaServers_MenuInit(), Controls_MenuInit(), Demos_MenuInit(), GraphicsOptions_MenuInit(), LoadConfig_MenuInit(), Login_MenuInit(), PlayerSettings_MenuInit(), ServerOptions_MenuInit(), Signup_MenuInit(), SpecifyServer_MenuInit(), StartServer_MenuInit(), UI_BotSelectMenu_Init(), UI_CDKeyMenu_Init(), UI_DisplayOptionsMenu_Init(), UI_Mods_MenuInit(), UI_NetworkOptionsMenu_Init(), UI_SaveConfigMenu_Init(), UI_SoundOptionsMenu_Init(), UI_SPLevelMenu_Init(), UI_SPPostgameMenu_Init(), and UI_SPSkillMenu_Init().

#define QMF_SILENT   0x00100000
 

Definition at line 142 of file ui_local.h.

Referenced by UI_SPLevelMenu_Init().

#define QMF_SMALLFONT   0x00000002
 

Definition at line 123 of file ui_local.h.

Referenced by Preferences_MenuInit(), and SpecifyServer_MenuInit().

#define QMF_UPPERCASE   0x00080000
 

Definition at line 141 of file ui_local.h.

#define RCOLUMN_OFFSET   ( BIGCHAR_WIDTH )
 

Definition at line 101 of file ui_local.h.

#define SLIDER_RANGE   10
 

Definition at line 104 of file ui_local.h.

Referenced by Slider_Draw(), Slider_Init(), and Slider_Key().

#define UI_API_VERSION   4
 

Definition at line 32 of file ui_local.h.

Referenced by CL_InitUI().


Typedef Documentation

typedef struct _tag_menuframework menuframework_s
 

Referenced by Menu_ActivateItem(), Menu_AddItem(), Menu_AdjustCursor(), Menu_CursorMoved(), Menu_DefaultKey(), Menu_Draw(), Menu_ItemAtCursor(), Menu_SetCursor(), Menu_SetCursorToItem(), and UI_PushMenu().

typedef void(* voidfunc_f)(void)
 

Definition at line 36 of file ui_local.h.

Referenced by ArenaServers_Event(), InGame_Event(), and UI_SetActiveMenu().


Enumeration Type Documentation

enum awardType_t
 

Enumeration values:
AWARD_ACCURACY 
AWARD_IMPRESSIVE 
AWARD_EXCELLENT 
AWARD_GAUNTLET 
AWARD_FRAGS 
AWARD_PERFECT 

Definition at line 736 of file ui_local.h.

00736              {
00737     AWARD_ACCURACY,
00738     AWARD_IMPRESSIVE,
00739     AWARD_EXCELLENT,
00740     AWARD_GAUNTLET,
00741     AWARD_FRAGS,
00742     AWARD_PERFECT
00743 } awardType_t;


Function Documentation

void ArenaServers_Cache void   ) 
 

Definition at line 1613 of file ui_servers2.c.

Referenced by ArenaServers_MenuInit(), and UI_Cache_f().

01613                                 {
01614     trap_R_RegisterShaderNoMip( ART_BACK0 );
01615     trap_R_RegisterShaderNoMip( ART_BACK1 );
01616     trap_R_RegisterShaderNoMip( ART_CREATE0 );
01617     trap_R_RegisterShaderNoMip( ART_CREATE1 );
01618     trap_R_RegisterShaderNoMip( ART_SPECIFY0 );
01619     trap_R_RegisterShaderNoMip( ART_SPECIFY1 );
01620     trap_R_RegisterShaderNoMip( ART_REFRESH0 );
01621     trap_R_RegisterShaderNoMip( ART_REFRESH1 );
01622     trap_R_RegisterShaderNoMip( ART_CONNECT0 );
01623     trap_R_RegisterShaderNoMip( ART_CONNECT1 );
01624     trap_R_RegisterShaderNoMip( ART_ARROWS0  );
01625     trap_R_RegisterShaderNoMip( ART_ARROWS_UP );
01626     trap_R_RegisterShaderNoMip( ART_ARROWS_DOWN );
01627     trap_R_RegisterShaderNoMip( ART_UNKNOWNMAP );
01628     trap_R_RegisterShaderNoMip( ART_PUNKBUSTER );
01629 }

void Bitmap_Draw menubitmap_s b  ) 
 

Definition at line 282 of file ui_qmenu.c.

00283 {
00284     float   x;
00285     float   y;
00286     float   w;
00287     float   h;
00288     vec4_t  tempcolor;
00289     float*  color;
00290 
00291     x = b->generic.x;
00292     y = b->generic.y;
00293     w = b->width;
00294     h = b->height;
00295 
00296     if (b->generic.flags & QMF_RIGHT_JUSTIFY)
00297     {
00298         x = x - w;
00299     }
00300     else if (b->generic.flags & QMF_CENTER_JUSTIFY)
00301     {
00302         x = x - w/2;
00303     }
00304 
00305     // used to refresh shader
00306     if (b->generic.name && !b->shader)
00307     {
00308         b->shader = trap_R_RegisterShaderNoMip( b->generic.name );
00309         if (!b->shader && b->errorpic)
00310             b->shader = trap_R_RegisterShaderNoMip( b->errorpic );
00311     }
00312 
00313     if (b->focuspic && !b->focusshader)
00314         b->focusshader = trap_R_RegisterShaderNoMip( b->focuspic );
00315 
00316     if (b->generic.flags & QMF_GRAYED)
00317     {
00318         if (b->shader)
00319         {
00320             trap_R_SetColor( colorMdGrey );
00321             UI_DrawHandlePic( x, y, w, h, b->shader );
00322             trap_R_SetColor( NULL );
00323         }
00324     }
00325     else
00326     {
00327         if (b->shader)
00328             UI_DrawHandlePic( x, y, w, h, b->shader );
00329 
00330         // bk001204 - parentheses
00331         if (  ( (b->generic.flags & QMF_PULSE) 
00332             || (b->generic.flags & QMF_PULSEIFFOCUS) )
00333               && (Menu_ItemAtCursor( b->generic.parent ) == b))
00334         {   
00335             if (b->focuscolor)          
00336             {
00337                 tempcolor[0] = b->focuscolor[0];
00338                 tempcolor[1] = b->focuscolor[1];
00339                 tempcolor[2] = b->focuscolor[2];
00340                 color        = tempcolor;   
00341             }
00342             else
00343                 color = pulse_color;
00344             color[3] = 0.5+0.5*sin(uis.realtime/PULSE_DIVISOR);
00345 
00346             trap_R_SetColor( color );
00347             UI_DrawHandlePic( x, y, w, h, b->focusshader );
00348             trap_R_SetColor( NULL );
00349         }
00350         else if ((b->generic.flags & QMF_HIGHLIGHT) || ((b->generic.flags & QMF_HIGHLIGHT_IF_FOCUS) && (Menu_ItemAtCursor( b->generic.parent ) == b)))
00351         {   
00352             if (b->focuscolor)
00353             {
00354                 trap_R_SetColor( b->focuscolor );
00355                 UI_DrawHandlePic( x, y, w, h, b->focusshader );
00356                 trap_R_SetColor( NULL );
00357             }
00358             else
00359                 UI_DrawHandlePic( x, y, w, h, b->focusshader );
00360         }
00361     }
00362 }

void Bitmap_Init menubitmap_s b  ) 
 

Definition at line 241 of file ui_qmenu.c.

00242 {
00243     int x;
00244     int y;
00245     int w;
00246     int h;
00247 
00248     x = b->generic.x;
00249     y = b->generic.y;
00250     w = b->width;
00251     h = b->height;
00252     if( w < 0 ) {
00253         w = -w;
00254     }
00255     if( h < 0 ) {
00256         h = -h;
00257     }
00258 
00259     if (b->generic.flags & QMF_RIGHT_JUSTIFY)
00260     {
00261         x = x - w;
00262     }
00263     else if (b->generic.flags & QMF_CENTER_JUSTIFY)
00264     {
00265         x = x - w/2;
00266     }
00267 
00268     b->generic.left   = x;
00269     b->generic.right  = x + w;
00270     b->generic.top    = y;
00271     b->generic.bottom = y + h;
00272 
00273     b->shader      = 0;
00274     b->focusshader = 0;
00275 }

void ConfirmMenu_Cache void   ) 
 

Definition at line 163 of file ui_confirm.c.

00163                                {
00164     trap_R_RegisterShaderNoMip( ART_CONFIRM_FRAME );
00165 }

void Controls_Cache void   ) 
 

Definition at line 1651 of file ui_controls2.c.

01651                             {
01652     trap_R_RegisterShaderNoMip( ART_BACK0 );
01653     trap_R_RegisterShaderNoMip( ART_BACK1 );
01654     trap_R_RegisterShaderNoMip( ART_FRAMEL );
01655     trap_R_RegisterShaderNoMip( ART_FRAMER );
01656 }

void Demos_Cache void   ) 
 

Definition at line 271 of file ui_demo2.c.

00271                          {
00272     trap_R_RegisterShaderNoMip( ART_BACK0 );
00273     trap_R_RegisterShaderNoMip( ART_BACK1 );
00274     trap_R_RegisterShaderNoMip( ART_GO0 );
00275     trap_R_RegisterShaderNoMip( ART_GO1 );
00276     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00277     trap_R_RegisterShaderNoMip( ART_FRAMER );
00278     trap_R_RegisterShaderNoMip( ART_ARROWS );
00279     trap_R_RegisterShaderNoMip( ART_ARROWLEFT );
00280     trap_R_RegisterShaderNoMip( ART_ARROWRIGHT );
00281 }

void DriverInfo_Cache void   ) 
 

Definition at line 122 of file ui_video.c.

Referenced by UI_Cache_f(), and UI_DriverInfo_Menu().

00123 {
00124     int i;
00125 
00126     // touch all our pics
00127     for (i=0; ;i++)
00128     {
00129         if (!driverinfo_artlist[i])
00130             break;
00131         trap_R_RegisterShaderNoMip(driverinfo_artlist[i]);
00132     }
00133 }

void GraphicsOptions_Cache void   ) 
 

Definition at line 1050 of file ui_video.c.

Referenced by GraphicsOptions_MenuInit(), and UI_Cache_f().

01050                                    {
01051     trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_FRAMEL );
01052     trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_FRAMER );
01053     trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_BACK0 );
01054     trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_BACK1 );
01055     trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_ACCEPT0 );
01056     trap_R_RegisterShaderNoMip( GRAPHICSOPTIONS_ACCEPT1 );
01057 }

void InGame_Cache void   ) 
 

Definition at line 329 of file ui_ingame.c.

00329                           {
00330     trap_R_RegisterShaderNoMip( INGAME_FRAME );
00331 }

void Login_Cache void   ) 
 

Definition at line 193 of file ui_login.c.

Referenced by Login_MenuInit().

00193                          {
00194     trap_R_RegisterShaderNoMip( LOGIN_FRAME );
00195 }

void MainMenu_Cache void   ) 
 

Definition at line 140 of file ui_menu.c.

Referenced by UI_Cache_f(), and UI_MainMenu().

00140                             {
00141     s_main.bannerModel = trap_R_RegisterModel( MAIN_BANNER_MODEL );
00142 }

sfxHandle_t Menu_ActivateItem menuframework_s s,
menucommon_s item
 

Definition at line 1567 of file ui_qmenu.c.

01567                                                                         {
01568     if ( item->callback ) {
01569         item->callback( item, QM_ACTIVATED );
01570         if( !( item->flags & QMF_SILENT ) ) {
01571             return menu_move_sound;
01572         }
01573     }
01574 
01575     return 0;
01576 }

void Menu_AddItem menuframework_s menu,
void *  item
 

Definition at line 1266 of file ui_qmenu.c.

01267 {
01268     menucommon_s    *itemptr;
01269 
01270     if (menu->nitems >= MAX_MENUITEMS)
01271         trap_Error ("Menu_AddItem: excessive items");
01272 
01273     menu->items[menu->nitems] = item;
01274     ((menucommon_s*)menu->items[menu->nitems])->parent        = menu;
01275     ((menucommon_s*)menu->items[menu->nitems])->menuPosition  = menu->nitems;
01276     ((menucommon_s*)menu->items[menu->nitems])->flags        &= ~QMF_HASMOUSEFOCUS;
01277 
01278     // perform any item specific initializations
01279     itemptr = (menucommon_s*)item;
01280     if (!(itemptr->flags & QMF_NODEFAULTINIT))
01281     {
01282         switch (itemptr->type)
01283         {
01284             case MTYPE_ACTION:
01285                 Action_Init((menuaction_s*)item);
01286                 break;
01287 
01288             case MTYPE_FIELD:
01289                 MenuField_Init((menufield_s*)item);
01290                 break;
01291 
01292             case MTYPE_SPINCONTROL:
01293                 SpinControl_Init((menulist_s*)item);
01294                 break;
01295 
01296             case MTYPE_RADIOBUTTON:
01297                 RadioButton_Init((menuradiobutton_s*)item);
01298                 break;
01299 
01300             case MTYPE_SLIDER:
01301                 Slider_Init((menuslider_s*)item);
01302                 break;
01303 
01304             case MTYPE_BITMAP:
01305                 Bitmap_Init((menubitmap_s*)item);
01306                 break;
01307 
01308             case MTYPE_TEXT:
01309                 Text_Init((menutext_s*)item);
01310                 break;
01311 
01312             case MTYPE_SCROLLLIST:
01313                 ScrollList_Init((menulist_s*)item);
01314                 break;
01315 
01316             case MTYPE_PTEXT:
01317                 PText_Init((menutext_s*)item);
01318                 break;
01319 
01320             case MTYPE_BTEXT:
01321                 BText_Init((menutext_s*)item);
01322                 break;
01323 
01324             default:
01325                 trap_Error( va("Menu_Init: unknown type %d", itemptr->type) );
01326         }
01327     }
01328 
01329     menu->nitems++;
01330 }

void Menu_AdjustCursor menuframework_s menu,
int  dir
 

Definition at line 1404 of file ui_qmenu.c.

01404                                                       {
01405     menucommon_s    *item = NULL;
01406     qboolean        wrapped = qfalse;
01407 
01408 wrap:
01409     while ( m->cursor >= 0 && m->cursor < m->nitems ) {
01410         item = ( menucommon_s * ) m->items[m->cursor];
01411         if (( item->flags & (QMF_GRAYED|QMF_MOUSEONLY|QMF_INACTIVE) ) ) {
01412             m->cursor += dir;
01413         }
01414         else {
01415             break;
01416         }
01417     }
01418 
01419     if ( dir == 1 ) {
01420         if ( m->cursor >= m->nitems ) {
01421             if ( m->wrapAround ) {
01422                 if ( wrapped ) {
01423                     m->cursor = m->cursor_prev;
01424                     return;
01425                 }
01426                 m->cursor = 0;
01427                 wrapped = qtrue;
01428                 goto wrap;
01429             }
01430             m->cursor = m->cursor_prev;
01431         }
01432     }
01433     else {
01434         if ( m->cursor < 0 ) {
01435             if ( m->wrapAround ) {
01436                 if ( wrapped ) {
01437                     m->cursor = m->cursor_prev;
01438                     return;
01439                 }
01440                 m->cursor = m->nitems - 1;
01441                 wrapped = qtrue;
01442                 goto wrap;
01443             }
01444             m->cursor = m->cursor_prev;
01445         }
01446     }
01447 }

void Menu_Cache void   ) 
 

Definition at line 1714 of file ui_qmenu.c.

Referenced by UI_ConsoleCommand(), UI_DrawConnectScreen(), UI_Init(), and UI_SetActiveMenu().

01715 {
01716     uis.charset         = trap_R_RegisterShaderNoMip( "gfx/2d/bigchars" );
01717     uis.charsetProp     = trap_R_RegisterShaderNoMip( "menu/art/font1_prop.tga" );
01718     uis.charsetPropGlow = trap_R_RegisterShaderNoMip( "menu/art/font1_prop_glo.tga" );
01719     uis.charsetPropB    = trap_R_RegisterShaderNoMip( "menu/art/font2_prop.tga" );
01720     uis.cursor          = trap_R_RegisterShaderNoMip( "menu/art/3_cursor2" );
01721     uis.rb_on           = trap_R_RegisterShaderNoMip( "menu/art/switch_on" );
01722     uis.rb_off          = trap_R_RegisterShaderNoMip( "menu/art/switch_off" );
01723 
01724     uis.whiteShader = trap_R_RegisterShaderNoMip( "white" );
01725     if ( uis.glconfig.hardwareType == GLHW_RAGEPRO ) {
01726         // the blend effect turns to shit with the normal 
01727         uis.menuBackShader  = trap_R_RegisterShaderNoMip( "menubackRagePro" );
01728     } else {
01729         uis.menuBackShader  = trap_R_RegisterShaderNoMip( "menuback" );
01730     }
01731     uis.menuBackNoLogoShader = trap_R_RegisterShaderNoMip( "menubacknologo" );
01732 
01733     menu_in_sound   = trap_S_RegisterSound( "sound/misc/menu1.wav", qfalse );
01734     menu_move_sound = trap_S_RegisterSound( "sound/misc/menu2.wav", qfalse );
01735     menu_out_sound  = trap_S_RegisterSound( "sound/misc/menu3.wav", qfalse );
01736     menu_buzz_sound = trap_S_RegisterSound( "sound/misc/menu4.wav", qfalse );
01737     weaponChangeSound   = trap_S_RegisterSound( "sound/weapons/change.wav", qfalse );
01738 
01739     // need a nonzero sound, make an empty sound for this
01740     menu_null_sound = -1;
01741 
01742     sliderBar = trap_R_RegisterShaderNoMip( "menu/art/slider2" );
01743     sliderButton_0 = trap_R_RegisterShaderNoMip( "menu/art/sliderbutt_0" );
01744     sliderButton_1 = trap_R_RegisterShaderNoMip( "menu/art/sliderbutt_1" );
01745 }

sfxHandle_t Menu_DefaultKey menuframework_s s,
int  key
 

Definition at line 1583 of file ui_qmenu.c.

01584 {
01585     sfxHandle_t     sound = 0;
01586     menucommon_s    *item;
01587     int             cursor_prev;
01588 
01589     // menu system keys
01590     switch ( key )
01591     {
01592         case K_MOUSE2:
01593         case K_ESCAPE:
01594             UI_PopMenu();
01595             return menu_out_sound;
01596     }
01597 
01598     if (!m || !m->nitems)
01599         return 0;
01600 
01601     // route key stimulus to widget
01602     item = Menu_ItemAtCursor( m );
01603     if (item && !(item->flags & (QMF_GRAYED|QMF_INACTIVE)))
01604     {
01605         switch (item->type)
01606         {
01607             case MTYPE_SPINCONTROL:
01608                 sound = SpinControl_Key( (menulist_s*)item, key );
01609                 break;
01610 
01611             case MTYPE_RADIOBUTTON:
01612                 sound = RadioButton_Key( (menuradiobutton_s*)item, key );
01613                 break;
01614 
01615             case MTYPE_SLIDER:
01616                 sound = Slider_Key( (menuslider_s*)item, key );
01617                 break;
01618 
01619             case MTYPE_SCROLLLIST:
01620                 sound = ScrollList_Key( (menulist_s*)item, key );
01621                 break;
01622 
01623             case MTYPE_FIELD:
01624                 sound = MenuField_Key( (menufield_s*)item, &key );
01625                 break;
01626         }
01627 
01628         if (sound) {
01629             // key was handled
01630             return sound;       
01631         }
01632     }
01633 
01634     // default handling
01635     switch ( key )
01636     {
01637 #ifndef NDEBUG
01638         case K_F11:
01639             uis.debug ^= 1;
01640             break;
01641 
01642         case K_F12:
01643             trap_Cmd_ExecuteText(EXEC_APPEND, "screenshot\n");
01644             break;
01645 #endif
01646         case K_KP_UPARROW:
01647         case K_UPARROW:
01648             cursor_prev    = m->cursor;
01649             m->cursor_prev = m->cursor;
01650             m->cursor--;
01651             Menu_AdjustCursor( m, -1 );
01652             if ( cursor_prev != m->cursor ) {
01653                 Menu_CursorMoved( m );
01654                 sound = menu_move_sound;
01655             }
01656             break;
01657 
01658         case K_TAB:
01659         case K_KP_DOWNARROW:
01660         case K_DOWNARROW:
01661             cursor_prev    = m->cursor;
01662             m->cursor_prev = m->cursor;
01663             m->cursor++;
01664             Menu_AdjustCursor( m, 1 );
01665             if ( cursor_prev != m->cursor ) {
01666                 Menu_CursorMoved( m );
01667                 sound = menu_move_sound;
01668             }
01669             break;
01670 
01671         case K_MOUSE1:
01672         case K_MOUSE3:
01673             if (item)
01674                 if ((item->flags & QMF_HASMOUSEFOCUS) && !(item->flags & (QMF_GRAYED|QMF_INACTIVE)))
01675                     return (Menu_ActivateItem( m, item ));
01676             break;
01677 
01678         case K_JOY1:
01679         case K_JOY2:
01680         case K_JOY3:
01681         case K_JOY4:
01682         case K_AUX1:
01683         case K_AUX2:
01684         case K_AUX3:
01685         case K_AUX4:
01686         case K_AUX5:
01687         case K_AUX6:
01688         case K_AUX7:
01689         case K_AUX8:
01690         case K_AUX9:
01691         case K_AUX10:
01692         case K_AUX11:
01693         case K_AUX12:
01694         case K_AUX13:
01695         case K_AUX14:
01696         case K_AUX15:
01697         case K_AUX16:
01698         case K_KP_ENTER:
01699         case K_ENTER:
01700             if (item)
01701                 if (!(item->flags & (QMF_MOUSEONLY|QMF_GRAYED|QMF_INACTIVE)))
01702                     return (Menu_ActivateItem( m, item ));
01703             break;
01704     }
01705 
01706     return sound;
01707 }

void Menu_Draw menuframework_s menu  ) 
 

Definition at line 1454 of file ui_qmenu.c.

01455 {
01456     int             i;
01457     menucommon_s    *itemptr;
01458 
01459     // draw menu
01460     for (i=0; i<menu->nitems; i++)
01461     {
01462         itemptr = (menucommon_s*)menu->items[i];
01463 
01464         if (itemptr->flags & QMF_HIDDEN)
01465             continue;
01466 
01467         if (itemptr->ownerdraw)
01468         {
01469             // total subclassing, owner draws everything
01470             itemptr->ownerdraw( itemptr );
01471         }   
01472         else 
01473         {
01474             switch (itemptr->type)
01475             {   
01476                 case MTYPE_RADIOBUTTON:
01477                     RadioButton_Draw( (menuradiobutton_s*)itemptr );
01478                     break;
01479 
01480                 case MTYPE_FIELD:
01481                     MenuField_Draw( (menufield_s*)itemptr );
01482                     break;
01483         
01484                 case MTYPE_SLIDER:
01485                     Slider_Draw( (menuslider_s*)itemptr );
01486                     break;
01487  
01488                 case MTYPE_SPINCONTROL:
01489                     SpinControl_Draw( (menulist_s*)itemptr );
01490                     break;
01491         
01492                 case MTYPE_ACTION:
01493                     Action_Draw( (menuaction_s*)itemptr );
01494                     break;
01495         
01496                 case MTYPE_BITMAP:
01497                     Bitmap_Draw( (menubitmap_s*)itemptr );
01498                     break;
01499 
01500                 case MTYPE_TEXT:
01501                     Text_Draw( (menutext_s*)itemptr );
01502                     break;
01503 
01504                 case MTYPE_SCROLLLIST:
01505                     ScrollList_Draw( (menulist_s*)itemptr );
01506                     break;
01507                 
01508                 case MTYPE_PTEXT:
01509                     PText_Draw( (menutext_s*)itemptr );
01510                     break;
01511 
01512                 case MTYPE_BTEXT:
01513                     BText_Draw( (menutext_s*)itemptr );
01514                     break;
01515 
01516                 default:
01517                     trap_Error( va("Menu_Draw: unknown type %d", itemptr->type) );
01518             }
01519         }
01520 #ifndef NDEBUG
01521         if( uis.debug ) {
01522             int x;
01523             int y;
01524             int w;
01525             int h;
01526 
01527             if( !( itemptr->flags & QMF_INACTIVE ) ) {
01528                 x = itemptr->left;
01529                 y = itemptr->top;
01530                 w = itemptr->right - itemptr->left + 1;
01531                 h = itemptr->bottom - itemptr->top + 1;
01532 
01533                 if (itemptr->flags & QMF_HASMOUSEFOCUS) {
01534                     UI_DrawRect(x, y, w, h, colorYellow );
01535                 }
01536                 else {
01537                     UI_DrawRect(x, y, w, h, colorWhite );
01538                 }
01539             }
01540         }
01541 #endif
01542     }
01543 
01544     itemptr = Menu_ItemAtCursor( menu );
01545     if ( itemptr && itemptr->statusbar)
01546         itemptr->statusbar( ( void * ) itemptr );
01547 }

void Menu_Focus menucommon_s m  ) 
 

void* Menu_ItemAtCursor menuframework_s m  ) 
 

Definition at line 1554 of file ui_qmenu.c.

01555 {
01556     if ( m->cursor < 0 || m->cursor >= m->nitems )
01557         return 0;
01558 
01559     return m->items[m->cursor];
01560 }

void Menu_SetCursor menuframework_s s,
int  cursor
 

Definition at line 1364 of file ui_qmenu.c.

01365 {
01366     if (((menucommon_s*)(m->items[cursor]))->flags & (QMF_GRAYED|QMF_INACTIVE))
01367     {
01368         // cursor can't go there
01369         return;
01370     }
01371 
01372     m->cursor_prev = m->cursor;
01373     m->cursor      = cursor;
01374 
01375     Menu_CursorMoved( m );
01376 }

void Menu_SetCursorToItem menuframework_s m,
void *  ptr
 

Definition at line 1383 of file ui_qmenu.c.

01384 {
01385     int i;
01386 
01387     for (i=0; i<m->nitems; i++)
01388     {
01389         if (m->items[i] == ptr)
01390         {
01391             Menu_SetCursor( m, i );
01392             return;
01393         }
01394     }
01395 }

void MenuField_Draw menufield_s f  ) 
 

Definition at line 332 of file ui_mfield.c.

00333 {
00334     int     x;
00335     int     y;
00336     int     w;
00337     int     h;
00338     int     style;
00339     qboolean focus;
00340     float   *color;
00341 
00342     x = f->generic.x;
00343     y = f->generic.y;
00344 
00345     if (f->generic.flags & QMF_SMALLFONT)
00346     {
00347         w = SMALLCHAR_WIDTH;
00348         h = SMALLCHAR_HEIGHT;
00349         style = UI_SMALLFONT;
00350     }
00351     else
00352     {
00353         w = BIGCHAR_WIDTH;
00354         h = BIGCHAR_HEIGHT;
00355         style = UI_BIGFONT;
00356     }   
00357 
00358     if (Menu_ItemAtCursor( f->generic.parent ) == f) {
00359         focus = qtrue;
00360         style |= UI_PULSE;
00361     }
00362     else {
00363         focus = qfalse;
00364     }
00365 
00366     if (f->generic.flags & QMF_GRAYED)
00367         color = text_color_disabled;
00368     else if (focus)
00369         color = text_color_highlight;
00370     else
00371         color = text_color_normal;
00372 
00373     if ( focus )
00374     {
00375         // draw cursor
00376         UI_FillRect( f->generic.left, f->generic.top, f->generic.right-f->generic.left+1, f->generic.bottom-f->generic.top+1, listbar_color ); 
00377         UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|style, color);
00378     }
00379 
00380     if ( f->generic.name ) {
00381         UI_DrawString( x - w, y, f->generic.name, style|UI_RIGHT, color );
00382     }
00383 
00384     MField_Draw( &f->field, x + w, y, style, color );
00385 }

void MenuField_Init menufield_s m  ) 
 

Definition at line 296 of file ui_mfield.c.

00296                                       {
00297     int l;
00298     int w;
00299     int h;
00300 
00301     MField_Clear( &m->field );
00302 
00303     if (m->generic.flags & QMF_SMALLFONT)
00304     {
00305         w = SMALLCHAR_WIDTH;
00306         h = SMALLCHAR_HEIGHT;
00307     }
00308     else
00309     {
00310         w = BIGCHAR_WIDTH;
00311         h = BIGCHAR_HEIGHT;
00312     }   
00313 
00314     if (m->generic.name) {
00315         l = (strlen( m->generic.name )+1) * w;      
00316     }
00317     else {
00318         l = 0;
00319     }
00320 
00321     m->generic.left   = m->generic.x - l;
00322     m->generic.top    = m->generic.y;
00323     m->generic.right  = m->generic.x + w + m->field.widthInChars*w;
00324     m->generic.bottom = m->generic.y + h;
00325 }

sfxHandle_t MenuField_Key menufield_s m,
int *  key
 

Definition at line 392 of file ui_mfield.c.

00393 {
00394     int keycode;
00395 
00396     keycode = *key;
00397 
00398     switch ( keycode )
00399     {
00400         case K_KP_ENTER:
00401         case K_ENTER:
00402         case K_JOY1:
00403         case K_JOY2:
00404         case K_JOY3:
00405         case K_JOY4:
00406             // have enter go to next cursor point
00407             *key = K_TAB;
00408             break;
00409 
00410         case K_TAB:
00411         case K_KP_DOWNARROW:
00412         case K_DOWNARROW:
00413         case K_KP_UPARROW:
00414         case K_UPARROW:
00415             break;
00416 
00417         default:
00418             if ( keycode & K_CHAR_FLAG )
00419             {
00420                 keycode &= ~K_CHAR_FLAG;
00421 
00422                 if ((m->generic.flags & QMF_UPPERCASE) && Q_islower( keycode ))
00423                     keycode -= 'a' - 'A';
00424                 else if ((m->generic.flags & QMF_LOWERCASE) && Q_isupper( keycode ))
00425                     keycode -= 'A' - 'a';
00426                 else if ((m->generic.flags & QMF_NUMBERSONLY) && Q_isalpha( keycode ))
00427                     return (menu_buzz_sound);
00428 
00429                 MField_CharEvent( &m->field, keycode);
00430             }
00431             else
00432                 MField_KeyDownEvent( &m->field, keycode );
00433             break;
00434     }
00435 
00436     return (0);
00437 }

void MField_CharEvent mfield_t edit,
int  ch
 

Definition at line 207 of file ui_mfield.c.

00207                                                 {
00208     int     len;
00209 
00210     if ( ch == 'v' - 'a' + 1 ) {    // ctrl-v is paste
00211         MField_Paste( edit );
00212         return;
00213     }
00214 
00215     if ( ch == 'c' - 'a' + 1 ) {    // ctrl-c clears the field
00216         MField_Clear( edit );
00217         return;
00218     }
00219 
00220     len = strlen( edit->buffer );
00221 
00222     if ( ch == 'h' - 'a' + 1 )  {   // ctrl-h is backspace
00223         if ( edit->cursor > 0 ) {
00224             memmove( edit->buffer + edit->cursor - 1, 
00225                 edit->buffer + edit->cursor, len + 1 - edit->cursor );
00226             edit->cursor--;
00227             if ( edit->cursor < edit->scroll )
00228             {
00229                 edit->scroll--;
00230             }
00231         }
00232         return;
00233     }
00234 
00235     if ( ch == 'a' - 'a' + 1 ) {    // ctrl-a is home
00236         edit->cursor = 0;
00237         edit->scroll = 0;
00238         return;
00239     }
00240 
00241     if ( ch == 'e' - 'a' + 1 ) {    // ctrl-e is end
00242         edit->cursor = len;
00243         edit->scroll = edit->cursor - edit->widthInChars + 1;
00244         if (edit->scroll < 0)
00245             edit->scroll = 0;
00246         return;
00247     }
00248 
00249     //
00250     // ignore any other non printable chars
00251     //
00252     if ( ch < 32 ) {
00253         return;
00254     }
00255 
00256     if ( !trap_Key_GetOverstrikeMode() ) {  
00257         if ((edit->cursor == MAX_EDIT_LINE - 1) || (edit->maxchars && edit->cursor >= edit->maxchars))
00258             return;
00259     } else {
00260         // insert mode
00261         if (( len == MAX_EDIT_LINE - 1 ) || (edit->maxchars && len >= edit->maxchars))
00262             return;
00263         memmove( edit->buffer + edit->cursor + 1, edit->buffer + edit->cursor, len + 1 - edit->cursor );
00264     }
00265 
00266     edit->buffer[edit->cursor] = ch;
00267     if (!edit->maxchars || edit->cursor < edit->maxchars-1)
00268         edit->cursor++;
00269 
00270     if ( edit->cursor >= edit->widthInChars )
00271     {
00272         edit->scroll++;
00273     }
00274 
00275     if ( edit->cursor == len + 1) {
00276         edit->buffer[edit->cursor] = 0;
00277     }
00278 }

void MField_Clear mfield_t edit  ) 
 

Definition at line 285 of file ui_mfield.c.

00285                                     {
00286     edit->buffer[0] = 0;
00287     edit->cursor = 0;
00288     edit->scroll = 0;
00289 }

void MField_Draw mfield_t edit,
int  x,
int  y,
int  style,
vec4_t  color
 

Definition at line 33 of file ui_mfield.c.

00033                                                                           {
00034     int     len;
00035     int     charw;
00036     int     drawLen;
00037     int     prestep;
00038     int     cursorChar;
00039     char    str[MAX_STRING_CHARS];
00040 
00041     drawLen = edit->widthInChars;
00042     len     = strlen( edit->buffer ) + 1;
00043 
00044     // guarantee that cursor will be visible
00045     if ( len <= drawLen ) {
00046         prestep = 0;
00047     } else {
00048         if ( edit->scroll + drawLen > len ) {
00049             edit->scroll = len - drawLen;
00050             if ( edit->scroll < 0 ) {
00051                 edit->scroll = 0;
00052             }
00053         }
00054         prestep = edit->scroll;
00055     }
00056 
00057     if ( prestep + drawLen > len ) {
00058         drawLen = len - prestep;
00059     }
00060 
00061     // extract <drawLen> characters from the field at <prestep>
00062     if ( drawLen >= MAX_STRING_CHARS ) {
00063         trap_Error( "drawLen >= MAX_STRING_CHARS" );
00064     }
00065     memcpy( str, edit->buffer + prestep, drawLen );
00066     str[ drawLen ] = 0;
00067 
00068     UI_DrawString( x, y, str, style, color );
00069 
00070     // draw the cursor
00071     if (!(style & UI_PULSE)) {
00072         return;
00073     }
00074 
00075     if ( trap_Key_GetOverstrikeMode() ) {
00076         cursorChar = 11;
00077     } else {
00078         cursorChar = 10;
00079     }
00080 
00081     style &= ~UI_PULSE;
00082     style |= UI_BLINK;
00083 
00084     if (style & UI_SMALLFONT)
00085     {
00086         charw = SMALLCHAR_WIDTH;
00087     }
00088     else if (style & UI_GIANTFONT)
00089     {
00090         charw = GIANTCHAR_WIDTH;
00091     }
00092     else
00093     {
00094         charw = BIGCHAR_WIDTH;
00095     }
00096 
00097     if (style & UI_CENTER)
00098     {
00099         len = strlen(str);
00100         x = x - len*charw/2;
00101     }
00102     else if (style & UI_RIGHT)
00103     {
00104         len = strlen(str);
00105         x = x - len*charw;
00106     }
00107     
00108     UI_DrawChar( x + ( edit->cursor - prestep ) * charw, y, cursorChar, style & ~(UI_CENTER|UI_RIGHT), color );
00109 }

void MField_KeyDownEvent mfield_t edit,
int  key
 

Definition at line 139 of file ui_mfield.c.

00139                                                     {
00140     int     len;
00141 
00142     // shift-insert is paste
00143     if ( ( ( key == K_INS ) || ( key == K_KP_INS ) ) && trap_Key_IsDown( K_SHIFT ) ) {
00144         MField_Paste( edit );
00145         return;
00146     }
00147 
00148     len = strlen( edit->buffer );
00149 
00150     if ( key == K_DEL || key == K_KP_DEL ) {
00151         if ( edit->cursor < len ) {
00152             memmove( edit->buffer + edit->cursor, 
00153                 edit->buffer + edit->cursor + 1, len - edit->cursor );
00154         }
00155         return;
00156     }
00157 
00158     if ( key == K_RIGHTARROW || key == K_KP_RIGHTARROW ) 
00159     {
00160         if ( edit->cursor < len ) {
00161             edit->cursor++;
00162         }
00163         if ( edit->cursor >= edit->scroll + edit->widthInChars && edit->cursor <= len )
00164         {
00165             edit->scroll++;
00166         }
00167         return;
00168     }
00169 
00170     if ( key == K_LEFTARROW || key == K_KP_LEFTARROW ) 
00171     {
00172         if ( edit->cursor > 0 ) {
00173             edit->cursor--;
00174         }
00175         if ( edit->cursor < edit->scroll )
00176         {
00177             edit->scroll--;
00178         }
00179         return;
00180     }
00181 
00182     if ( key == K_HOME || key == K_KP_HOME || ( tolower(key) == 'a' && trap_Key_IsDown( K_CTRL ) ) ) {
00183         edit->cursor = 0;
00184         edit->scroll = 0;
00185         return;
00186     }
00187 
00188     if ( key == K_END || key == K_KP_END || ( tolower(key) == 'e' && trap_Key_IsDown( K_CTRL ) ) ) {
00189         edit->cursor = len;
00190         edit->scroll = len - edit->widthInChars + 1;
00191         if (edit->scroll < 0)
00192             edit->scroll = 0;
00193         return;
00194     }
00195 
00196     if ( key == K_INS || key == K_KP_INS ) {
00197         trap_Key_SetOverstrikeMode( !trap_Key_GetOverstrikeMode() );
00198         return;
00199     }
00200 }

void PlayerModel_Cache void   ) 
 

Definition at line 708 of file ui_playermodel.c.

Referenced by PlayerModel_MenuInit(), and UI_Cache_f().

00709 {
00710     int i;
00711 
00712     for( i = 0; playermodel_artlist[i]; i++ ) {
00713         trap_R_RegisterShaderNoMip( playermodel_artlist[i] );
00714     }
00715 
00716     PlayerModel_BuildList();
00717     for( i = 0; i < s_playermodel.nummodels; i++ ) {
00718         trap_R_RegisterShaderNoMip( s_playermodel.modelnames[i] );
00719     }
00720 }

void PlayerSettings_Cache void   ) 
 

Definition at line 486 of file ui_playersettings.c.

Referenced by PlayerSettings_MenuInit(), and UI_Cache_f().

00486                                   {
00487     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00488     trap_R_RegisterShaderNoMip( ART_FRAMER );
00489     trap_R_RegisterShaderNoMip( ART_MODEL0 );
00490     trap_R_RegisterShaderNoMip( ART_MODEL1 );
00491     trap_R_RegisterShaderNoMip( ART_BACK0 );
00492     trap_R_RegisterShaderNoMip( ART_BACK1 );
00493 
00494     s_playersettings.fxBasePic = trap_R_RegisterShaderNoMip( ART_FX_BASE );
00495     s_playersettings.fxPic[0] = trap_R_RegisterShaderNoMip( ART_FX_RED );
00496     s_playersettings.fxPic[1] = trap_R_RegisterShaderNoMip( ART_FX_YELLOW );
00497     s_playersettings.fxPic[2] = trap_R_RegisterShaderNoMip( ART_FX_GREEN );
00498     s_playersettings.fxPic[3] = trap_R_RegisterShaderNoMip( ART_FX_TEAL );
00499     s_playersettings.fxPic[4] = trap_R_RegisterShaderNoMip( ART_FX_BLUE );
00500     s_playersettings.fxPic[5] = trap_R_RegisterShaderNoMip( ART_FX_CYAN );
00501     s_playersettings.fxPic[6] = trap_R_RegisterShaderNoMip( ART_FX_WHITE );
00502 }

void Preferences_Cache void   ) 
 

Definition at line 398 of file ui_preferences.c.

Referenced by Preferences_MenuInit(), and UI_Cache_f().

00398                                {
00399     int     n;
00400 
00401     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00402     trap_R_RegisterShaderNoMip( ART_FRAMER );
00403     trap_R_RegisterShaderNoMip( ART_BACK0 );
00404     trap_R_RegisterShaderNoMip( ART_BACK1 );
00405     for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
00406         s_preferences.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
00407     }
00408 }

void Rankings_Cache void   ) 
 

Definition at line 405 of file ui_rankings.c.

References RANKINGS_FRAME, and trap_R_RegisterShaderNoMip().

Referenced by Rankings_MenuInit().

00405                             {
00406     trap_R_RegisterShaderNoMip( RANKINGS_FRAME );
00407 }

Here is the call graph for this function:

void Rankings_DrawName void *  self  ) 
 

Definition at line 120 of file ui_rankings.c.

References mfield_t::buffer, mfield_t::cursor, f, menufield_s::field, length(), p, Q_CleanStr(), Q_isalpha(), Rankings_DrawText(), and strlen().

00121 {
00122     menufield_s     *f;
00123     int             length;
00124     char*           p;
00125     
00126     f = (menufield_s*)self;
00127 
00128     // GRANK_FIXME - enforce valid characters
00129     for( p = f->field.buffer; *p != '\0'; p++ )
00130     {
00131         //if( ispunct(*p) || isspace(*p) )
00132         if( !( ( (*p) >= '0' && (*p) <= '9') || Q_isalpha(*p)) )
00133         {
00134             *p = '\0';
00135         }
00136     }
00137     
00138     // strip color codes
00139     Q_CleanStr( f->field.buffer );
00140     length = strlen( f->field.buffer );
00141     if( f->field.cursor > length )
00142     {
00143         f->field.cursor = length;
00144     }   
00145 
00146     Rankings_DrawText( f );
00147 }

Here is the call graph for this function:

void Rankings_DrawPassword void *  self  ) 
 

Definition at line 191 of file ui_rankings.c.

References mfield_t::buffer, mfield_t::cursor, f, menufield_s::field, i, length(), p, Q_isalpha(), Q_strncpyz(), Rankings_DrawText(), and strlen().

00192 {
00193     menufield_s*    f;
00194     char            password[MAX_EDIT_LINE];
00195     int             length;
00196     int             i;
00197     char*           p;
00198 
00199     f = (menufield_s*)self;
00200     
00201     // GRANK_FIXME - enforce valid characters
00202     for( p = f->field.buffer; *p != '\0'; p++ )
00203     {
00204         //if( ispunct(*p) || isspace(*p) )
00205         if( !( ( (*p) >= '0' && (*p) <= '9') || Q_isalpha(*p)) )
00206         {
00207             *p = '\0';
00208         }
00209     }
00210     
00211     length = strlen( f->field.buffer );
00212     if( f->field.cursor > length )
00213     {
00214         f->field.cursor = length;
00215     }
00216     
00217     // save password
00218     Q_strncpyz( password, f->field.buffer, sizeof(password) );
00219 
00220     // mask password with *
00221     for( i = 0; i < length; i++ )
00222     {
00223         f->field.buffer[i] = '*';
00224     }
00225 
00226     // draw masked password
00227     Rankings_DrawText( f );
00228     //MenuField_Draw( f );
00229 
00230     // restore password
00231     Q_strncpyz( f->field.buffer, password, sizeof(f->field.buffer) );
00232 }

Here is the call graph for this function:

void Rankings_DrawText void *  self  ) 
 

Definition at line 68 of file ui_rankings.c.

References mfield_t::buffer, c, COLOR_WHITE, color_white, ColorIndex, _tag_menuframework::cursor, mfield_t::cursor, f, menufield_s::field, g_color_table, menufield_s::generic, menucommon_s::menuPosition, menucommon_s::parent, qboolean, SMALLCHAR_WIDTH, trap_Key_GetOverstrikeMode(), UI_DrawChar(), UI_LEFT, menucommon_s::x, x, y, and menucommon_s::y.

Referenced by Rankings_DrawName(), and Rankings_DrawPassword().

00069 {
00070     menufield_s     *f;
00071     qboolean        focus;
00072     int             style;
00073     char            *txt;
00074     char            c;
00075     float           *color;
00076     int             basex, x, y;
00077 
00078     f = (menufield_s*)self;
00079     basex = f->generic.x;
00080     y = f->generic.y + 4;
00081     focus = (f->generic.parent->cursor == f->generic.menuPosition);
00082 
00083     style = UI_LEFT|UI_SMALLFONT;
00084     color = text_color_normal;
00085     if( focus ) {
00086         style |= UI_PULSE;
00087         color = text_color_highlight;
00088     }
00089 
00090     // draw the actual text
00091     txt = f->field.buffer;
00092     color = g_color_table[ColorIndex(COLOR_WHITE)];
00093     x = basex;
00094     while ( (c = *txt) != 0 ) {
00095         UI_DrawChar( x, y, c, style, color );
00096         txt++;
00097         x += SMALLCHAR_WIDTH;
00098     }
00099 
00100     // draw cursor if we have focus
00101     if( focus ) {
00102         if ( trap_Key_GetOverstrikeMode() ) {
00103             c = 11;
00104         } else {
00105             c = 10;
00106         }
00107 
00108         style &= ~UI_PULSE;
00109         style |= UI_BLINK;
00110 
00111         UI_DrawChar( basex + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white );
00112     }
00113 }

Here is the call graph for this function:

void RankStatus_Cache void   ) 
 

Definition at line 158 of file ui_rankstatus.c.

Referenced by RankStatus_MenuInit().

00158                               {
00159     trap_R_RegisterShaderNoMip( RANKSTATUS_FRAME );
00160 }

void ScrollList_Draw menulist_s l  ) 
 

Definition at line 1202 of file ui_qmenu.c.

01203 {
01204     int         x;
01205     int         u;
01206     int         y;
01207     int         i;
01208     int         base;
01209     int         column;
01210     float*      color;
01211     qboolean    hasfocus;
01212     int         style;
01213 
01214     hasfocus = (l->generic.parent->cursor == l->generic.menuPosition);
01215 
01216     x = l->generic.x;
01217     for( column = 0; column < l->columns; column++ ) {
01218         y = l->generic.y;
01219         base = l->top + column * l->height;
01220         for( i = base; i < base + l->height; i++) {
01221             if (i >= l->numitems)
01222                 break;
01223 
01224             if (i == l->curvalue)
01225             {
01226                 u = x - 2;
01227                 if( l->generic.flags & QMF_CENTER_JUSTIFY ) {
01228                     u -= (l->width * SMALLCHAR_WIDTH) / 2 + 1;
01229                 }
01230 
01231                 UI_FillRect(u,y,l->width*SMALLCHAR_WIDTH,SMALLCHAR_HEIGHT+2,listbar_color);
01232                 color = text_color_highlight;
01233 
01234                 if (hasfocus)
01235                     style = UI_PULSE|UI_LEFT|UI_SMALLFONT;
01236                 else
01237                     style = UI_LEFT|UI_SMALLFONT;
01238             }
01239             else
01240             {
01241                 color = text_color_normal;
01242                 style = UI_LEFT|UI_SMALLFONT;
01243             }
01244             if( l->generic.flags & QMF_CENTER_JUSTIFY ) {
01245                 style |= UI_CENTER;
01246             }
01247 
01248             UI_DrawString(
01249                 x,
01250                 y,
01251                 l->itemnames[i],
01252                 style,
01253                 color);
01254 
01255             y += SMALLCHAR_HEIGHT;
01256         }
01257         x += (l->width + l->seperation) * SMALLCHAR_WIDTH;
01258     }
01259 }

sfxHandle_t ScrollList_Key menulist_s l,
int  key
 

Definition at line 921 of file ui_qmenu.c.

References c, menucommon_s::callback, menulist_s::columns, uiStatic_t::cursorx, uiStatic_t::cursory, menulist_s::curvalue, menucommon_s::flags, menulist_s::generic, menulist_s::height, i, menulist_s::itemnames, j, K_DOWNARROW, K_END, K_HOME, K_KP_DOWNARROW, K_KP_END, K_KP_HOME, K_KP_LEFTARROW, K_KP_PGDN, K_KP_PGUP, K_KP_RIGHTARROW, K_KP_UPARROW, K_LEFTARROW, K_MOUSE1, K_PGDN, K_PGUP, K_RIGHTARROW, K_UPARROW, l, menulist_s::numitems, menulist_s::oldvalue, Q_isprint(), Q_isupper(), QM_GOTFOCUS, menulist_s::seperation, sfxHandle_t, SMALLCHAR_HEIGHT, menulist_s::top, UI_CursorInRect(), uis, w, menulist_s::width, menucommon_s::x, x, menucommon_s::y, and y.

00922 {
00923     int x;
00924     int y;
00925     int w;
00926     int i;
00927     int j;  
00928     int c;
00929     int cursorx;
00930     int cursory;
00931     int column;
00932     int index;
00933 
00934     switch (key)
00935     {
00936         case K_MOUSE1:
00937             if (l->generic.flags & QMF_HASMOUSEFOCUS)
00938             {
00939                 // check scroll region
00940                 x = l->generic.x;
00941                 y = l->generic.y;
00942                 w = ( (l->width + l->seperation) * l->columns - l->seperation) * SMALLCHAR_WIDTH;
00943                 if( l->generic.flags & QMF_CENTER_JUSTIFY ) {
00944                     x -= w / 2;
00945                 }
00946                 if (UI_CursorInRect( x, y, w, l->height*SMALLCHAR_HEIGHT ))
00947                 {
00948                     cursorx = (uis.cursorx - x)/SMALLCHAR_WIDTH;
00949                     column = cursorx / (l->width + l->seperation);
00950                     cursory = (uis.cursory - y)/SMALLCHAR_HEIGHT;
00951                     index = column * l->height + cursory;
00952                     if (l->top + index < l->numitems)
00953                     {
00954                         l->oldvalue = l->curvalue;
00955                         l->curvalue = l->top + index;
00956 
00957                         if (l->oldvalue != l->curvalue && l->generic.callback)
00958                         {
00959                             l->generic.callback( l, QM_GOTFOCUS );
00960                             return (menu_move_sound);
00961                         }
00962                     }
00963                 }
00964             
00965                 // absorbed, silent sound effect
00966                 return (menu_null_sound);
00967             }
00968             break;
00969 
00970         case K_KP_HOME:
00971         case K_HOME:
00972             l->oldvalue = l->curvalue;
00973             l->curvalue = 0;
00974             l->top      = 0;
00975 
00976             if (l->oldvalue != l->curvalue && l->generic.callback)
00977             {
00978                 l->generic.callback( l, QM_GOTFOCUS );
00979                 return (menu_move_sound);
00980             }
00981             return (menu_buzz_sound);
00982 
00983         case K_KP_END:
00984         case K_END:
00985             l->oldvalue = l->curvalue;
00986             l->curvalue = l->numitems-1;
00987             if( l->columns > 1 ) {
00988                 c = (l->curvalue / l->height + 1) * l->height;
00989                 l->top = c - (l->columns * l->height);
00990             }
00991             else {
00992                 l->top = l->curvalue - (l->height - 1);
00993             }
00994             if (l->top < 0)
00995                 l->top = 0;         
00996 
00997             if (l->oldvalue != l->curvalue && l->generic.callback)
00998             {
00999                 l->generic.callback( l, QM_GOTFOCUS );
01000                 return (menu_move_sound);
01001             }
01002             return (menu_buzz_sound);
01003 
01004         case K_PGUP:
01005         case K_KP_PGUP:
01006             if( l->columns > 1 ) {
01007                 return menu_null_sound;
01008             }
01009 
01010             if (l->curvalue > 0)
01011             {
01012                 l->oldvalue = l->curvalue;
01013                 l->curvalue -= l->height-1;
01014                 if (l->curvalue < 0)
01015                     l->curvalue = 0;
01016                 l->top = l->curvalue;
01017                 if (l->top < 0)
01018                     l->top = 0;
01019 
01020                 if (l->generic.callback)
01021                     l->generic.callback( l, QM_GOTFOCUS );
01022 
01023                 return (menu_move_sound);
01024             }
01025             return (menu_buzz_sound);
01026 
01027         case K_PGDN:
01028         case K_KP_PGDN:
01029             if( l->columns > 1 ) {
01030                 return menu_null_sound;
01031             }
01032 
01033             if (l->curvalue < l->numitems-1)
01034             {
01035                 l->oldvalue = l->curvalue;
01036                 l->curvalue += l->height-1;
01037                 if (l->curvalue > l->numitems-1)
01038                     l->curvalue = l->numitems-1;
01039                 l->top = l->curvalue - (l->height-1);
01040                 if (l->top < 0)
01041                     l->top = 0;
01042 
01043                 if (l->generic.callback)
01044                     l->generic.callback( l, QM_GOTFOCUS );
01045 
01046                 return (menu_move_sound);
01047             }
01048             return (menu_buzz_sound);
01049 
01050         case K_KP_UPARROW:
01051         case K_UPARROW:
01052             if( l->curvalue == 0 ) {
01053                 return menu_buzz_sound;
01054             }
01055 
01056             l->oldvalue = l->curvalue;
01057             l->curvalue--;
01058 
01059             if( l->curvalue < l->top ) {
01060                 if( l->columns == 1 ) {
01061                     l->top--;
01062                 }
01063                 else {
01064                     l->top -= l->height;
01065                 }
01066             }
01067 
01068             if( l->generic.callback ) {
01069                 l->generic.callback( l, QM_GOTFOCUS );
01070             }
01071 
01072             return (menu_move_sound);
01073 
01074         case K_KP_DOWNARROW:
01075         case K_DOWNARROW:
01076             if( l->curvalue == l->numitems - 1 ) {
01077                 return menu_buzz_sound;
01078             }
01079 
01080             l->oldvalue = l->curvalue;
01081             l->curvalue++;
01082 
01083             if( l->curvalue >= l->top + l->columns * l->height ) {
01084                 if( l->columns == 1 ) {
01085                     l->top++;
01086                 }
01087                 else {
01088                     l->top += l->height;
01089                 }
01090             }
01091 
01092             if( l->generic.callback ) {
01093                 l->generic.callback( l, QM_GOTFOCUS );
01094             }
01095 
01096             return menu_move_sound;
01097 
01098         case K_KP_LEFTARROW:
01099         case K_LEFTARROW:
01100             if( l->columns == 1 ) {
01101                 return menu_null_sound;
01102             }
01103 
01104             if( l->curvalue < l->height ) {
01105                 return menu_buzz_sound;
01106             }
01107 
01108             l->oldvalue = l->curvalue;
01109             l->curvalue -= l->height;
01110 
01111             if( l->curvalue < l->top ) {
01112                 l->top -= l->height;
01113             }
01114 
01115             if( l->generic.callback ) {
01116                 l->generic.callback( l, QM_GOTFOCUS );
01117             }
01118 
01119             return menu_move_sound;
01120 
01121         case K_KP_RIGHTARROW:
01122         case K_RIGHTARROW:
01123             if( l->columns == 1 ) {
01124                 return menu_null_sound;
01125             }
01126 
01127             c = l->curvalue + l->height;
01128 
01129             if( c >= l->numitems ) {
01130                 return menu_buzz_sound;
01131             }
01132 
01133             l->oldvalue = l->curvalue;
01134             l->curvalue = c;
01135 
01136             if( l->curvalue > l->top + l->columns * l->height - 1 ) {
01137                 l->top += l->height;
01138             }
01139 
01140             if( l->generic.callback ) {
01141                 l->generic.callback( l, QM_GOTFOCUS );
01142             }
01143 
01144             return menu_move_sound;
01145     }
01146 
01147     // cycle look for ascii key inside list items
01148     if ( !Q_isprint( key ) )
01149         return (0);
01150 
01151     // force to lower for case insensitive compare
01152     if ( Q_isupper( key ) )
01153     {
01154         key -= 'A' - 'a';
01155     }
01156 
01157     // iterate list items
01158     for (i=1; i<=l->numitems; i++)
01159     {
01160         j = (l->curvalue + i) % l->numitems;
01161         c = l->itemnames[j][0];
01162         if ( Q_isupper( c ) )
01163         {
01164             c -= 'A' - 'a';
01165         }
01166 
01167         if (c == key)
01168         {
01169             // set current item, mimic windows listbox scroll behavior
01170             if (j < l->top)
01171             {
01172                 // behind top most item, set this as new top
01173                 l->top = j;
01174             }
01175             else if (j > l->top+l->height-1)
01176             {
01177                 // past end of list box, do page down
01178                 l->top = (j+1) - l->height;
01179             }
01180             
01181             if (l->curvalue != j)
01182             {
01183                 l->oldvalue = l->curvalue;
01184                 l->curvalue = j;
01185                 if (l->generic.callback)
01186                     l->generic.callback( l, QM_GOTFOCUS );
01187                 return ( menu_move_sound );         
01188             }
01189 
01190             return (menu_buzz_sound);
01191         }
01192     }
01193 
01194     return (menu_buzz_sound);
01195 }

Here is the call graph for this function:

void ServerInfo_Cache void   ) 
 

Definition at line 167 of file ui_serverinfo.c.

Referenced by UI_Cache_f(), and UI_ServerInfoMenu().

00168 {
00169     int i;
00170 
00171     // touch all our pics
00172     for (i=0; ;i++)
00173     {
00174         if (!serverinfo_artlist[i])
00175             break;
00176         trap_R_RegisterShaderNoMip(serverinfo_artlist[i]);
00177     }
00178 }

void ServerOptions_Cache void   ) 
 

Definition at line 1479 of file ui_startserver.c.

Referenced by ServerOptions_MenuInit(), and UI_Cache_f().

01479                                  {
01480     trap_R_RegisterShaderNoMip( GAMESERVER_BACK0 );
01481     trap_R_RegisterShaderNoMip( GAMESERVER_BACK1 );
01482     trap_R_RegisterShaderNoMip( GAMESERVER_FIGHT0 );
01483     trap_R_RegisterShaderNoMip( GAMESERVER_FIGHT1 );
01484     trap_R_RegisterShaderNoMip( GAMESERVER_SELECT );
01485     trap_R_RegisterShaderNoMip( GAMESERVER_UNKNOWNMAP );
01486 }

void Signup_Cache void   ) 
 

Definition at line 271 of file ui_signup.c.

Referenced by Signup_MenuInit().

00271                           {
00272     trap_R_RegisterShaderNoMip( SIGNUP_FRAME );
00273 }

void SpecifyLeague_Cache void   ) 
 

Definition at line 310 of file ui_specifyleague.c.

Referenced by SpecifyLeague_MenuInit().

00311 {
00312     int i;
00313 
00314     // touch all our pics
00315     for (i=0; ;i++)
00316     {
00317         if (!specifyleague_artlist[i])
00318             break;
00319         trap_R_RegisterShaderNoMip(specifyleague_artlist[i]);
00320     }
00321 }

void SpecifyServer_Cache void   ) 
 

Definition at line 190 of file ui_specifyserver.c.

Referenced by SpecifyServer_MenuInit(), and UI_Cache_f().

00191 {
00192     int i;
00193 
00194     // touch all our pics
00195     for (i=0; ;i++)
00196     {
00197         if (!specifyserver_artlist[i])
00198             break;
00199         trap_R_RegisterShaderNoMip(specifyserver_artlist[i]);
00200     }
00201 }

void StartServer_Cache void   ) 
 

Definition at line 553 of file ui_startserver.c.

Referenced by StartServer_MenuInit(), and UI_Cache_f().

00554 {
00555     int             i;
00556     const char      *info;
00557     qboolean        precache;
00558     char            picname[64];
00559 
00560     trap_R_RegisterShaderNoMip( GAMESERVER_BACK0 ); 
00561     trap_R_RegisterShaderNoMip( GAMESERVER_BACK1 ); 
00562     trap_R_RegisterShaderNoMip( GAMESERVER_NEXT0 ); 
00563     trap_R_RegisterShaderNoMip( GAMESERVER_NEXT1 ); 
00564     trap_R_RegisterShaderNoMip( GAMESERVER_FRAMEL );    
00565     trap_R_RegisterShaderNoMip( GAMESERVER_FRAMER );    
00566     trap_R_RegisterShaderNoMip( GAMESERVER_SELECT );    
00567     trap_R_RegisterShaderNoMip( GAMESERVER_SELECTED );  
00568     trap_R_RegisterShaderNoMip( GAMESERVER_UNKNOWNMAP );
00569     trap_R_RegisterShaderNoMip( GAMESERVER_ARROWS );
00570     trap_R_RegisterShaderNoMip( GAMESERVER_ARROWSL );
00571     trap_R_RegisterShaderNoMip( GAMESERVER_ARROWSR );
00572 
00573     precache = trap_Cvar_VariableValue("com_buildscript");
00574 
00575     s_startserver.nummaps = UI_GetNumArenas();
00576 
00577     for( i = 0; i < s_startserver.nummaps; i++ ) {
00578         info = UI_GetArenaInfoByNumber( i );
00579 
00580         Q_strncpyz( s_startserver.maplist[i], Info_ValueForKey( info, "map"), MAX_NAMELENGTH );
00581         Q_strupr( s_startserver.maplist[i] );
00582         s_startserver.mapGamebits[i] = GametypeBits( Info_ValueForKey( info, "type") );
00583 
00584         if( precache ) {
00585             Com_sprintf( picname, sizeof(picname), "levelshots/%s", s_startserver.maplist[i] );
00586             trap_R_RegisterShaderNoMip(picname);
00587         }
00588     }
00589 
00590     s_startserver.maxpages = (s_startserver.nummaps + MAX_MAPSPERPAGE-1)/MAX_MAPSPERPAGE;
00591 }

void TeamMain_Cache void   ) 
 

Definition at line 197 of file ui_team.c.

Referenced by TeamMain_MenuInit(), and UI_Cache_f().

00197                             {
00198     trap_R_RegisterShaderNoMip( TEAMMAIN_FRAME );
00199 }

int trap_Argc void   ) 
 

Definition at line 73 of file cg_syscalls.c.

00073                           {
00074     return syscall( CG_ARGC );
00075 }

void trap_Argv int  n,
char *  buffer,
int  bufferLength
 

Definition at line 77 of file cg_syscalls.c.

00077                                                            {
00078     syscall( CG_ARGV, n, buffer, bufferLength );
00079 }

int trap_CM_LerpTag orientation_t tag,
clipHandle_t  mod,
int  startFrame,
int  endFrame,
float  frac,
const char *  tagName
 

Definition at line 181 of file ui_syscalls.c.

00181                                                                                                                            {
00182     return syscall( UI_CM_LERPTAG, tag, mod, startFrame, endFrame, PASSFLOAT(frac), tagName );
00183 }

void trap_Cmd_ExecuteText int  exec_when,
const char *  text
 

Definition at line 101 of file ui_syscalls.c.

00101                                                              {
00102     syscall( UI_CMD_EXECUTETEXT, exec_when, text );
00103 }

void trap_Cvar_Create const char *  var_name,
const char *  var_value,
int  flags
 

Definition at line 85 of file ui_syscalls.c.

00085                                                                                 {
00086     syscall( UI_CVAR_CREATE, var_name, var_value, flags );
00087 }

void trap_Cvar_InfoStringBuffer int  bit,
char *  buffer,
int  bufsize
 

Definition at line 89 of file ui_syscalls.c.

00089                                                                       {
00090     syscall( UI_CVAR_INFOSTRINGBUFFER, bit, buffer, bufsize );
00091 }

void trap_Cvar_Register vmCvar_t vmCvar,
const char *  varName,
const char *  defaultValue,
int  flags
 

Definition at line 57 of file cg_syscalls.c.

00057                                                                                                          {
00058     syscall( CG_CVAR_REGISTER, vmCvar, varName, defaultValue, flags );
00059 }

void trap_Cvar_Reset const char *  name  ) 
 

Definition at line 81 of file ui_syscalls.c.

00081                                          {
00082     syscall( UI_CVAR_RESET, name ); 
00083 }

void trap_Cvar_Set const char *  var_name,
const char *  value
 

Definition at line 65 of file cg_syscalls.c.

00065                                                                  {
00066     syscall( CG_CVAR_SET, var_name, value );
00067 }

void trap_Cvar_SetValue const char *  var_name,
float  value
 

Definition at line 77 of file ui_syscalls.c.

00077                                                              {
00078     syscall( UI_CVAR_SETVALUE, var_name, PASSFLOAT( value ) );
00079 }

void trap_Cvar_Update vmCvar_t vmCvar  ) 
 

Definition at line 61 of file cg_syscalls.c.

00061                                              {
00062     syscall( CG_CVAR_UPDATE, vmCvar );
00063 }

void trap_Cvar_VariableStringBuffer const char *  var_name,
char *  buffer,
int  bufsize
 

Definition at line 69 of file cg_syscalls.c.

00069                                                                                        {
00070     syscall( CG_CVAR_VARIABLESTRINGBUFFER, var_name, buffer, bufsize );
00071 }

float trap_Cvar_VariableValue const char *  var_name  ) 
 

Definition at line 55 of file g_bot.c.

00055                                                       {
00056     char buf[128];
00057 
00058     trap_Cvar_VariableStringBuffer(var_name, buf, sizeof(buf));
00059     return atof(buf);
00060 }

void trap_Error const char *  string  ) 
 

Definition at line 49 of file cg_syscalls.c.

00049                                       {
00050     syscall( CG_ERROR, fmt );
00051 }

void trap_FS_FCloseFile fileHandle_t  f  ) 
 

Definition at line 97 of file cg_syscalls.c.

00097                                              {
00098     syscall( CG_FS_FCLOSEFILE, f );
00099 }

int trap_FS_FOpenFile const char *  qpath,
fileHandle_t f,
fsMode_t  mode
 

Definition at line 85 of file cg_syscalls.c.

00085                                                                                {
00086     return syscall( CG_FS_FOPENFILE, qpath, f, mode );
00087 }

int trap_FS_GetFileList const char *  path,
const char *  extension,
char *  listbuf,
int  bufsize
 

Definition at line 79 of file g_syscalls.c.

00079                                                                                                 {
00080     return syscall( G_FS_GETFILELIST, path, extension, listbuf, bufsize );
00081 }

void trap_FS_Read void *  buffer,
int  len,
fileHandle_t  f
 

Definition at line 89 of file cg_syscalls.c.

00089                                                               {
00090     syscall( CG_FS_READ, buffer, len, f );
00091 }

int trap_FS_Seek fileHandle_t  f,
long  offset,
int  origin
 

Definition at line 101 of file cg_syscalls.c.

00101                                                             {
00102     return syscall( CG_FS_SEEK, f, offset, origin );
00103 }

void trap_FS_Write const void *  buffer,
int  len,
fileHandle_t  f
 

Definition at line 93 of file cg_syscalls.c.

00093                                                                      {
00094     syscall( CG_FS_WRITE, buffer, len, f );
00095 }

void trap_GetCDKey char *  buf,
int  buflen
 

Definition at line 321 of file ui_syscalls.c.

00321                                             {
00322     syscall( UI_GET_CDKEY, buf, buflen );
00323 }

void trap_GetClientState uiClientState_t state  ) 
 

Definition at line 233 of file ui_syscalls.c.

00233                                                    {
00234     syscall( UI_GETCLIENTSTATE, state );
00235 }

void trap_GetClipboardData char *  buf,
int  bufsize
 

Definition at line 229 of file ui_syscalls.c.

00229                                                      {
00230     syscall( UI_GETCLIPBOARDDATA, buf, bufsize );
00231 }

int trap_GetConfigString int  index,
char *  buff,
int  buffsize
 

Definition at line 241 of file ui_syscalls.c.

00241                                                                 {
00242     return syscall( UI_GETCONFIGSTRING, index, buff, buffsize );
00243 }

void trap_GetGlconfig glconfig_t glconfig  ) 
 

Definition at line 304 of file cg_syscalls.c.

00304                                                      {
00305     syscall( CG_GETGLCONFIG, glconfig );
00306 }

void trap_Key_ClearStates void   ) 
 

Definition at line 217 of file ui_syscalls.c.

Referenced by _UI_KeyEvent(), _UI_SetActiveMenu(), UI_ForceMenuOff(), UI_Pause(), and UI_RunMenuScript().

00217                                   {
00218     syscall( UI_KEY_CLEARSTATES );
00219 }

void trap_Key_GetBindingBuf int  keynum,
char *  buf,
int  buflen
 

Definition at line 197 of file ui_syscalls.c.

00197                                                                  {
00198     syscall( UI_KEY_GETBINDINGBUF, keynum, buf, buflen );
00199 }

int trap_Key_GetCatcher void   ) 
 

Definition at line 352 of file cg_syscalls.c.

00352                                 {
00353     return syscall( CG_KEY_GETCATCHER );
00354 }

qboolean trap_Key_GetOverstrikeMode void   ) 
 

Definition at line 209 of file ui_syscalls.c.

Referenced by MField_CharEvent(), MField_Draw(), MField_KeyDownEvent(), PlayerSettings_DrawName(), Rankings_DrawText(), and UI_CDKeyMenu_DrawKey().

00209                                             {
00210     return syscall( UI_KEY_GETOVERSTRIKEMODE );
00211 }

qboolean trap_Key_IsDown int  keynum  ) 
 

Definition at line 348 of file cg_syscalls.c.

00348                                        {
00349     return syscall( CG_KEY_ISDOWN, keynum );
00350 }

void trap_Key_KeynumToStringBuf int  keynum,
char *  buf,
int  buflen
 

Definition at line 193 of file ui_syscalls.c.

00193                                                                      {
00194     syscall( UI_KEY_KEYNUMTOSTRINGBUF, keynum, buf, buflen );
00195 }

void trap_Key_SetBinding int  keynum,
const char *  binding
 

Definition at line 201 of file ui_syscalls.c.

00201                                                             {
00202     syscall( UI_KEY_SETBINDING, keynum, binding );
00203 }

void trap_Key_SetCatcher int  catcher  ) 
 

Definition at line 356 of file cg_syscalls.c.

00356                                         {
00357     syscall( CG_KEY_SETCATCHER, catcher );
00358 }

void trap_Key_SetOverstrikeMode qboolean  state  ) 
 

Definition at line 213 of file ui_syscalls.c.

00213                                                   {
00214     syscall( UI_KEY_SETOVERSTRIKEMODE, state );
00215 }

void trap_LAN_ClearPing int  n  ) 
 

Definition at line 281 of file ui_syscalls.c.

00281                                  {
00282     syscall( UI_LAN_CLEARPING, n );
00283 }

void trap_LAN_GetPing int  n,
char *  buf,
int  buflen,
int *  pingtime
 

Definition at line 285 of file ui_syscalls.c.

00285                                                                      {
00286     syscall( UI_LAN_GETPING, n, buf, buflen, pingtime );
00287 }

void trap_LAN_GetPingInfo int  n,
char *  buf,
int  buflen
 

Definition at line 289 of file ui_syscalls.c.

00289                                                           {
00290     syscall( UI_LAN_GETPINGINFO, n, buf, buflen );
00291 }

int trap_LAN_GetPingQueueCount void   ) 
 

Definition at line 261 of file ui_syscalls.c.

Referenced by ArenaServers_DoRefresh().

00261                                        {
00262     return syscall( UI_LAN_GETPINGQUEUECOUNT );
00263 }

void trap_LAN_GetServerAddressString int  source,
int  n,
char *  buf,
int  buflen
 

Definition at line 249 of file ui_syscalls.c.

00249                                                                                  {
00250     syscall( UI_LAN_GETSERVERADDRESSSTRING, source, n, buf, buflen );
00251 }

int trap_LAN_GetServerCount int  source  ) 
 

Definition at line 245 of file ui_syscalls.c.

00245                                           {
00246     return syscall( UI_LAN_GETSERVERCOUNT, source );
00247 }

void trap_LAN_GetServerInfo int  source,
int  n,
char *  buf,
int  buflen
 

Definition at line 253 of file ui_syscalls.c.

00253                                                                         {
00254     syscall( UI_LAN_GETSERVERINFO, source, n, buf, buflen );
00255 }

int trap_LAN_ServerStatus const char *  serverAddress,
char *  serverStatus,
int  maxLen
 

Definition at line 265 of file ui_syscalls.c.

00265                                                                                        {
00266     return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen );
00267 }

int trap_MemoryRemaining void   ) 
 

Definition at line 344 of file cg_syscalls.c.

00344                                  {
00345     return syscall( CG_MEMORY_REMAINING );
00346 }

int trap_Milliseconds void   ) 
 

Definition at line 53 of file cg_syscalls.c.

00053                                   {
00054     return syscall( CG_MILLISECONDS ); 
00055 }

void trap_Print const char *  string  ) 
 

Definition at line 45 of file cg_syscalls.c.

00045                                       {
00046     syscall( CG_PRINT, fmt );
00047 }

void trap_R_AddLightToScene const vec3_t  org,
float  intensity,
float  r,
float  g,
float  b
 

Definition at line 270 of file cg_syscalls.c.

00270                                                                                                {
00271     syscall( CG_R_ADDLIGHTTOSCENE, org, PASSFLOAT(intensity), PASSFLOAT(r), PASSFLOAT(g), PASSFLOAT(b) );
00272 }

void trap_R_AddPolyToScene qhandle_t  hShader,
int  numVerts,
const polyVert_t verts
 

Definition at line 258 of file cg_syscalls.c.

00258                                                                                            {
00259     syscall( CG_R_ADDPOLYTOSCENE, hShader, numVerts, verts );
00260 }

void trap_R_AddRefEntityToScene const refEntity_t re  ) 
 

Definition at line 254 of file cg_syscalls.c.

00254                                                             {
00255     syscall( CG_R_ADDREFENTITYTOSCENE, re );
00256 }

void trap_R_ClearScene void   ) 
 

Definition at line 250 of file cg_syscalls.c.

00250                                   {
00251     syscall( CG_R_CLEARSCENE );
00252 }

void trap_R_DrawStretchPic float  x,
float  y,
float  w,
float  h,
float  s1,
float  t1,
float  s2,
float  t2,
qhandle_t  hShader
 

Definition at line 286 of file cg_syscalls.c.

00287                                                                                            {
00288     syscall( CG_R_DRAWSTRETCHPIC, PASSFLOAT(x), PASSFLOAT(y), PASSFLOAT(w), PASSFLOAT(h), PASSFLOAT(s1), PASSFLOAT(t1), PASSFLOAT(s2), PASSFLOAT(t2), hShader );
00289 }

qhandle_t trap_R_RegisterModel const char *  name  ) 
 

Definition at line 230 of file cg_syscalls.c.

00230                                                    {
00231     return syscall( CG_R_REGISTERMODEL, name );
00232 }

qhandle_t trap_R_RegisterShaderNoMip const char *  name  ) 
 

Definition at line 242 of file cg_syscalls.c.

00242                                                          {
00243     return syscall( CG_R_REGISTERSHADERNOMIP, name );
00244 }

qhandle_t trap_R_RegisterSkin const char *  name  ) 
 

Definition at line 234 of file cg_syscalls.c.

00234                                                   {
00235     return syscall( CG_R_REGISTERSKIN, name );
00236 }

void trap_R_RenderScene const refdef_t fd  ) 
 

Definition at line 278 of file cg_syscalls.c.

00278                                                  {
00279     syscall( CG_R_RENDERSCENE, fd );
00280 }

void trap_R_SetColor const float *  rgba  ) 
 

Definition at line 282 of file cg_syscalls.c.

00282                                              {
00283     syscall( CG_R_SETCOLOR, rgba );
00284 }

sfxHandle_t trap_S_RegisterSound const char *  sample,
qboolean  compressed
 

Definition at line 218 of file cg_syscalls.c.

00218                                                                             {
00219     return syscall( CG_S_REGISTERSOUND, sample, compressed );
00220 }

void trap_S_StartLocalSound sfxHandle_t  sfx,
int  channelNum
 

Definition at line 190 of file cg_syscalls.c.

00190                                                                   {
00191     syscall( CG_S_STARTLOCALSOUND, sfx, channelNum );
00192 }

void trap_SetCDKey char *  buf  ) 
 

Definition at line 325 of file ui_syscalls.c.

00325                                 {
00326     syscall( UI_SET_CDKEY, buf );
00327 }

void trap_SetPbClStatus int  status  ) 
 

Definition at line 399 of file ui_syscalls.c.

00399                                       {
00400     syscall( UI_SET_PBCLSTATUS, status );
00401 }

void trap_UpdateScreen void   ) 
 

Definition at line 121 of file cg_syscalls.c.

00121                                   {
00122     syscall( CG_UPDATESCREEN );
00123 }

qboolean trap_VerifyCDKey const char *  key,
const char *  chksum
 

Definition at line 395 of file ui_syscalls.c.

00395                                                                 {
00396     return syscall( UI_VERIFY_CDKEY, key, chksum);
00397 }

void UI_AddBots_Cache void   ) 
 

Definition at line 392 of file ui_addbots.c.

00392                               {
00393     trap_R_RegisterShaderNoMip( ART_BACK0 );
00394     trap_R_RegisterShaderNoMip( ART_BACK1 );
00395     trap_R_RegisterShaderNoMip( ART_FIGHT0 );
00396     trap_R_RegisterShaderNoMip( ART_FIGHT1 );
00397     trap_R_RegisterShaderNoMip( ART_BACKGROUND );
00398     trap_R_RegisterShaderNoMip( ART_ARROWS );
00399     trap_R_RegisterShaderNoMip( ART_ARROWUP );
00400     trap_R_RegisterShaderNoMip( ART_ARROWDOWN );
00401 }

void UI_AddBotsMenu void   ) 
 

Definition at line 409 of file ui_addbots.c.

00409                             {
00410     UI_AddBotsMenu_Init();
00411     UI_PushMenu( &addBotsMenuInfo.menu );
00412 }

void UI_AdjustFrom640 float *  x,
float *  y,
float *  w,
float *  h
 

Definition at line 1100 of file ui_atoms.c.

01100                                                                 {
01101     // expect valid pointers
01102     *x = *x * uis.scale + uis.bias;
01103     *y *= uis.scale;
01104     *w *= uis.scale;
01105     *h *= uis.scale;
01106 }

void UI_ArenaServersMenu void   ) 
 

Definition at line 1637 of file ui_servers2.c.

Referenced by Main_MenuEvent().

01637                                  {
01638     ArenaServers_MenuInit();
01639     UI_PushMenu( &g_arenaservers.menu );
01640 }                         

char* UI_Argv int  arg  ) 
 

Definition at line 939 of file ui_atoms.c.

00939                          {
00940     static char buffer[MAX_STRING_CHARS];
00941 
00942     trap_Argv( arg, buffer, sizeof( buffer ) );
00943 
00944     return buffer;
00945 }

void UI_BotSelectMenu char *  bot  ) 
 

Definition at line 1965 of file ui_startserver.c.

01965                                    {
01966     UI_BotSelectMenu_Init( bot );
01967     UI_PushMenu( &botSelectInfo.menu );
01968 }

void UI_BotSelectMenu_Cache void   ) 
 

Definition at line 1823 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Init(), and UI_Cache_f().

01823                                     {
01824     trap_R_RegisterShaderNoMip( BOTSELECT_BACK0 );
01825     trap_R_RegisterShaderNoMip( BOTSELECT_BACK1 );
01826     trap_R_RegisterShaderNoMip( BOTSELECT_ACCEPT0 );
01827     trap_R_RegisterShaderNoMip( BOTSELECT_ACCEPT1 );
01828     trap_R_RegisterShaderNoMip( BOTSELECT_SELECT );
01829     trap_R_RegisterShaderNoMip( BOTSELECT_SELECTED );
01830     trap_R_RegisterShaderNoMip( BOTSELECT_ARROWS );
01831     trap_R_RegisterShaderNoMip( BOTSELECT_ARROWSL );
01832     trap_R_RegisterShaderNoMip( BOTSELECT_ARROWSR );
01833 }

qboolean UI_CanShowTierVideo int  tier  ) 
 

Definition at line 630 of file ui_gameinfo.c.

00630                                          {
00631     char    key[16];
00632     char    videos[MAX_INFO_VALUE];
00633 
00634     if( !tier ) {
00635         return qfalse;
00636     }
00637 
00638     if( uis.demoversion && tier != 8 ) {
00639         return qfalse;
00640     }
00641 
00642     trap_Cvar_VariableStringBuffer( "g_spVideos", videos, sizeof(videos) );
00643 
00644     Com_sprintf( key, sizeof(key), "tier%i", tier );
00645     if( atoi( Info_ValueForKey( videos, key ) ) ) {
00646         return qtrue;
00647     }
00648 
00649     return qfalse;
00650 }

void UI_CDKeyMenu void   ) 
 

Definition at line 278 of file ui_cdkey.c.

00278                           {
00279     UI_CDKeyMenu_Init();
00280     UI_PushMenu( &cdkeyMenuInfo.menu );
00281 }

void UI_CDKeyMenu_Cache void   ) 
 

Definition at line 264 of file ui_cdkey.c.

00264                                 {
00265     trap_R_RegisterShaderNoMip( ART_ACCEPT0 );
00266     trap_R_RegisterShaderNoMip( ART_ACCEPT1 );
00267     trap_R_RegisterShaderNoMip( ART_BACK0 );
00268     trap_R_RegisterShaderNoMip( ART_BACK1 );
00269     trap_R_RegisterShaderNoMip( ART_FRAME );
00270 }

void UI_CDKeyMenu_f void   ) 
 

Definition at line 289 of file ui_cdkey.c.

00289                             {
00290     UI_CDKeyMenu();
00291 }

void UI_CinematicsMenu void   ) 
 

Definition at line 333 of file ui_cinematics.c.

00333                                {
00334     UI_CinematicsMenu_Init();
00335     UI_PushMenu( &cinematicsMenuInfo.menu );
00336 }

void UI_CinematicsMenu_Cache void   ) 
 

Definition at line 320 of file ui_cinematics.c.

00320                                      {
00321     trap_R_RegisterShaderNoMip( ART_BACK0 );
00322     trap_R_RegisterShaderNoMip( ART_BACK1 );
00323     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00324     trap_R_RegisterShaderNoMip( ART_FRAMER );
00325 }

void UI_CinematicsMenu_f void   ) 
 

Definition at line 344 of file ui_cinematics.c.

00344                                  {
00345     int     n;
00346 
00347     n = atoi( UI_Argv( 1 ) );
00348     UI_CinematicsMenu();
00349     Menu_SetCursorToItem( &cinematicsMenuInfo.menu, cinematicsMenuInfo.menu.items[n + 3] );
00350 }

float UI_ClampCvar float  min,
float  max,
float  value
 

Definition at line 65 of file ui_atoms.c.

00066 {
00067     if ( value < min ) return min;
00068     if ( value > max ) return max;
00069     return value;
00070 }

void UI_ConfirmMenu const char *  question,
void(*)(void)  draw,
void(*)(qboolean result)  action
 

Definition at line 241 of file ui_confirm.c.

00241                                                                                                      {
00242     UI_ConfirmMenu_Style(question, UI_CENTER|UI_INVERSE, draw, action);
00243 }

void UI_ConfirmMenu_Style const char *  question,
int  style,
void(*)(void)  draw,
void(*)(qboolean result)  action
 

Definition at line 173 of file ui_confirm.c.

References confirmMenu_t::action, menucommon_s::callback, menutext_s::color, ConfirmMenu_Cache(), uiClientState_t::connState, _tag_menuframework::draw, confirmMenu_t::draw, menucommon_s::flags, _tag_menuframework::fullscreen, menutext_s::generic, menucommon_s::id, _tag_menuframework::key, memset(), confirmMenu_t::menu, Menu_AddItem(), Menu_SetCursorToItem(), confirmMenu_t::no, QMF_LEFT_JUSTIFY, confirmMenu_t::question, s_confirm, confirmMenu_t::slashX, menutext_s::string, menutext_s::style, confirmMenu_t::style, trap_GetClientState(), menucommon_s::type, UI_ProportionalStringWidth(), UI_PushMenu(), _tag_menuframework::wrapAround, menucommon_s::x, menucommon_s::y, and confirmMenu_t::yes.

Referenced by ArenaServers_Event(), and UI_ConfirmMenu().

00173                                                                                                                       {
00174     uiClientState_t cstate;
00175     int n1, n2, n3;
00176     int l1, l2, l3;
00177 
00178     // zero set all our globals
00179     memset( &s_confirm, 0, sizeof(s_confirm) );
00180 
00181     ConfirmMenu_Cache();
00182 
00183     n1 = UI_ProportionalStringWidth( "YES/NO" );
00184     n2 = UI_ProportionalStringWidth( "YES" ) + PROP_GAP_WIDTH;
00185     n3 = UI_ProportionalStringWidth( "/" )  + PROP_GAP_WIDTH;
00186     l1 = 320 - ( n1 / 2 );
00187     l2 = l1 + n2;
00188     l3 = l2 + n3;
00189     s_confirm.slashX = l2;
00190 
00191     s_confirm.question = question;
00192     s_confirm.draw = draw;
00193     s_confirm.action = action;
00194     s_confirm.style = style;
00195 
00196     s_confirm.menu.draw       = ConfirmMenu_Draw;
00197     s_confirm.menu.key        = ConfirmMenu_Key;
00198     s_confirm.menu.wrapAround = qtrue;
00199 
00200     trap_GetClientState( &cstate );
00201     if ( cstate.connState >= CA_CONNECTED ) {
00202         s_confirm.menu.fullscreen = qfalse;
00203     }
00204     else {
00205         s_confirm.menu.fullscreen = qtrue;
00206     }
00207 
00208     s_confirm.yes.generic.type      = MTYPE_PTEXT;      
00209     s_confirm.yes.generic.flags     = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
00210     s_confirm.yes.generic.callback  = ConfirmMenu_Event;
00211     s_confirm.yes.generic.id        = ID_CONFIRM_YES;
00212     s_confirm.yes.generic.x         = l1;
00213     s_confirm.yes.generic.y         = 264;
00214     s_confirm.yes.string            = "YES";
00215     s_confirm.yes.color             = color_red;
00216     s_confirm.yes.style             = UI_LEFT;
00217 
00218     s_confirm.no.generic.type       = MTYPE_PTEXT;      
00219     s_confirm.no.generic.flags      = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
00220     s_confirm.no.generic.callback   = ConfirmMenu_Event;
00221     s_confirm.no.generic.id         = ID_CONFIRM_NO;
00222     s_confirm.no.generic.x          = l3;
00223     s_confirm.no.generic.y          = 264;
00224     s_confirm.no.string             = "NO";
00225     s_confirm.no.color              = color_red;
00226     s_confirm.no.style              = UI_LEFT;
00227 
00228     Menu_AddItem( &s_confirm.menu,  &s_confirm.yes );             
00229     Menu_AddItem( &s_confirm.menu,  &s_confirm.no );
00230 
00231     UI_PushMenu( &s_confirm.menu );
00232 
00233     Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.no );
00234 }

Here is the call graph for this function:

qboolean UI_ConsoleCommand int  realTime  ) 
 

Definition at line 1003 of file ui_atoms.c.

01003                                            {
01004     char    *cmd;
01005 
01006     cmd = UI_Argv( 0 );
01007 
01008     // ensure minimum menu data is available
01009     Menu_Cache();
01010 
01011     if ( Q_stricmp (cmd, "levelselect") == 0 ) {
01012         UI_SPLevelMenu_f();
01013         return qtrue;
01014     }
01015 
01016     if ( Q_stricmp (cmd, "postgame") == 0 ) {
01017         UI_SPPostgameMenu_f();
01018         return qtrue;
01019     }
01020 
01021     if ( Q_stricmp (cmd, "ui_cache") == 0 ) {
01022         UI_Cache_f();
01023         return qtrue;
01024     }
01025 
01026     if ( Q_stricmp (cmd, "ui_cinematics") == 0 ) {
01027         UI_CinematicsMenu_f();
01028         return qtrue;
01029     }
01030 
01031     if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) {
01032         UI_TeamOrdersMenu_f();
01033         return qtrue;
01034     }
01035 
01036     if ( Q_stricmp (cmd, "iamacheater") == 0 ) {
01037         UI_SPUnlock_f();
01038         return qtrue;
01039     }
01040 
01041     if ( Q_stricmp (cmd, "iamamonkey") == 0 ) {
01042         UI_SPUnlockMedals_f();
01043         return qtrue;
01044     }
01045 
01046     if ( Q_stricmp (cmd, "ui_cdkey") == 0 ) {
01047         UI_CDKeyMenu_f();
01048         return qtrue;
01049     }
01050 
01051     return qfalse;
01052 }

void UI_ControlsMenu void   ) 
 

Definition at line 1664 of file ui_controls2.c.

01664                              {
01665     Controls_MenuInit();
01666     UI_PushMenu( &s_controls.menu );
01667 }

void UI_CreditMenu void   ) 
 

Definition at line 122 of file ui_credits.c.

00122                            {
00123     memset( &s_credits, 0 ,sizeof(s_credits) );
00124 
00125     s_credits.menu.draw = UI_CreditMenu_Draw;
00126     s_credits.menu.key = UI_CreditMenu_Key;
00127     s_credits.menu.fullscreen = qtrue;
00128     UI_PushMenu ( &s_credits.menu );
00129 }

qboolean UI_CursorInRect int  x,
int  y,
int  width,
int  height
 

Definition at line 1258 of file ui_atoms.c.

01259 {
01260     if (uis.cursorx < x ||
01261         uis.cursory < y ||
01262         uis.cursorx > x+width ||
01263         uis.cursory > y+height)
01264         return qfalse;
01265 
01266     return qtrue;
01267 }

char* UI_Cvar_VariableString const char *  var_name  ) 
 

Definition at line 948 of file ui_atoms.c.

00948                                                      {
00949     static char buffer[MAX_STRING_CHARS];
00950 
00951     trap_Cvar_VariableStringBuffer( var_name, buffer, sizeof( buffer ) );
00952 
00953     return buffer;
00954 }

void UI_DemosMenu void   ) 
 

Definition at line 288 of file ui_demo2.c.

00288                           {
00289     Demos_MenuInit();
00290     UI_PushMenu( &s_demos.menu );
00291 }

void UI_DisplayOptionsMenu void   ) 
 

Definition at line 261 of file ui_display.c.

void UI_DisplayOptionsMenu_Cache void   ) 
 

Definition at line 248 of file ui_display.c.

00248                                          {
00249     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00250     trap_R_RegisterShaderNoMip( ART_FRAMER );
00251     trap_R_RegisterShaderNoMip( ART_BACK0 );
00252     trap_R_RegisterShaderNoMip( ART_BACK1 );
00253 }

void UI_DrawBannerString int  x,
int  y,
const char *  str,
int  style,
vec4_t  color
 

Definition at line 639 of file cg_drawtools.c.

00639                                                                                    {
00640     const char *    s;
00641     int             ch;
00642     int             width;
00643     vec4_t          drawcolor;
00644 
00645     // find the width of the drawn text
00646     s = str;
00647     width = 0;
00648     while ( *s ) {
00649         ch = *s;
00650         if ( ch == ' ' ) {
00651             width += PROPB_SPACE_WIDTH;
00652         }
00653         else if ( ch >= 'A' && ch <= 'Z' ) {
00654             width += propMapB[ch - 'A'][2] + PROPB_GAP_WIDTH;
00655         }
00656         s++;
00657     }
00658     width -= PROPB_GAP_WIDTH;
00659 
00660     switch( style & UI_FORMATMASK ) {
00661         case UI_CENTER:
00662             x -= width / 2;
00663             break;
00664 
00665         case UI_RIGHT:
00666             x -= width;
00667             break;
00668 
00669         case UI_LEFT:
00670         default:
00671             break;
00672     }
00673 
00674     if ( style & UI_DROPSHADOW ) {
00675         drawcolor[0] = drawcolor[1] = drawcolor[2] = 0;
00676         drawcolor[3] = color[3];
00677         UI_DrawBannerString2( x+2, y+2, str, drawcolor );
00678     }
00679 
00680     UI_DrawBannerString2( x, y, str, color );
00681 }

void UI_DrawChar int  x,
int  y,
int  ch,
int  style,
vec4_t  color
 

Definition at line 781 of file ui_atoms.c.

00782 {
00783     char    buff[2];
00784 
00785     buff[0] = ch;
00786     buff[1] = '\0';
00787 
00788     UI_DrawString( x, y, buff, style, color );
00789 }

void UI_DrawConnectScreen qboolean  overlay  ) 
 

Definition at line 178 of file ui_connect.c.

00178                                               {
00179     char            *s;
00180     uiClientState_t cstate;
00181     char            info[MAX_INFO_VALUE];
00182 
00183     Menu_Cache();
00184 
00185     if ( !overlay ) {
00186         // draw the dialog background
00187         UI_SetColor( color_white );
00188         UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackShader );
00189     }
00190 
00191     // see what information we should display
00192     trap_GetClientState( &cstate );
00193 
00194     info[0] = '\0';
00195     if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) {
00196         UI_DrawProportionalString( 320, 16, va( "Loading %s", Info_ValueForKey( info, "mapname" ) ), UI_BIGFONT|UI_CENTER|UI_DROPSHADOW, color_white );
00197     }
00198 
00199     UI_DrawProportionalString( 320, 64, va("Connecting to %s", cstate.servername), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
00200     //UI_DrawProportionalString( 320, 96, "Press Esc to abort", UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
00201 
00202     // display global MOTD at bottom
00203     UI_DrawProportionalString( SCREEN_WIDTH/2, SCREEN_HEIGHT-32, 
00204         Info_ValueForKey( cstate.updateInfoString, "motd" ), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
00205     
00206     // print any server info (server full, bad version, etc)
00207     if ( cstate.connState < CA_CONNECTED ) {
00208         UI_DrawProportionalString_AutoWrapped( 320, 192, 630, 20, cstate.messageString, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
00209     }
00210 
00211 #if 0
00212     // display password field
00213     if ( passwordNeeded ) {
00214         s_ingame_menu.x = SCREEN_WIDTH * 0.50 - 128;
00215         s_ingame_menu.nitems = 0;
00216         s_ingame_menu.wrapAround = qtrue;
00217 
00218         passwordField.generic.type = MTYPE_FIELD;
00219         passwordField.generic.name = "Password:";
00220         passwordField.generic.callback = 0;
00221         passwordField.generic.x     = 10;
00222         passwordField.generic.y     = 180;
00223         Field_Clear( &passwordField.field );
00224         passwordField.width = 256;
00225         passwordField.field.widthInChars = 16;
00226         Q_strncpyz( passwordField.field.buffer, Cvar_VariableString("password"), 
00227             sizeof(passwordField.field.buffer) );
00228 
00229         Menu_AddItem( &s_ingame_menu, ( void * ) &s_customize_player_action );
00230 
00231         MField_Draw( &passwordField );
00232     }
00233 #endif
00234 
00235     if ( lastConnState > cstate.connState ) {
00236         lastLoadingText[0] = '\0';
00237     }
00238     lastConnState = cstate.connState;
00239 
00240     switch ( cstate.connState ) {
00241     case CA_CONNECTING:
00242         s = va("Awaiting challenge...%i", cstate.connectPacketCount);
00243         break;
00244     case CA_CHALLENGING:
00245         s = va("Awaiting connection...%i", cstate.connectPacketCount);
00246         break;
00247     case CA_CONNECTED: {
00248         char downloadName[MAX_INFO_VALUE];
00249 
00250             trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) );
00251             if (*downloadName) {
00252                 UI_DisplayDownloadInfo( downloadName );
00253                 return;
00254             }
00255         }
00256         s = "Awaiting gamestate...";
00257         break;
00258     case CA_LOADING:
00259         return;
00260     case CA_PRIMED:
00261         return;
00262     default:
00263         return;
00264     }
00265 
00266     UI_DrawProportionalString( 320, 128, s, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, color_white );
00267 
00268     // password required / connection rejected information goes here
00269 }

void UI_DrawHandlePic float  x,
float  y,
float  w,
float  h,
qhandle_t  hShader
 

Definition at line 1116 of file ui_atoms.c.

01116                                                                                {
01117     float   s0;
01118     float   s1;
01119     float   t0;
01120     float   t1;
01121 
01122     if( w < 0 ) {   // flip about vertical
01123         w  = -w;
01124         s0 = 1;
01125         s1 = 0;
01126     }
01127     else {
01128         s0 = 0;
01129         s1 = 1;
01130     }
01131 
01132     if( h < 0 ) {   // flip about horizontal
01133         h  = -h;
01134         t0 = 1;
01135         t1 = 0;
01136     }
01137     else {
01138         t0 = 0;
01139         t1 = 1;
01140     }
01141     
01142     UI_AdjustFrom640( &x, &y, &w, &h );
01143     trap_R_DrawStretchPic( x, y, w, h, s0, t0, s1, t1, hShader );
01144 }

void UI_DrawNamedPic float  x,
float  y,
float  width,
float  height,
const char *  picname
 

Definition at line 1108 of file ui_atoms.c.

01108                                                                                          {
01109     qhandle_t   hShader;
01110 
01111     hShader = trap_R_RegisterShaderNoMip( picname );
01112     UI_AdjustFrom640( &x, &y, &width, &height );
01113     trap_R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, hShader );
01114 }

void UI_DrawPlayer float  x,
float  y,
float  w,
float  h,
playerInfo_t pi,
int  time
 

Definition at line 690 of file ui_players.c.

00690                                                                                      {
00691     refdef_t        refdef;
00692     refEntity_t     legs;
00693     refEntity_t     torso;
00694     refEntity_t     head;
00695     refEntity_t     gun;
00696     refEntity_t     barrel;
00697     refEntity_t     flash;
00698     vec3_t          origin;
00699     int             renderfx;
00700     vec3_t          mins = {-16, -16, -24};
00701     vec3_t          maxs = {16, 16, 32};
00702     float           len;
00703     float           xx;
00704 
00705     if ( !pi->legsModel || !pi->torsoModel || !pi->headModel || !pi->animations[0].numFrames ) {
00706         return;
00707     }
00708 
00709     dp_realtime = time;
00710 
00711     if ( pi->pendingWeapon != -1 && dp_realtime > pi->weaponTimer ) {
00712         pi->weapon = pi->pendingWeapon;
00713         pi->lastWeapon = pi->pendingWeapon;
00714         pi->pendingWeapon = -1;
00715         pi->weaponTimer = 0;
00716         if( pi->currentWeapon != pi->weapon ) {
00717             trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL );
00718         }
00719     }
00720 
00721     UI_AdjustFrom640( &x, &y, &w, &h );
00722 
00723     y -= jumpHeight;
00724 
00725     memset( &refdef, 0, sizeof( refdef ) );
00726     memset( &legs, 0, sizeof(legs) );
00727     memset( &torso, 0, sizeof(torso) );
00728     memset( &head, 0, sizeof(head) );
00729 
00730     refdef.rdflags = RDF_NOWORLDMODEL;
00731 
00732     AxisClear( refdef.viewaxis );
00733 
00734     refdef.x = x;
00735     refdef.y = y;
00736     refdef.width = w;
00737     refdef.height = h;
00738 
00739     refdef.fov_x = (int)((float)refdef.width / 640.0f * 90.0f);
00740     xx = refdef.width / tan( refdef.fov_x / 360 * M_PI );
00741     refdef.fov_y = atan2( refdef.height, xx );
00742     refdef.fov_y *= ( 360 / M_PI );
00743 
00744     // calculate distance so the player nearly fills the box
00745     len = 0.7 * ( maxs[2] - mins[2] );      
00746     origin[0] = len / tan( DEG2RAD(refdef.fov_x) * 0.5 );
00747     origin[1] = 0.5 * ( mins[1] + maxs[1] );
00748     origin[2] = -0.5 * ( mins[2] + maxs[2] );
00749 
00750     refdef.time = dp_realtime;
00751 
00752     trap_R_ClearScene();
00753 
00754     // get the rotation information
00755     UI_PlayerAngles( pi, legs.axis, torso.axis, head.axis );
00756     
00757     // get the animation state (after rotation, to allow feet shuffle)
00758     UI_PlayerAnimation( pi, &legs.oldframe, &legs.frame, &legs.backlerp,
00759          &torso.oldframe, &torso.frame, &torso.backlerp );
00760 
00761     renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
00762 
00763     //
00764     // add the legs
00765     //
00766     legs.hModel = pi->legsModel;
00767     legs.customSkin = pi->legsSkin;
00768 
00769     VectorCopy( origin, legs.origin );
00770 
00771     VectorCopy( origin, legs.lightingOrigin );
00772     legs.renderfx = renderfx;
00773     VectorCopy (legs.origin, legs.oldorigin);
00774 
00775     trap_R_AddRefEntityToScene( &legs );
00776 
00777     if (!legs.hModel) {
00778         return;
00779     }
00780 
00781     //
00782     // add the torso
00783     //
00784     torso.hModel = pi->torsoModel;
00785     if (!torso.hModel) {
00786         return;
00787     }
00788 
00789     torso.customSkin = pi->torsoSkin;
00790 
00791     VectorCopy( origin, torso.lightingOrigin );
00792 
00793     UI_PositionRotatedEntityOnTag( &torso, &legs, pi->legsModel, "tag_torso");
00794 
00795     torso.renderfx = renderfx;
00796 
00797     trap_R_AddRefEntityToScene( &torso );
00798 
00799     //
00800     // add the head
00801     //
00802     head.hModel = pi->headModel;
00803     if (!head.hModel) {
00804         return;
00805     }
00806     head.customSkin = pi->headSkin;
00807 
00808     VectorCopy( origin, head.lightingOrigin );
00809 
00810     UI_PositionRotatedEntityOnTag( &head, &torso, pi->torsoModel, "tag_head");
00811 
00812     head.renderfx = renderfx;
00813 
00814     trap_R_AddRefEntityToScene( &head );
00815 
00816     //
00817     // add the gun
00818     //
00819     if ( pi->currentWeapon != WP_NONE ) {
00820         memset( &gun, 0, sizeof(gun) );
00821         gun.hModel = pi->weaponModel;
00822         VectorCopy( origin, gun.lightingOrigin );
00823         UI_PositionEntityOnTag( &gun, &torso, pi->torsoModel, "tag_weapon");
00824         gun.renderfx = renderfx;
00825         trap_R_AddRefEntityToScene( &gun );
00826     }
00827 
00828     //
00829     // add the spinning barrel
00830     //
00831     if ( pi->realWeapon == WP_MACHINEGUN || pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) {
00832         vec3_t  angles;
00833 
00834         memset( &barrel, 0, sizeof(barrel) );
00835         VectorCopy( origin, barrel.lightingOrigin );
00836         barrel.renderfx = renderfx;
00837 
00838         barrel.hModel = pi->barrelModel;
00839         angles[YAW] = 0;
00840         angles[PITCH] = 0;
00841         angles[ROLL] = UI_MachinegunSpinAngle( pi );
00842         if( pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) {
00843             angles[PITCH] = angles[ROLL];
00844             angles[ROLL] = 0;
00845         }
00846         AnglesToAxis( angles, barrel.axis );
00847 
00848         UI_PositionRotatedEntityOnTag( &barrel, &gun, pi->weaponModel, "tag_barrel");
00849 
00850         trap_R_AddRefEntityToScene( &barrel );
00851     }
00852 
00853     //
00854     // add muzzle flash
00855     //
00856     if ( dp_realtime <= pi->muzzleFlashTime ) {
00857         if ( pi->flashModel ) {
00858             memset( &flash, 0, sizeof(flash) );
00859             flash.hModel = pi->flashModel;
00860             VectorCopy( origin, flash.lightingOrigin );
00861             UI_PositionEntityOnTag( &flash, &gun, pi->weaponModel, "tag_flash");
00862             flash.renderfx = renderfx;
00863             trap_R_AddRefEntityToScene( &flash );
00864         }
00865 
00866         // make a dlight for the flash
00867         if ( pi->flashDlightColor[0] || pi->flashDlightColor[1] || pi->flashDlightColor[2] ) {
00868             trap_R_AddLightToScene( flash.origin, 200 + (rand()&31), pi->flashDlightColor[0],
00869                 pi->flashDlightColor[1], pi->flashDlightColor[2] );
00870         }
00871     }
00872 
00873     //
00874     // add the chat icon
00875     //
00876     if ( pi->chat ) {
00877         UI_PlayerFloatSprite( pi, origin, trap_R_RegisterShaderNoMip( "sprites/balloon3" ) );
00878     }
00879 
00880     //
00881     // add an accent light
00882     //
00883     origin[0] -= 100;   // + = behind, - = in front
00884     origin[1] += 100;   // + = left, - = right
00885     origin[2] += 100;   // + = above, - = below
00886     trap_R_AddLightToScene( origin, 500, 1.0, 1.0, 1.0 );
00887 
00888     origin[0] -= 100;
00889     origin[1] -= 100;
00890     origin[2] -= 100;
00891     trap_R_AddLightToScene( origin, 500, 1.0, 0.0, 0.0 );
00892 
00893     trap_R_RenderScene( &refdef );
00894 }

void UI_DrawProportionalString int  x,
int  y,
const char *  str,
int  style,
vec4_t  color
 

Definition at line 769 of file cg_drawtools.c.

00769                                                                                          {
00770     vec4_t  drawcolor;
00771     int     width;
00772     float   sizeScale;
00773 
00774     sizeScale = UI_ProportionalSizeScale( style );
00775 
00776     switch( style & UI_FORMATMASK ) {
00777         case UI_CENTER:
00778             width = UI_ProportionalStringWidth( str ) * sizeScale;
00779             x -= width / 2;
00780             break;
00781 
00782         case UI_RIGHT:
00783             width = UI_ProportionalStringWidth( str ) * sizeScale;
00784             x -= width;
00785             break;
00786 
00787         case UI_LEFT:
00788         default:
00789             break;
00790     }
00791 
00792     if ( style & UI_DROPSHADOW ) {
00793         drawcolor[0] = drawcolor[1] = drawcolor[2] = 0;
00794         drawcolor[3] = color[3];
00795         UI_DrawProportionalString2( x+2, y+2, str, drawcolor, sizeScale, cgs.media.charsetProp );
00796     }
00797 
00798     if ( style & UI_INVERSE ) {
00799         drawcolor[0] = color[0] * 0.8;
00800         drawcolor[1] = color[1] * 0.8;
00801         drawcolor[2] = color[2] * 0.8;
00802         drawcolor[3] = color[3];
00803         UI_DrawProportionalString2( x, y, str, drawcolor, sizeScale, cgs.media.charsetProp );
00804         return;
00805     }
00806 
00807     if ( style & UI_PULSE ) {
00808         drawcolor[0] = color[0] * 0.8;
00809         drawcolor[1] = color[1] * 0.8;
00810         drawcolor[2] = color[2] * 0.8;
00811         drawcolor[3] = color[3];
00812         UI_DrawProportionalString2( x, y, str, color, sizeScale, cgs.media.charsetProp );
00813 
00814         drawcolor[0] = color[0];
00815         drawcolor[1] = color[1];
00816         drawcolor[2] = color[2];
00817         drawcolor[3] = 0.5 + 0.5 * sin( cg.time / PULSE_DIVISOR );
00818         UI_DrawProportionalString2( x, y, str, drawcolor, sizeScale, cgs.media.charsetPropGlow );
00819         return;
00820     }
00821 
00822     UI_DrawProportionalString2( x, y, str, color, sizeScale, cgs.media.charsetProp );
00823 }

void UI_DrawProportionalString_AutoWrapped int  x,
int  ystart,
int  xmax,
int  ystep,
const char *  str,
int  style,
vec4_t  color
 

Definition at line 578 of file ui_atoms.c.

References Q_strncpyz(), UI_DrawProportionalString(), UI_ProportionalSizeScale(), UI_ProportionalStringWidth(), width, x, and y.

Referenced by Main_MenuDraw(), and UI_DrawConnectScreen().

00578                                                                                                                           {
00579     int width;
00580     char *s1,*s2,*s3;
00581     char c_bcp;
00582     char buf[1024];
00583     float   sizeScale;
00584 
00585     if (!str || str[0]=='\0')
00586         return;
00587     
00588     sizeScale = UI_ProportionalSizeScale( style );
00589     
00590     Q_strncpyz(buf, str, sizeof(buf));
00591     s1 = s2 = s3 = buf;
00592 
00593     while (1) {
00594         do {
00595             s3++;
00596         } while (*s3!=' ' && *s3!='\0');
00597         c_bcp = *s3;
00598         *s3 = '\0';
00599         width = UI_ProportionalStringWidth(s1) * sizeScale;
00600         *s3 = c_bcp;
00601         if (width > xmax) {
00602             if (s1==s2)
00603             {
00604                 // fuck, don't have a clean cut, we'll overflow
00605                 s2 = s3;
00606             }
00607             *s2 = '\0';
00608             UI_DrawProportionalString(x, y, s1, style, color);
00609             y += ystep;
00610             if (c_bcp == '\0')
00611       {
00612         // that was the last word
00613         // we could start a new loop, but that wouldn't be much use
00614         // even if the word is too long, we would overflow it (see above)
00615         // so just print it now if needed
00616         s2++;
00617         if (*s2 != '\0') // if we are printing an overflowing line we have s2 == s3
00618           UI_DrawProportionalString(x, y, s2, style, color);
00619                 break; 
00620       }
00621             s2++;
00622             s1 = s2;
00623             s3 = s2;
00624         }
00625         else
00626         {
00627             s2 = s3;
00628             if (c_bcp == '\0') // we reached the end
00629             {
00630                 UI_DrawProportionalString(x, y, s1, style, color);
00631                 break;
00632             }
00633         }
00634     }
00635 }

Here is the call graph for this function:

void UI_DrawRect float  x,
float  y,
float  width,
float  height,
const float *  color
 

Definition at line 1169 of file ui_atoms.c.

01169                                                                                     {
01170     trap_R_SetColor( color );
01171 
01172     UI_AdjustFrom640( &x, &y, &width, &height );
01173 
01174     trap_R_DrawStretchPic( x, y, width, 1, 0, 0, 0, 0, uis.whiteShader );
01175     trap_R_DrawStretchPic( x, y, 1, height, 0, 0, 0, 0, uis.whiteShader );
01176     trap_R_DrawStretchPic( x, y + height - 1, width, 1, 0, 0, 0, 0, uis.whiteShader );
01177     trap_R_DrawStretchPic( x + width - 1, y, 1, height, 0, 0, 0, 0, uis.whiteShader );
01178 
01179     trap_R_SetColor( NULL );
01180 }

void UI_DrawString int  x,
int  y,
const char *  str,
int  style,
vec4_t  color
 

Definition at line 702 of file ui_atoms.c.

00703 {
00704     int     len;
00705     int     charw;
00706     int     charh;
00707     vec4_t  newcolor;
00708     vec4_t  lowlight;
00709     float   *drawcolor;
00710     vec4_t  dropcolor;
00711 
00712     if( !str ) {
00713         return;
00714     }
00715 
00716     if ((style & UI_BLINK) && ((uis.realtime/BLINK_DIVISOR) & 1))
00717         return;
00718 
00719     if (style & UI_SMALLFONT)
00720     {
00721         charw = SMALLCHAR_WIDTH;
00722         charh = SMALLCHAR_HEIGHT;
00723     }
00724     else if (style & UI_GIANTFONT)
00725     {
00726         charw = GIANTCHAR_WIDTH;
00727         charh = GIANTCHAR_HEIGHT;
00728     }
00729     else
00730     {
00731         charw = BIGCHAR_WIDTH;
00732         charh = BIGCHAR_HEIGHT;
00733     }
00734 
00735     if (style & UI_PULSE)
00736     {
00737         lowlight[0] = 0.8*color[0]; 
00738         lowlight[1] = 0.8*color[1];
00739         lowlight[2] = 0.8*color[2];
00740         lowlight[3] = 0.8*color[3];
00741         UI_LerpColor(color,lowlight,newcolor,0.5+0.5*sin(uis.realtime/PULSE_DIVISOR));
00742         drawcolor = newcolor;
00743     }   
00744     else
00745         drawcolor = color;
00746 
00747     switch (style & UI_FORMATMASK)
00748     {
00749         case UI_CENTER:
00750             // center justify at x
00751             len = strlen(str);
00752             x   = x - len*charw/2;
00753             break;
00754 
00755         case UI_RIGHT:
00756             // right justify at x
00757             len = strlen(str);
00758             x   = x - len*charw;
00759             break;
00760 
00761         default:
00762             // left justify at x
00763             break;
00764     }
00765 
00766     if ( style & UI_DROPSHADOW )
00767     {
00768         dropcolor[0] = dropcolor[1] = dropcolor[2] = 0;
00769         dropcolor[3] = drawcolor[3];
00770         UI_DrawString2(x+2,y+2,str,dropcolor,charw,charh);
00771     }
00772 
00773     UI_DrawString2(x,y,str,drawcolor,charw,charh);
00774 }

void UI_DrawTextBox int  x,
int  y,
int  width,
int  lines
 

Definition at line 1252 of file ui_atoms.c.

01253 {
01254     UI_FillRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorBlack );
01255     UI_DrawRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorWhite );
01256 }

void UI_FillRect float  x,
float  y,
float  width,
float  height,
const float *  color
 

Definition at line 1153 of file ui_atoms.c.

01153                                                                                     {
01154     trap_R_SetColor( color );
01155 
01156     UI_AdjustFrom640( &x, &y, &width, &height );
01157     trap_R_DrawStretchPic( x, y, width, height, 0, 0, 0, 0, uis.whiteShader );
01158 
01159     trap_R_SetColor( NULL );
01160 }

void UI_ForceMenuOff void   ) 
 

Definition at line 157 of file ui_atoms.c.

00158 {
00159     uis.menusp     = 0;
00160     uis.activemenu = NULL;
00161 
00162     trap_Key_SetCatcher( trap_Key_GetCatcher() & ~KEYCATCH_UI );
00163     trap_Key_ClearStates();
00164     trap_Cvar_Set( "cl_paused", "0" );
00165 }

const char* UI_GetArenaInfoByMap const char *  map  ) 
 

Definition at line 294 of file ui_gameinfo.c.

00294                                                     {
00295     int         n;
00296 
00297     for( n = 0; n < ui_numArenas; n++ ) {
00298         if( Q_stricmp( Info_ValueForKey( ui_arenaInfos[n], "map" ), map ) == 0 ) {
00299             return ui_arenaInfos[n];
00300         }
00301     }
00302 
00303     return NULL;
00304 }

const char* UI_GetArenaInfoByNumber int  num  ) 
 

Definition at line 269 of file ui_gameinfo.c.

00269                                                {
00270     int     n;
00271     char    *value;
00272 
00273     if( num < 0 || num >= ui_numArenas ) {
00274         trap_Print( va( S_COLOR_RED "Invalid arena number: %i\n", num ) );
00275         return NULL;
00276     }
00277 
00278     for( n = 0; n < ui_numArenas; n++ ) {
00279         value = Info_ValueForKey( ui_arenaInfos[n], "num" );
00280         if( *value && atoi(value) == num ) {
00281             return ui_arenaInfos[n];
00282         }
00283     }
00284 
00285     return NULL;
00286 }

int UI_GetAwardLevel int  award  ) 
 

Definition at line 549 of file ui_gameinfo.c.

00549                                   {
00550     char    key[16];
00551     char    awardData[MAX_INFO_VALUE];
00552 
00553     trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, sizeof(awardData) );
00554 
00555     Com_sprintf( key, sizeof(key), "a%i", award );
00556     return atoi( Info_ValueForKey( awardData, key ) );
00557 }

void UI_GetBestScore int  level,
int *  score,
int *  skill
 

Definition at line 435 of file ui_gameinfo.c.

00435                                                           {
00436     int     n;
00437     int     skillScore;
00438     int     bestScore;
00439     int     bestScoreSkill;
00440     char    arenaKey[16];
00441     char    scores[MAX_INFO_VALUE];
00442 
00443     if( !score || !skill ) {
00444         return;
00445     }
00446 
00447     if( level < 0 || level > ui_numArenas ) {
00448         return;
00449     }
00450 
00451     bestScore = 0;
00452     bestScoreSkill = 0;
00453 
00454     for( n = 1; n <= 5; n++ ) {
00455         trap_Cvar_VariableStringBuffer( va( "g_spScores%i", n ), scores, MAX_INFO_VALUE );
00456 
00457         Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
00458         skillScore = atoi( Info_ValueForKey( scores, arenaKey ) );
00459 
00460         if( skillScore < 1 || skillScore > 8 ) {
00461             continue;
00462         }
00463 
00464         if( !bestScore || skillScore <= bestScore ) {
00465             bestScore = skillScore;
00466             bestScoreSkill = n;
00467         }
00468     }
00469 
00470     *score = bestScore;
00471     *skill = bestScoreSkill;
00472 }

char* UI_GetBotInfoByName const char *  name  ) 
 

Definition at line 409 of file ui_gameinfo.c.

00409                                               {
00410     int     n;
00411     char    *value;
00412 
00413     for ( n = 0; n < ui_numBots ; n++ ) {
00414         value = Info_ValueForKey( ui_botInfos[n], "name" );
00415         if ( !Q_stricmp( value, name ) ) {
00416             return ui_botInfos[n];
00417         }
00418     }
00419 
00420     return NULL;
00421 }

char* UI_GetBotInfoByNumber int  num  ) 
 

Definition at line 395 of file ui_gameinfo.c.

00395                                        {
00396     if( num < 0 || num >= ui_numBots ) {
00397         trap_Print( va( S_COLOR_RED "Invalid bot number: %i\n", num ) );
00398         return NULL;
00399     }
00400     return ui_botInfos[num];
00401 }

int UI_GetCurrentGame void   ) 
 

Definition at line 660 of file ui_gameinfo.c.

00660                               {
00661     int     level;
00662     int     rank;
00663     int     skill;
00664     const char *info;
00665 
00666     info = UI_GetSpecialArenaInfo( "training" );
00667     if( info ) {
00668         level = atoi( Info_ValueForKey( info, "num" ) );
00669         UI_GetBestScore( level, &rank, &skill );
00670         if ( !rank || rank > 1 ) {
00671             return level;
00672         }
00673     }
00674 
00675     for( level = 0; level < ui_numSinglePlayerArenas; level++ ) {
00676         UI_GetBestScore( level, &rank, &skill );
00677         if ( !rank || rank > 1 ) {
00678             return level;
00679         }
00680     }
00681 
00682     info = UI_GetSpecialArenaInfo( "final" );
00683     if( !info ) {
00684         return -1;
00685     }
00686     return atoi( Info_ValueForKey( info, "num" ) );
00687 }

int UI_GetNumArenas void   ) 
 

Definition at line 713 of file ui_gameinfo.c.

00713                             {
00714     return ui_numArenas;
00715 }

int UI_GetNumBots void   ) 
 

Definition at line 743 of file ui_gameinfo.c.

00743                           {
00744     return ui_numBots;
00745 }

int UI_GetNumSPArenas void   ) 
 

Definition at line 723 of file ui_gameinfo.c.

00723                               {
00724     return ui_numSinglePlayerArenas;
00725 }

int UI_GetNumSPTiers void   ) 
 

Definition at line 733 of file ui_gameinfo.c.

00733                              {
00734     return ui_numSinglePlayerArenas / ARENAS_PER_TIER;
00735 }

const char* UI_GetSpecialArenaInfo const char *  tag  ) 
 

Definition at line 312 of file ui_gameinfo.c.

00312                                                       {
00313     int         n;
00314 
00315     for( n = 0; n < ui_numArenas; n++ ) {
00316         if( Q_stricmp( Info_ValueForKey( ui_arenaInfos[n], "special" ), tag ) == 0 ) {
00317             return ui_arenaInfos[n];
00318         }
00319     }
00320 
00321     return NULL;
00322 }

void UI_GraphicsOptionsMenu void   ) 
 

Definition at line 1065 of file ui_video.c.

Referenced by Options_Event(), UI_DisplayOptionsMenu_Event(), UI_NetworkOptionsMenu_Event(), UI_SetupMenu_Event(), and UI_SoundOptionsMenu_Event().

void UI_InGameMenu void   ) 
 

Definition at line 339 of file ui_ingame.c.

00339                            {
00340     // force as top level menu
00341     uis.menusp = 0;  
00342 
00343     // set menu cursor to a nice location
00344     uis.cursorx = 319;
00345     uis.cursory = 80;
00346 
00347     InGame_MenuInit();
00348     UI_PushMenu( &s_ingame.menu );
00349 }

void UI_Init void   ) 
 

Definition at line 1067 of file ui_atoms.c.

01067                      {
01068     UI_RegisterCvars();
01069 
01070     UI_InitGameinfo();
01071 
01072     // cache redundant calulations
01073     trap_GetGlconfig( &uis.glconfig );
01074 
01075     // for 640x480 virtualized screen
01076     uis.scale = uis.glconfig.vidHeight * (1.0/480.0);
01077     if ( uis.glconfig.vidWidth * 480 > uis.glconfig.vidHeight * 640 ) {
01078         // wide screen
01079         uis.bias = 0.5 * ( uis.glconfig.vidWidth - ( uis.glconfig.vidHeight * (640.0/480.0) ) );
01080     }
01081     else {
01082         // no wide screen
01083         uis.bias = 0;
01084     }
01085 
01086     // initialize the menu system
01087     Menu_Cache();
01088 
01089     uis.activemenu = NULL;
01090     uis.menusp     = 0;
01091 }

void UI_InitGameinfo void   ) 
 

Definition at line 808 of file ui_gameinfo.c.

00808                              {
00809 
00810     UI_InitMemory();
00811     UI_LoadArenas();
00812     UI_LoadBots();
00813 
00814     if( (trap_Cvar_VariableValue( "fs_restrict" )) || (ui_numSpecialSinglePlayerArenas == 0 && ui_numSinglePlayerArenas == 4) ) {
00815         uis.demoversion = qtrue;
00816     }
00817     else {
00818         uis.demoversion = qfalse;
00819     }
00820 }

qboolean UI_IsFullscreen void   ) 
 

Definition at line 791 of file ui_atoms.c.

00791                                  {
00792     if ( uis.activemenu && ( trap_Key_GetCatcher() & KEYCATCH_UI ) ) {
00793         return uis.activemenu->fullscreen;
00794     }
00795 
00796     return qfalse;
00797 }

void UI_KeyEvent int  key,
int  down
 

Definition at line 855 of file ui_atoms.c.

References uiStatic_t::activemenu, CHAN_LOCAL_SOUND, _tag_menuframework::key, Menu_DefaultKey(), s, sfxHandle_t, trap_S_StartLocalSound(), and uis.

00855                                       {
00856     sfxHandle_t     s;
00857 
00858     if (!uis.activemenu) {
00859         return;
00860     }
00861 
00862     if (!down) {
00863         return;
00864     }
00865 
00866     if (uis.activemenu->key)
00867         s = uis.activemenu->key( key );
00868     else
00869         s = Menu_DefaultKey( uis.activemenu, key );
00870 
00871     if ((s > 0) && (s != menu_null_sound))
00872         trap_S_StartLocalSound( s, CHAN_LOCAL_SOUND );
00873 }

Here is the call graph for this function:

void UI_LerpColor vec4_t  a,
vec4_t  b,
vec4_t  c,
float  t
 

Definition at line 172 of file ui_atoms.c.

00173 {
00174     int i;
00175 
00176     // lerp and clamp each component
00177     for (i=0; i<4; i++)
00178     {
00179         c[i] = a[i] + t*(b[i]-a[i]);
00180         if (c[i] < 0)
00181             c[i] = 0;
00182         else if (c[i] > 1.0)
00183             c[i] = 1.0;
00184     }
00185 }

void UI_LoadConfig_Cache void   ) 
 

Definition at line 252 of file ui_loadconfig.c.

00252                                  {
00253     trap_R_RegisterShaderNoMip( ART_BACK0 );
00254     trap_R_RegisterShaderNoMip( ART_BACK1 );
00255     trap_R_RegisterShaderNoMip( ART_FIGHT0 );
00256     trap_R_RegisterShaderNoMip( ART_FIGHT1 );
00257     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00258     trap_R_RegisterShaderNoMip( ART_FRAMER );
00259     trap_R_RegisterShaderNoMip( ART_ARROWS );
00260     trap_R_RegisterShaderNoMip( ART_ARROWLEFT );
00261     trap_R_RegisterShaderNoMip( ART_ARROWRIGHT );
00262 }

void UI_LoadConfigMenu void   ) 
 

Definition at line 270 of file ui_loadconfig.c.

00270                                {
00271     LoadConfig_MenuInit();
00272     UI_PushMenu( &s_configs.menu );
00273 }

void UI_LogAwardData int  award,
int  data
 

Definition at line 520 of file ui_gameinfo.c.

00520                                             {
00521     char    key[16];
00522     char    awardData[MAX_INFO_VALUE];
00523     int     oldValue;
00524 
00525     if( data == 0 ) {
00526         return;
00527     }
00528 
00529     if( award > AWARD_PERFECT ) {
00530         trap_Print( va( S_COLOR_RED "Bad award %i in UI_LogAwardData\n", award ) );
00531         return;
00532     }
00533 
00534     trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, sizeof(awardData) );
00535 
00536     Com_sprintf( key, sizeof(key), "a%i", award );
00537     oldValue = atoi( Info_ValueForKey( awardData, key ) );
00538 
00539     Info_SetValueForKey( awardData, key, va( "%i", oldValue + data ) );
00540     trap_Cvar_Set( "g_spAwards", awardData );
00541 }

void UI_LoginMenu void   ) 
 

Definition at line 203 of file ui_login.c.

Referenced by Rankings_MenuEvent(), and RankStatus_MenuEvent().

00203                           {
00204     Login_MenuInit();
00205     UI_PushMenu ( &s_login.menu );
00206 }

void UI_MainMenu void   ) 
 

Definition at line 269 of file ui_menu.c.

Referenced by ErrorMessage_Key(), and UI_SetActiveMenu().

00269                          {
00270     int     y;
00271     qboolean teamArena = qfalse;
00272     int     style = UI_CENTER | UI_DROPSHADOW;
00273 
00274     trap_Cvar_Set( "sv_killserver", "1" );
00275 
00276     if( !uis.demoversion && !ui_cdkeychecked.integer ) {
00277         char    key[17];
00278 
00279         trap_GetCDKey( key, sizeof(key) );
00280         if( trap_VerifyCDKey( key, NULL ) == qfalse ) {
00281             UI_CDKeyMenu();
00282             return;
00283         }
00284     }
00285     
00286     memset( &s_main, 0 ,sizeof(mainmenu_t) );
00287     memset( &s_errorMessage, 0 ,sizeof(errorMessage_t) );
00288 
00289     // com_errorMessage would need that too
00290     MainMenu_Cache();
00291     
00292     trap_Cvar_VariableStringBuffer( "com_errorMessage", s_errorMessage.errorMessage, sizeof(s_errorMessage.errorMessage) );
00293     if (strlen(s_errorMessage.errorMessage))
00294     {   
00295         s_errorMessage.menu.draw = Main_MenuDraw;
00296         s_errorMessage.menu.key = ErrorMessage_Key;
00297         s_errorMessage.menu.fullscreen = qtrue;
00298         s_errorMessage.menu.wrapAround = qtrue;
00299         s_errorMessage.menu.showlogo = qtrue;       
00300 
00301         trap_Key_SetCatcher( KEYCATCH_UI );
00302         uis.menusp = 0;
00303         UI_PushMenu ( &s_errorMessage.menu );
00304         
00305         return;
00306     }
00307 
00308     s_main.menu.draw = Main_MenuDraw;
00309     s_main.menu.fullscreen = qtrue;
00310     s_main.menu.wrapAround = qtrue;
00311     s_main.menu.showlogo = qtrue;
00312 
00313     y = 134;
00314     s_main.singleplayer.generic.type        = MTYPE_PTEXT;
00315     s_main.singleplayer.generic.flags       = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00316     s_main.singleplayer.generic.x           = 320;
00317     s_main.singleplayer.generic.y           = y;
00318     s_main.singleplayer.generic.id          = ID_SINGLEPLAYER;
00319     s_main.singleplayer.generic.callback    = Main_MenuEvent; 
00320     s_main.singleplayer.string              = "SINGLE PLAYER";
00321     s_main.singleplayer.color               = color_red;
00322     s_main.singleplayer.style               = style;
00323 
00324     y += MAIN_MENU_VERTICAL_SPACING;
00325     s_main.multiplayer.generic.type         = MTYPE_PTEXT;
00326     s_main.multiplayer.generic.flags        = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00327     s_main.multiplayer.generic.x            = 320;
00328     s_main.multiplayer.generic.y            = y;
00329     s_main.multiplayer.generic.id           = ID_MULTIPLAYER;
00330     s_main.multiplayer.generic.callback     = Main_MenuEvent; 
00331     s_main.multiplayer.string               = "MULTIPLAYER";
00332     s_main.multiplayer.color                = color_red;
00333     s_main.multiplayer.style                = style;
00334 
00335     y += MAIN_MENU_VERTICAL_SPACING;
00336     s_main.setup.generic.type               = MTYPE_PTEXT;
00337     s_main.setup.generic.flags              = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00338     s_main.setup.generic.x                  = 320;
00339     s_main.setup.generic.y                  = y;
00340     s_main.setup.generic.id                 = ID_SETUP;
00341     s_main.setup.generic.callback           = Main_MenuEvent; 
00342     s_main.setup.string                     = "SETUP";
00343     s_main.setup.color                      = color_red;
00344     s_main.setup.style                      = style;
00345 
00346     y += MAIN_MENU_VERTICAL_SPACING;
00347     s_main.demos.generic.type               = MTYPE_PTEXT;
00348     s_main.demos.generic.flags              = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00349     s_main.demos.generic.x                  = 320;
00350     s_main.demos.generic.y                  = y;
00351     s_main.demos.generic.id                 = ID_DEMOS;
00352     s_main.demos.generic.callback           = Main_MenuEvent; 
00353     s_main.demos.string                     = "DEMOS";
00354     s_main.demos.color                      = color_red;
00355     s_main.demos.style                      = style;
00356 
00357     y += MAIN_MENU_VERTICAL_SPACING;
00358     s_main.cinematics.generic.type          = MTYPE_PTEXT;
00359     s_main.cinematics.generic.flags         = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00360     s_main.cinematics.generic.x             = 320;
00361     s_main.cinematics.generic.y             = y;
00362     s_main.cinematics.generic.id            = ID_CINEMATICS;
00363     s_main.cinematics.generic.callback      = Main_MenuEvent; 
00364     s_main.cinematics.string                = "CINEMATICS";
00365     s_main.cinematics.color                 = color_red;
00366     s_main.cinematics.style                 = style;
00367 
00368     if (UI_TeamArenaExists()) {
00369         teamArena = qtrue;
00370         y += MAIN_MENU_VERTICAL_SPACING;
00371         s_main.teamArena.generic.type           = MTYPE_PTEXT;
00372         s_main.teamArena.generic.flags          = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00373         s_main.teamArena.generic.x              = 320;
00374         s_main.teamArena.generic.y              = y;
00375         s_main.teamArena.generic.id             = ID_TEAMARENA;
00376         s_main.teamArena.generic.callback       = Main_MenuEvent; 
00377         s_main.teamArena.string                 = "TEAM ARENA";
00378         s_main.teamArena.color                  = color_red;
00379         s_main.teamArena.style                  = style;
00380     }
00381 
00382     y += MAIN_MENU_VERTICAL_SPACING;
00383     s_main.mods.generic.type            = MTYPE_PTEXT;
00384     s_main.mods.generic.flags           = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00385     s_main.mods.generic.x               = 320;
00386     s_main.mods.generic.y               = y;
00387     s_main.mods.generic.id              = ID_MODS;
00388     s_main.mods.generic.callback        = Main_MenuEvent; 
00389     s_main.mods.string                  = "MODS";
00390     s_main.mods.color                   = color_red;
00391     s_main.mods.style                   = style;
00392 
00393     y += MAIN_MENU_VERTICAL_SPACING;
00394     s_main.exit.generic.type                = MTYPE_PTEXT;
00395     s_main.exit.generic.flags               = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00396     s_main.exit.generic.x                   = 320;
00397     s_main.exit.generic.y                   = y;
00398     s_main.exit.generic.id                  = ID_EXIT;
00399     s_main.exit.generic.callback            = Main_MenuEvent; 
00400     s_main.exit.string                      = "EXIT";
00401     s_main.exit.color                       = color_red;
00402     s_main.exit.style                       = style;
00403 
00404     Menu_AddItem( &s_main.menu, &s_main.singleplayer );
00405     Menu_AddItem( &s_main.menu, &s_main.multiplayer );
00406     Menu_AddItem( &s_main.menu, &s_main.setup );
00407     Menu_AddItem( &s_main.menu, &s_main.demos );
00408     Menu_AddItem( &s_main.menu, &s_main.cinematics );
00409     if (teamArena) {
00410         Menu_AddItem( &s_main.menu, &s_main.teamArena );
00411     }
00412     Menu_AddItem( &s_main.menu, &s_main.mods );
00413     Menu_AddItem( &s_main.menu, &s_main.exit );             
00414 
00415     trap_Key_SetCatcher( KEYCATCH_UI );
00416     uis.menusp = 0;
00417     UI_PushMenu ( &s_main.menu );
00418         
00419 }

void UI_Message const char **  lines  ) 
 

Definition at line 251 of file ui_confirm.c.

References menucommon_s::callback, menutext_s::color, ConfirmMenu_Cache(), uiClientState_t::connState, _tag_menuframework::draw, menucommon_s::flags, _tag_menuframework::fullscreen, menutext_s::generic, menucommon_s::id, _tag_menuframework::key, confirmMenu_t::lines, memset(), confirmMenu_t::menu, Menu_AddItem(), Menu_SetCursorToItem(), QMF_LEFT_JUSTIFY, s_confirm, menutext_s::string, menutext_s::style, confirmMenu_t::style, trap_GetClientState(), menucommon_s::type, UI_CENTER, UI_INVERSE, UI_ProportionalStringWidth(), UI_PushMenu(), _tag_menuframework::wrapAround, menucommon_s::x, menucommon_s::y, and confirmMenu_t::yes.

Referenced by Punkbuster_ConfirmDisable().

00251                                       {
00252     uiClientState_t cstate;
00253     int n1, l1;
00254     
00255     // zero set all our globals
00256     memset( &s_confirm, 0, sizeof(s_confirm) );
00257 
00258     ConfirmMenu_Cache();
00259 
00260     n1 = UI_ProportionalStringWidth( "OK" );
00261     l1 = 320 - ( n1 / 2 );
00262     
00263     s_confirm.lines = lines;
00264     s_confirm.style = UI_CENTER|UI_INVERSE|UI_SMALLFONT;
00265 
00266     s_confirm.menu.draw       = MessageMenu_Draw;
00267     s_confirm.menu.key        = ConfirmMenu_Key;
00268     s_confirm.menu.wrapAround = qtrue;
00269     
00270     trap_GetClientState( &cstate );
00271     if ( cstate.connState >= CA_CONNECTED ) {
00272         s_confirm.menu.fullscreen = qfalse;
00273     }
00274     else {
00275         s_confirm.menu.fullscreen = qtrue;
00276     }
00277 
00278     s_confirm.yes.generic.type      = MTYPE_PTEXT;      
00279     s_confirm.yes.generic.flags     = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
00280     s_confirm.yes.generic.callback  = ConfirmMenu_Event;
00281     s_confirm.yes.generic.id        = ID_CONFIRM_YES;
00282     s_confirm.yes.generic.x         = l1;
00283     s_confirm.yes.generic.y         = 280;
00284     s_confirm.yes.string            = "OK";
00285     s_confirm.yes.color             = color_red;
00286     s_confirm.yes.style             = UI_LEFT;
00287 
00288     Menu_AddItem( &s_confirm.menu,  &s_confirm.yes );
00289     
00290     UI_PushMenu( &s_confirm.menu );
00291 
00292     Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.yes );
00293 }

Here is the call graph for this function:

void UI_ModsMenu void   ) 
 

Definition at line 280 of file ui_mods.c.

Referenced by Main_MenuEvent().

00280                          {
00281     UI_Mods_MenuInit();
00282     UI_PushMenu( &s_mods.menu );
00283 }

void UI_ModsMenu_Cache void   ) 
 

Definition at line 265 of file ui_mods.c.

Referenced by UI_Cache_f(), and UI_Mods_MenuInit().

00265                                {
00266     trap_R_RegisterShaderNoMip( ART_BACK0 );
00267     trap_R_RegisterShaderNoMip( ART_BACK1 );
00268     trap_R_RegisterShaderNoMip( ART_FIGHT0 );
00269     trap_R_RegisterShaderNoMip( ART_FIGHT1 );
00270     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00271     trap_R_RegisterShaderNoMip( ART_FRAMER );
00272 }

void UI_MouseEvent int  dx,
int  dy
 

Definition at line 880 of file ui_atoms.c.

00881 {
00882     int             i;
00883     menucommon_s*   m;
00884 
00885     if (!uis.activemenu)
00886         return;
00887 
00888     // update mouse screen position
00889     uis.cursorx += dx;
00890     if (uis.cursorx < 0)
00891         uis.cursorx = 0;
00892     else if (uis.cursorx > SCREEN_WIDTH)
00893         uis.cursorx = SCREEN_WIDTH;
00894 
00895     uis.cursory += dy;
00896     if (uis.cursory < 0)
00897         uis.cursory = 0;
00898     else if (uis.cursory > SCREEN_HEIGHT)
00899         uis.cursory = SCREEN_HEIGHT;
00900 
00901     // region test the active menu items
00902     for (i=0; i<uis.activemenu->nitems; i++)
00903     {
00904         m = (menucommon_s*)uis.activemenu->items[i];
00905 
00906         if (m->flags & (QMF_GRAYED|QMF_INACTIVE))
00907             continue;
00908 
00909         if ((uis.cursorx < m->left) ||
00910             (uis.cursorx > m->right) ||
00911             (uis.cursory < m->top) ||
00912             (uis.cursory > m->bottom))
00913         {
00914             // cursor out of item bounds
00915             continue;
00916         }
00917 
00918         // set focus to item at cursor
00919         if (uis.activemenu->cursor != i)
00920         {
00921             Menu_SetCursor( uis.activemenu, i );
00922             ((menucommon_s*)(uis.activemenu->items[uis.activemenu->cursor_prev]))->flags &= ~QMF_HASMOUSEFOCUS;
00923 
00924             if ( !(((menucommon_s*)(uis.activemenu->items[uis.activemenu->cursor]))->flags & QMF_SILENT ) ) {
00925                 trap_S_StartLocalSound( menu_move_sound, CHAN_LOCAL_SOUND );
00926             }
00927         }
00928 
00929         ((menucommon_s*)(uis.activemenu->items[uis.activemenu->cursor]))->flags |= QMF_HASMOUSEFOCUS;
00930         return;
00931     }  
00932 
00933     if (uis.activemenu->nitems > 0) {
00934         // out of any region
00935         ((menucommon_s*)(uis.activemenu->items[uis.activemenu->cursor]))->flags &= ~QMF_HASMOUSEFOCUS;
00936     }
00937 }

void UI_NetworkOptionsMenu void   ) 
 

Definition at line 277 of file ui_network.c.

Referenced by GraphicsOptions_Event(), Options_Event(), UI_DisplayOptionsMenu_Event(), and UI_SoundOptionsMenu_Event().

void UI_NetworkOptionsMenu_Cache void   ) 
 

Definition at line 264 of file ui_network.c.

Referenced by UI_Cache_f(), and UI_NetworkOptionsMenu_Init().

00264                                          {
00265     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00266     trap_R_RegisterShaderNoMip( ART_FRAMER );
00267     trap_R_RegisterShaderNoMip( ART_BACK0 );
00268     trap_R_RegisterShaderNoMip( ART_BACK1 );
00269 }

void UI_NewGame void   ) 
 

Definition at line 697 of file ui_gameinfo.c.

00697                         {
00698     trap_Cvar_Set( "g_spScores1", "" );
00699     trap_Cvar_Set( "g_spScores2", "" );
00700     trap_Cvar_Set( "g_spScores3", "" );
00701     trap_Cvar_Set( "g_spScores4", "" );
00702     trap_Cvar_Set( "g_spScores5", "" );
00703     trap_Cvar_Set( "g_spAwards", "" );
00704     trap_Cvar_Set( "g_spVideos", "" );
00705 }

void UI_PlayerInfo_SetInfo playerInfo_t pi,
int  legsAnim,
int  torsoAnim,
vec3_t  viewAngles,
vec3_t  moveAngles,
weapon_t  weaponNum,
qboolean  chat
 

Definition at line 1139 of file ui_players.c.

01139                                                                                                                                                         {
01140     int         currentAnim;
01141     weapon_t    weaponNum;
01142 
01143     pi->chat = chat;
01144 
01145     // view angles
01146     VectorCopy( viewAngles, pi->viewAngles );
01147 
01148     // move angles
01149     VectorCopy( moveAngles, pi->moveAngles );
01150 
01151     if ( pi->newModel ) {
01152         pi->newModel = qfalse;
01153 
01154         jumpHeight = 0;
01155         pi->pendingLegsAnim = 0;
01156         UI_ForceLegsAnim( pi, legsAnim );
01157         pi->legs.yawAngle = viewAngles[YAW];
01158         pi->legs.yawing = qfalse;
01159 
01160         pi->pendingTorsoAnim = 0;
01161         UI_ForceTorsoAnim( pi, torsoAnim );
01162         pi->torso.yawAngle = viewAngles[YAW];
01163         pi->torso.yawing = qfalse;
01164 
01165         if ( weaponNumber != -1 ) {
01166             pi->weapon = weaponNumber;
01167             pi->currentWeapon = weaponNumber;
01168             pi->lastWeapon = weaponNumber;
01169             pi->pendingWeapon = -1;
01170             pi->weaponTimer = 0;
01171             UI_PlayerInfo_SetWeapon( pi, pi->weapon );
01172         }
01173 
01174         return;
01175     }
01176 
01177     // weapon
01178     if ( weaponNumber == -1 ) {
01179         pi->pendingWeapon = -1;
01180         pi->weaponTimer = 0;
01181     }
01182     else if ( weaponNumber != WP_NONE ) {
01183         pi->pendingWeapon = weaponNumber;
01184         pi->weaponTimer = dp_realtime + UI_TIMER_WEAPON_DELAY;
01185     }
01186     weaponNum = pi->lastWeapon;
01187     pi->weapon = weaponNum;
01188 
01189     if ( torsoAnim == BOTH_DEATH1 || legsAnim == BOTH_DEATH1 ) {
01190         torsoAnim = legsAnim = BOTH_DEATH1;
01191         pi->weapon = pi->currentWeapon = WP_NONE;
01192         UI_PlayerInfo_SetWeapon( pi, pi->weapon );
01193 
01194         jumpHeight = 0;
01195         pi->pendingLegsAnim = 0;
01196         UI_ForceLegsAnim( pi, legsAnim );
01197 
01198         pi->pendingTorsoAnim = 0;
01199         UI_ForceTorsoAnim( pi, torsoAnim );
01200 
01201         return;
01202     }
01203 
01204     // leg animation
01205     currentAnim = pi->legsAnim & ~ANIM_TOGGLEBIT;
01206     if ( legsAnim != LEGS_JUMP && ( currentAnim == LEGS_JUMP || currentAnim == LEGS_LAND ) ) {
01207         pi->pendingLegsAnim = legsAnim;
01208     }
01209     else if ( legsAnim != currentAnim ) {
01210         jumpHeight = 0;
01211         pi->pendingLegsAnim = 0;
01212         UI_ForceLegsAnim( pi, legsAnim );
01213     }
01214 
01215     // torso animation
01216     if ( torsoAnim == TORSO_STAND || torsoAnim == TORSO_STAND2 ) {
01217         if ( weaponNum == WP_NONE || weaponNum == WP_GAUNTLET ) {
01218             torsoAnim = TORSO_STAND2;
01219         }
01220         else {
01221             torsoAnim = TORSO_STAND;
01222         }
01223     }
01224 
01225     if ( torsoAnim == TORSO_ATTACK || torsoAnim == TORSO_ATTACK2 ) {
01226         if ( weaponNum == WP_NONE || weaponNum == WP_GAUNTLET ) {
01227             torsoAnim = TORSO_ATTACK2;
01228         }
01229         else {
01230             torsoAnim = TORSO_ATTACK;
01231         }
01232         pi->muzzleFlashTime = dp_realtime + UI_TIMER_MUZZLE_FLASH;
01233         //FIXME play firing sound here
01234     }
01235 
01236     currentAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT;
01237 
01238     if ( weaponNum != pi->currentWeapon || currentAnim == TORSO_RAISE || currentAnim == TORSO_DROP ) {
01239         pi->pendingTorsoAnim = torsoAnim;
01240     }
01241     else if ( ( currentAnim == TORSO_GESTURE || currentAnim == TORSO_ATTACK ) && ( torsoAnim != currentAnim ) ) {
01242         pi->pendingTorsoAnim = torsoAnim;
01243     }
01244     else if ( torsoAnim != currentAnim ) {
01245         pi->pendingTorsoAnim = 0;
01246         UI_ForceTorsoAnim( pi, torsoAnim );
01247     }
01248 }

void UI_PlayerInfo_SetModel playerInfo_t pi,
const char *  model
 

Definition at line 1120 of file ui_players.c.

01120                                                                    {
01121     memset( pi, 0, sizeof(*pi) );
01122     UI_RegisterClientModelname( pi, model );
01123     pi->weapon = WP_MACHINEGUN;
01124     pi->currentWeapon = pi->weapon;
01125     pi->lastWeapon = pi->weapon;
01126     pi->pendingWeapon = -1;
01127     pi->weaponTimer = 0;
01128     pi->chat = qfalse;
01129     pi->newModel = qtrue;
01130     UI_PlayerInfo_SetWeapon( pi, pi->weapon );
01131 }

void UI_PlayerModelMenu void   ) 
 

Definition at line 722 of file ui_playermodel.c.

Referenced by PlayerSettings_MenuEvent().

00723 {
00724     PlayerModel_MenuInit();
00725 
00726     UI_PushMenu( &s_playermodel.menu );
00727 
00728     Menu_SetCursorToItem( &s_playermodel.menu, &s_playermodel.pics[s_playermodel.selectedmodel % MAX_MODELSPERPAGE] );
00729 }

void UI_PlayerSettingsMenu void   ) 
 

Definition at line 510 of file ui_playersettings.c.

Referenced by UI_SetupMenu_Event(), and UI_SPLevelMenu_PlayerEvent().

00510                                    {
00511     PlayerSettings_MenuInit();
00512     UI_PushMenu( &s_playersettings.menu );
00513 }

void UI_PopMenu void   ) 
 

Definition at line 139 of file ui_atoms.c.

00140 {
00141     trap_S_StartLocalSound( menu_out_sound, CHAN_LOCAL_SOUND );
00142 
00143     uis.menusp--;
00144 
00145     if (uis.menusp < 0)
00146         trap_Error ("UI_PopMenu: menu stack underflow");
00147 
00148     if (uis.menusp) {
00149         uis.activemenu = uis.stack[uis.menusp-1];
00150         uis.firstdraw = qtrue;
00151     }
00152     else {
00153         UI_ForceMenuOff ();
00154     }
00155 }

void UI_PreferencesMenu void   ) 
 

Definition at line 416 of file ui_preferences.c.

Referenced by UI_SetupMenu_Event().

00416                                 {
00417     Preferences_MenuInit();
00418     UI_PushMenu( &s_preferences.menu );
00419 }

float UI_ProportionalSizeScale int  style  ) 
 

Definition at line 755 of file cg_drawtools.c.

00755                                             {
00756     if(  style & UI_SMALLFONT ) {
00757         return 0.75;
00758     }
00759 
00760     return 1.00;
00761 }

int UI_ProportionalStringWidth const char *  str  ) 
 

Definition at line 684 of file cg_drawtools.c.

00684                                                   {
00685     const char *    s;
00686     int             ch;
00687     int             charWidth;
00688     int             width;
00689 
00690     s = str;
00691     width = 0;
00692     while ( *s ) {
00693         ch = *s & 127;
00694         charWidth = propMap[ch][2];
00695         if ( charWidth != -1 ) {
00696             width += charWidth;
00697             width += PROP_GAP_WIDTH;
00698         }
00699         s++;
00700     }
00701 
00702     width -= PROP_GAP_WIDTH;
00703     return width;
00704 }

void UI_PushMenu menuframework_s menu  ) 
 

Definition at line 86 of file ui_atoms.c.

00087 {
00088     int             i;
00089     menucommon_s*   item;
00090 
00091     // avoid stacking menus invoked by hotkeys
00092     for (i=0 ; i<uis.menusp ; i++)
00093     {
00094         if (uis.stack[i] == menu)
00095         {
00096             uis.menusp = i;
00097             break;
00098         }
00099     }
00100 
00101     if (i == uis.menusp)
00102     {
00103         if (uis.menusp >= MAX_MENUDEPTH)
00104             trap_Error("UI_PushMenu: menu stack overflow");
00105 
00106         uis.stack[uis.menusp++] = menu;
00107     }
00108 
00109     uis.activemenu = menu;
00110 
00111     // default cursor position
00112     menu->cursor      = 0;
00113     menu->cursor_prev = 0;
00114 
00115     m_entersound = qtrue;
00116 
00117     trap_Key_SetCatcher( KEYCATCH_UI );
00118 
00119     // force first available item to have focus
00120     for (i=0; i<menu->nitems; i++)
00121     {
00122         item = (menucommon_s *)menu->items[i];
00123         if (!(item->flags & (QMF_GRAYED|QMF_MOUSEONLY|QMF_INACTIVE)))
00124         {
00125             menu->cursor_prev = -1;
00126             Menu_SetCursor( menu, i );
00127             break;
00128         }
00129     }
00130 
00131     uis.firstdraw = qtrue;
00132 }

void UI_RankingsMenu void   ) 
 

Definition at line 415 of file ui_rankings.c.

References rankings_t::menu, Rankings_MenuInit(), s_rankings, and UI_PushMenu().

Referenced by RankStatus_MenuEvent().

00415                              {
00416     Rankings_MenuInit();
00417     UI_PushMenu ( &s_rankings.menu );
00418 }

Here is the call graph for this function:

void UI_RankStatusMenu void   ) 
 

Definition at line 168 of file ui_rankstatus.c.

00168                                {
00169 
00170     s_status = (grank_status_t)trap_Cvar_VariableValue("client_status");
00171 
00172     switch( s_status )
00173     {
00174     case QGR_STATUS_NEW:
00175         return;
00176     case QGR_STATUS_PENDING:
00177         // GRANK_FIXME
00178         return;
00179     case QGR_STATUS_NO_USER:
00180         // GRANK_FIXME - get this when user exists
00181         s_rankstatus_message = "Username unavailable";
00182         break;
00183     case QGR_STATUS_BAD_PASSWORD:
00184         s_rankstatus_message = "Invalid password";
00185         break;
00186     case QGR_STATUS_TIMEOUT:
00187         s_rankstatus_message = "Timed out";
00188         break;
00189     case QGR_STATUS_NO_MEMBERSHIP:
00190         s_rankstatus_message = "No membership";
00191         break;
00192     case QGR_STATUS_INVALIDUSER:
00193         s_rankstatus_message = "Validation failed";
00194         break;
00195     case QGR_STATUS_ERROR:
00196         s_rankstatus_message = "Error";
00197         break;
00198     case QGR_STATUS_SPECTATOR:
00199     case QGR_STATUS_ACTIVE:
00200         UI_ForceMenuOff();
00201         return;
00202     default:
00203         return;
00204     }
00205     RankStatus_MenuInit();
00206     trap_CL_UI_RankUserReset();
00207     UI_PushMenu ( &s_rankstatus.menu );
00208 }

void UI_Refresh int  realtime  ) 
 

Definition at line 1195 of file ui_atoms.c.

01196 {
01197     uis.frametime = realtime - uis.realtime;
01198     uis.realtime  = realtime;
01199 
01200     if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) {
01201         return;
01202     }
01203 
01204     UI_UpdateCvars();
01205 
01206     if ( uis.activemenu )
01207     {
01208         if (uis.activemenu->fullscreen)
01209         {
01210             // draw the background
01211             if( uis.activemenu->showlogo ) {
01212                 UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackShader );
01213             }
01214             else {
01215                 UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.menuBackNoLogoShader );
01216             }
01217         }
01218 
01219         if (uis.activemenu->draw)
01220             uis.activemenu->draw();
01221         else
01222             Menu_Draw( uis.activemenu );
01223 
01224         if( uis.firstdraw ) {
01225             UI_MouseEvent( 0, 0 );
01226             uis.firstdraw = qfalse;
01227         }
01228     }
01229 
01230     // draw cursor
01231     UI_SetColor( NULL );
01232     UI_DrawHandlePic( uis.cursorx-16, uis.cursory-16, 32, 32, uis.cursor);
01233 
01234 #ifndef NDEBUG
01235     if (uis.debug)
01236     {
01237         // cursor coordinates
01238         UI_DrawString( 0, 0, va("(%d,%d)",uis.cursorx,uis.cursory), UI_LEFT|UI_SMALLFONT, colorRed );
01239     }
01240 #endif
01241 
01242     // delay playing the enter sound until after the
01243     // menu has been drawn, to avoid delay while
01244     // caching images
01245     if (m_entersound)
01246     {
01247         trap_S_StartLocalSound( menu_in_sound, CHAN_LOCAL_SOUND );
01248         m_entersound = qfalse;
01249     }
01250 }

qboolean UI_RegisterClientModelname playerInfo_t pi,
const char *  modelSkinName
 

Definition at line 1048 of file ui_players.c.

01048                                                                                    {
01049     char        modelName[MAX_QPATH];
01050     char        skinName[MAX_QPATH];
01051     char        filename[MAX_QPATH];
01052     char        *slash;
01053 
01054     pi->torsoModel = 0;
01055     pi->headModel = 0;
01056 
01057     if ( !modelSkinName[0] ) {
01058         return qfalse;
01059     }
01060 
01061     Q_strncpyz( modelName, modelSkinName, sizeof( modelName ) );
01062 
01063     slash = strchr( modelName, '/' );
01064     if ( !slash ) {
01065         // modelName did not include a skin name
01066         Q_strncpyz( skinName, "default", sizeof( skinName ) );
01067     } else {
01068         Q_strncpyz( skinName, slash + 1, sizeof( skinName ) );
01069         // truncate modelName
01070         *slash = 0;
01071     }
01072 
01073     // load cmodels before models so filecache works
01074 
01075     Com_sprintf( filename, sizeof( filename ), "models/players/%s/lower.md3", modelName );
01076     pi->legsModel = trap_R_RegisterModel( filename );
01077     if ( !pi->legsModel ) {
01078         Com_Printf( "Failed to load model file %s\n", filename );
01079         return qfalse;
01080     }
01081 
01082     Com_sprintf( filename, sizeof( filename ), "models/players/%s/upper.md3", modelName );
01083     pi->torsoModel = trap_R_RegisterModel( filename );
01084     if ( !pi->torsoModel ) {
01085         Com_Printf( "Failed to load model file %s\n", filename );
01086         return qfalse;
01087     }
01088 
01089     Com_sprintf( filename, sizeof( filename ), "models/players/%s/head.md3", modelName );
01090     pi->headModel = trap_R_RegisterModel( filename );
01091     if ( !pi->headModel ) {
01092         Com_Printf( "Failed to load model file %s\n", filename );
01093         return qfalse;
01094     }
01095 
01096     // if any skins failed to load, fall back to default
01097     if ( !UI_RegisterClientSkin( pi, modelName, skinName ) ) {
01098         if ( !UI_RegisterClientSkin( pi, modelName, "default" ) ) {
01099             Com_Printf( "Failed to load skin file: %s : %s\n", modelName, skinName );
01100             return qfalse;
01101         }
01102     }
01103 
01104     // load the animations
01105     Com_sprintf( filename, sizeof( filename ), "models/players/%s/animation.cfg", modelName );
01106     if ( !UI_ParseAnimationFile( filename, pi->animations ) ) {
01107         Com_Printf( "Failed to load animation file %s\n", filename );
01108         return qfalse;
01109     }
01110 
01111     return qtrue;
01112 }

void UI_RegisterCvars void   ) 
 

Definition at line 228 of file ui_main.c.

Referenced by _UI_Init(), and UI_Init().

00228                               {
00229     int         i;
00230     cvarTable_t *cv;
00231 
00232     for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
00233         trap_Cvar_Register( cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags );
00234     }
00235 }

void UI_RemoveBots_Cache void   ) 
 

Definition at line 211 of file ui_removebots.c.

Referenced by UI_Cache_f(), and UI_RemoveBotsMenu_Init().

00211                                  {
00212     trap_R_RegisterShaderNoMip( ART_BACKGROUND );
00213     trap_R_RegisterShaderNoMip( ART_BACK0 );
00214     trap_R_RegisterShaderNoMip( ART_BACK1 );
00215     trap_R_RegisterShaderNoMip( ART_DELETE0 );
00216     trap_R_RegisterShaderNoMip( ART_DELETE1 );
00217 }

void UI_RemoveBotsMenu void   ) 
 

Definition at line 339 of file ui_removebots.c.

Referenced by InGame_Event().

00339                                {
00340     UI_RemoveBotsMenu_Init();
00341     UI_PushMenu( &removeBotsMenuInfo.menu );
00342 }

void UI_SaveConfigMenu void   ) 
 

Definition at line 209 of file ui_saveconfig.c.

00209                                {
00210     UI_SaveConfigMenu_Init();
00211     UI_PushMenu( &saveConfig.menu );
00212 }

void UI_SaveConfigMenu_Cache void   ) 
 

Definition at line 195 of file ui_saveconfig.c.

Referenced by UI_SaveConfigMenu_Init().

00195                                      {
00196     trap_R_RegisterShaderNoMip( ART_BACK0 );
00197     trap_R_RegisterShaderNoMip( ART_BACK1 );
00198     trap_R_RegisterShaderNoMip( ART_SAVE0 );
00199     trap_R_RegisterShaderNoMip( ART_SAVE1 );
00200     trap_R_RegisterShaderNoMip( ART_BACKGROUND );
00201 }

void UI_ServerInfoMenu void   ) 
 

Definition at line 185 of file ui_serverinfo.c.

Referenced by InGame_Event().

00186 {
00187     const char      *s;
00188     char            key[MAX_INFO_KEY];
00189     char            value[MAX_INFO_VALUE];
00190 
00191     // zero set all our globals
00192     memset( &s_serverinfo, 0 ,sizeof(serverinfo_t) );
00193 
00194     ServerInfo_Cache();
00195 
00196     s_serverinfo.menu.draw       = ServerInfo_MenuDraw;
00197     s_serverinfo.menu.key        = ServerInfo_MenuKey;
00198     s_serverinfo.menu.wrapAround = qtrue;
00199     s_serverinfo.menu.fullscreen = qtrue;
00200 
00201     s_serverinfo.banner.generic.type  = MTYPE_BTEXT;
00202     s_serverinfo.banner.generic.x     = 320;
00203     s_serverinfo.banner.generic.y     = 16;
00204     s_serverinfo.banner.string        = "SERVER INFO";
00205     s_serverinfo.banner.color         = color_white;
00206     s_serverinfo.banner.style         = UI_CENTER;
00207 
00208     s_serverinfo.framel.generic.type  = MTYPE_BITMAP;
00209     s_serverinfo.framel.generic.name  = SERVERINFO_FRAMEL;
00210     s_serverinfo.framel.generic.flags = QMF_INACTIVE;
00211     s_serverinfo.framel.generic.x     = 0;  
00212     s_serverinfo.framel.generic.y     = 78;
00213     s_serverinfo.framel.width         = 256;
00214     s_serverinfo.framel.height        = 329;
00215 
00216     s_serverinfo.framer.generic.type  = MTYPE_BITMAP;
00217     s_serverinfo.framer.generic.name  = SERVERINFO_FRAMER;
00218     s_serverinfo.framer.generic.flags = QMF_INACTIVE;
00219     s_serverinfo.framer.generic.x     = 376;
00220     s_serverinfo.framer.generic.y     = 76;
00221     s_serverinfo.framer.width         = 256;
00222     s_serverinfo.framer.height        = 334;
00223 
00224     s_serverinfo.add.generic.type     = MTYPE_PTEXT;
00225     s_serverinfo.add.generic.flags    = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00226     s_serverinfo.add.generic.callback = ServerInfo_Event;
00227     s_serverinfo.add.generic.id       = ID_ADD;
00228     s_serverinfo.add.generic.x        = 320;
00229     s_serverinfo.add.generic.y        = 371;
00230     s_serverinfo.add.string           = "ADD TO FAVORITES";
00231     s_serverinfo.add.style            = UI_CENTER|UI_SMALLFONT;
00232     s_serverinfo.add.color            = color_red;
00233     if( trap_Cvar_VariableValue( "sv_running" ) ) {
00234         s_serverinfo.add.generic.flags |= QMF_GRAYED;
00235     }
00236 
00237     s_serverinfo.back.generic.type     = MTYPE_BITMAP;
00238     s_serverinfo.back.generic.name     = SERVERINFO_BACK0;
00239     s_serverinfo.back.generic.flags    = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
00240     s_serverinfo.back.generic.callback = ServerInfo_Event;
00241     s_serverinfo.back.generic.id       = ID_BACK;
00242     s_serverinfo.back.generic.x        = 0;
00243     s_serverinfo.back.generic.y        = 480-64;
00244     s_serverinfo.back.width            = 128;
00245     s_serverinfo.back.height           = 64;
00246     s_serverinfo.back.focuspic         = SERVERINFO_BACK1;
00247 
00248     trap_GetConfigString( CS_SERVERINFO, s_serverinfo.info, MAX_INFO_STRING );
00249 
00250     s_serverinfo.numlines = 0;
00251     s = s_serverinfo.info;
00252     while ( s ) {
00253         Info_NextPair( &s, key, value );
00254         if ( !key[0] ) {
00255             break;
00256         }
00257         s_serverinfo.numlines++;
00258     }
00259 
00260     if (s_serverinfo.numlines > 16)
00261         s_serverinfo.numlines = 16;
00262 
00263     Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.banner );
00264     Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.framel );
00265     Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.framer );
00266     Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.add );
00267     Menu_AddItem( &s_serverinfo.menu, (void*) &s_serverinfo.back );
00268 
00269     UI_PushMenu( &s_serverinfo.menu );
00270 }

void UI_SetActiveMenu uiMenuCommand_t  menu  ) 
 

Definition at line 811 of file ui_atoms.c.

00811                                               {
00812     // this should be the ONLY way the menu system is brought up
00813     // enusure minumum menu data is cached
00814     Menu_Cache();
00815 
00816     switch ( menu ) {
00817     case UIMENU_NONE:
00818         UI_ForceMenuOff();
00819         return;
00820     case UIMENU_MAIN:
00821         UI_MainMenu();
00822         return;
00823     case UIMENU_NEED_CD:
00824         UI_ConfirmMenu( "Insert the CD", (voidfunc_f)NULL, NeedCDAction );
00825         return;
00826     case UIMENU_BAD_CD_KEY:
00827         UI_ConfirmMenu( "Bad CD Key", (voidfunc_f)NULL, NeedCDKeyAction );
00828         return;
00829     case UIMENU_INGAME:
00830         /*
00831         //GRank
00832         UI_RankingsMenu();
00833         return;
00834         */
00835         trap_Cvar_Set( "cl_paused", "1" );
00836         UI_InGameMenu();
00837         return;
00838         
00839     // bk001204
00840     case UIMENU_TEAM:
00841     case UIMENU_POSTGAME:
00842     default:
00843 #ifndef NDEBUG
00844       Com_Printf("UI_SetActiveMenu: bad enum %d\n", menu );
00845 #endif
00846       break;
00847     }
00848 }

void UI_SetBestScore int  level,
int  score
 

Definition at line 482 of file ui_gameinfo.c.

00482                                              {
00483     int     skill;
00484     int     oldScore;
00485     char    arenaKey[16];
00486     char    scores[MAX_INFO_VALUE];
00487 
00488     // validate score
00489     if( score < 1 || score > 8 ) {
00490         return;
00491     }
00492 
00493     // validate skill
00494     skill = (int)trap_Cvar_VariableValue( "g_spSkill" );
00495     if( skill < 1 || skill > 5 ) {
00496         return;
00497     }
00498 
00499     // get scores
00500     trap_Cvar_VariableStringBuffer( va( "g_spScores%i", skill ), scores, MAX_INFO_VALUE );
00501 
00502     // see if this is better
00503     Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
00504     oldScore = atoi( Info_ValueForKey( scores, arenaKey ) );
00505     if( oldScore && oldScore <= score ) {
00506         return;
00507     }
00508 
00509     // update scores
00510     Info_SetValueForKey( scores, arenaKey, va( "%i", score ) );
00511     trap_Cvar_Set( va( "g_spScores%i", skill ), scores );
00512 }

void UI_SetColor const float *  rgba  ) 
 

Definition at line 1182 of file ui_atoms.c.

01182                                       {
01183     trap_R_SetColor( rgba );
01184 }

void UI_SetupMenu void   ) 
 

Definition at line 324 of file ui_setup.c.

Referenced by InGame_Event(), Main_MenuEvent(), and Rankings_MenuEvent().

00324                           {
00325     UI_SetupMenu_Init();
00326     UI_PushMenu( &setupMenuInfo.menu );
00327 }

void UI_SetupMenu_Cache void   ) 
 

Definition at line 311 of file ui_setup.c.

Referenced by UI_Cache_f(), and UI_SetupMenu_Init().

00311                                 {
00312     trap_R_RegisterShaderNoMip( ART_BACK0 );
00313     trap_R_RegisterShaderNoMip( ART_BACK1 );
00314     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00315     trap_R_RegisterShaderNoMip( ART_FRAMER );
00316 }

qboolean UI_ShowTierVideo int  tier  ) 
 

Definition at line 603 of file ui_gameinfo.c.

00603                                       {
00604     char    key[16];
00605     char    videos[MAX_INFO_VALUE];
00606 
00607     if( tier <= 0 ) {
00608         return qfalse;
00609     }
00610 
00611     trap_Cvar_VariableStringBuffer( "g_spVideos", videos, sizeof(videos) );
00612 
00613     Com_sprintf( key, sizeof(key), "tier%i", tier );
00614     if( atoi( Info_ValueForKey( videos, key ) ) ) {
00615         return qfalse;
00616     }
00617 
00618     Info_SetValueForKey( videos, key, va( "%i", 1 ) );
00619     trap_Cvar_Set( "g_spVideos", videos );
00620 
00621     return qtrue;
00622 }

void UI_Shutdown void   ) 
 

Definition at line 1059 of file ui_atoms.c.

01059                          {
01060 }

void UI_SignupMenu void   ) 
 

Definition at line 281 of file ui_signup.c.

Referenced by Rankings_MenuEvent(), and RankStatus_MenuEvent().

00281                            {
00282     Signup_MenuInit();
00283     UI_PushMenu ( &s_signup.menu );
00284 }

void UI_SoundOptionsMenu void   ) 
 

Definition at line 312 of file ui_sound.c.

Referenced by GraphicsOptions_Event(), Options_Event(), UI_DisplayOptionsMenu_Event(), and UI_NetworkOptionsMenu_Event().

void UI_SoundOptionsMenu_Cache void   ) 
 

Definition at line 299 of file ui_sound.c.

Referenced by UI_Cache_f(), and UI_SoundOptionsMenu_Init().

00299                                        {
00300     trap_R_RegisterShaderNoMip( ART_FRAMEL );
00301     trap_R_RegisterShaderNoMip( ART_FRAMER );
00302     trap_R_RegisterShaderNoMip( ART_BACK0 );
00303     trap_R_RegisterShaderNoMip( ART_BACK1 );
00304 }

void UI_SPArena_Start const char *  arenaInfo  ) 
 

Definition at line 25 of file ui_sparena.c.

00025                                                {
00026     char    *map;
00027     int     level;
00028     int     n;
00029     char    *txt;
00030 
00031     n = (int)trap_Cvar_VariableValue( "sv_maxclients" );
00032     if ( n < 8 ) {
00033         trap_Cvar_SetValue( "sv_maxclients", 8 );
00034     }
00035 
00036     level = atoi( Info_ValueForKey( arenaInfo, "num" ) );
00037     txt = Info_ValueForKey( arenaInfo, "special" );
00038     if( txt[0] ) {
00039         if( Q_stricmp( txt, "training" ) == 0 ) {
00040             level = -4;
00041         }
00042         else if( Q_stricmp( txt, "final" ) == 0 ) {
00043             level = UI_GetNumSPTiers() * ARENAS_PER_TIER;
00044         }
00045     }
00046     trap_Cvar_SetValue( "ui_spSelection", level );
00047 
00048     map = Info_ValueForKey( arenaInfo, "map" );
00049     trap_Cmd_ExecuteText( EXEC_APPEND, va( "spmap %s\n", map ) );
00050 }

void UI_SpecifyLeagueMenu void   ) 
 

Definition at line 328 of file ui_specifyleague.c.

00329 {
00330     SpecifyLeague_MenuInit();
00331     UI_PushMenu( &s_specifyleague.menu );
00332 }

void UI_SpecifyServerMenu void   ) 
 

Definition at line 208 of file ui_specifyserver.c.

Referenced by ArenaServers_Event().

00209 {
00210     SpecifyServer_MenuInit();
00211     UI_PushMenu( &s_specifyserver.menu );
00212 }

void UI_SPLevelMenu void   ) 
 

Definition at line 938 of file ui_splevel.c.

Referenced by Main_MenuEvent(), Reset_MenuEvent(), UI_SPLevelMenu_f(), UI_SPLevelMenu_MenuDraw(), and UI_SPLevelMenu_ResetAction().

00938                             {
00939     int         level;
00940     int         trainingLevel;
00941     const char  *arenaInfo;
00942 
00943     trainingTier = -1;
00944     arenaInfo = UI_GetSpecialArenaInfo( "training" );
00945     if( arenaInfo ) {
00946         minTier = trainingTier;
00947         trainingLevel = atoi( Info_ValueForKey( arenaInfo, "num" ) );
00948     }
00949     else {
00950         minTier = 0;
00951         trainingLevel = -2;
00952     }
00953 
00954     finalTier = UI_GetNumSPTiers();
00955     arenaInfo = UI_GetSpecialArenaInfo( "final" );
00956     if( arenaInfo ) {
00957         maxTier = finalTier;
00958     }
00959     else {
00960         maxTier = finalTier - 1;
00961         if( maxTier < minTier ) {
00962             maxTier = minTier;
00963         }
00964     }
00965 
00966     level = UI_GetCurrentGame();
00967     if ( level == -1 ) {
00968         level = UI_GetNumSPArenas() - 1;
00969         if( maxTier == finalTier ) {
00970             level++;
00971         }
00972     }
00973 
00974     if( level == trainingLevel ) {
00975         currentSet = -1;
00976         currentGame = 0;
00977     }
00978     else {
00979         currentSet = level / ARENAS_PER_TIER;
00980         currentGame = level % ARENAS_PER_TIER;
00981     }
00982 
00983     UI_SPLevelMenu_Init();
00984     UI_PushMenu( &levelMenuInfo.menu );
00985     Menu_SetCursorToItem( &levelMenuInfo.menu, &levelMenuInfo.item_next );
00986 }

void UI_SPLevelMenu_Cache void   ) 
 

Definition at line 671 of file ui_splevel.c.

Referenced by UI_Cache_f(), and UI_SPLevelMenu_Init().

00671                                   {
00672     int             n;
00673 
00674     trap_R_RegisterShaderNoMip( ART_LEVELFRAME_FOCUS );
00675     trap_R_RegisterShaderNoMip( ART_LEVELFRAME_SELECTED );
00676     trap_R_RegisterShaderNoMip( ART_ARROW );
00677     trap_R_RegisterShaderNoMip( ART_ARROW_FOCUS );
00678     trap_R_RegisterShaderNoMip( ART_MAP_UNKNOWN );
00679     trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE1 );
00680     trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE2 );
00681     trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE3 );
00682     trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE4 );
00683     trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE5 );
00684     trap_R_RegisterShaderNoMip( ART_BACK0 );
00685     trap_R_RegisterShaderNoMip( ART_BACK1 );
00686     trap_R_RegisterShaderNoMip( ART_FIGHT0 );
00687     trap_R_RegisterShaderNoMip( ART_FIGHT1 );
00688     trap_R_RegisterShaderNoMip( ART_RESET0 );
00689     trap_R_RegisterShaderNoMip( ART_RESET1 );
00690     trap_R_RegisterShaderNoMip( ART_CUSTOM0 );
00691     trap_R_RegisterShaderNoMip( ART_CUSTOM1 );
00692 
00693     for( n = 0; n < 6; n++ ) {
00694         trap_R_RegisterShaderNoMip( ui_medalPicNames[n] );
00695         levelMenuInfo.awardSounds[n] = trap_S_RegisterSound( ui_medalSounds[n], qfalse );
00696     }
00697 
00698     levelMenuInfo.levelSelectedPic = trap_R_RegisterShaderNoMip( ART_LEVELFRAME_SELECTED );
00699     levelMenuInfo.levelFocusPic = trap_R_RegisterShaderNoMip( ART_LEVELFRAME_FOCUS );
00700     levelMenuInfo.levelCompletePic[0] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE1 );
00701     levelMenuInfo.levelCompletePic[1] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE2 );
00702     levelMenuInfo.levelCompletePic[2] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE3 );
00703     levelMenuInfo.levelCompletePic[3] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE4 );
00704     levelMenuInfo.levelCompletePic[4] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE5 );
00705 }

void UI_SPLevelMenu_f void   ) 
 

Definition at line 994 of file ui_splevel.c.

Referenced by UI_ConsoleCommand().

00994                               {
00995     trap_Key_SetCatcher( KEYCATCH_UI );
00996     uis.menusp = 0;
00997     UI_SPLevelMenu();
00998 }

void UI_SPLevelMenu_ReInit void   ) 
 

Definition at line 1006 of file ui_splevel.c.

Referenced by UI_SPUnlock_f().

01006                                    {
01007     levelMenuInfo.reinit = qtrue;
01008 }

void UI_SPPostgameMenu_Cache void   ) 
 

Definition at line 402 of file ui_sppostgame.c.

Referenced by UI_Cache_f(), and UI_SPPostgameMenu_Init().

00402                                      {
00403     int         n;
00404     qboolean    buildscript;
00405 
00406     buildscript = trap_Cvar_VariableValue("com_buildscript");
00407 
00408     trap_R_RegisterShaderNoMip( ART_MENU0 );
00409     trap_R_RegisterShaderNoMip( ART_MENU1 );
00410     trap_R_RegisterShaderNoMip( ART_REPLAY0 );
00411     trap_R_RegisterShaderNoMip( ART_REPLAY1 );
00412     trap_R_RegisterShaderNoMip( ART_NEXT0 );
00413     trap_R_RegisterShaderNoMip( ART_NEXT1 );
00414     for( n = 0; n < 6; n++ ) {
00415         trap_R_RegisterShaderNoMip( ui_medalPicNames[n] );
00416         trap_S_RegisterSound( ui_medalSounds[n], qfalse );
00417     }
00418 
00419     if( buildscript ) {
00420         trap_S_RegisterSound( "music/loss.wav", qfalse );
00421         trap_S_RegisterSound( "music/win.wav", qfalse );
00422         trap_S_RegisterSound( "sound/player/announce/youwin.wav", qfalse );
00423     }
00424 }

void UI_SPPostgameMenu_f void   ) 
 

Definition at line 503 of file ui_sppostgame.c.

Referenced by UI_ConsoleCommand().

00503                                  {
00504     int         playerGameRank;
00505     int         playerClientNum;
00506     int         n;
00507     int         oldFrags, newFrags;
00508     const char  *arena;
00509     int         awardValues[6];
00510     char        map[MAX_QPATH];
00511     char        info[MAX_INFO_STRING];
00512 
00513     memset( &postgameMenuInfo, 0, sizeof(postgameMenuInfo) );
00514 
00515     trap_GetConfigString( CS_SYSTEMINFO, info, sizeof(info) );
00516     postgameMenuInfo.serverId = atoi( Info_ValueForKey( info, "sv_serverid" ) );
00517 
00518     trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
00519     Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) );
00520     arena = UI_GetArenaInfoByMap( map );
00521     if ( !arena ) {
00522         return;
00523     }
00524     Q_strncpyz( arenainfo, arena, sizeof(arenainfo) );
00525 
00526     postgameMenuInfo.level = atoi( Info_ValueForKey( arenainfo, "num" ) );
00527 
00528     postgameMenuInfo.numClients = atoi( UI_Argv( 1 ) );
00529     playerClientNum = atoi( UI_Argv( 2 ) );
00530     playerGameRank = 8;     // in case they ended game as a spectator
00531 
00532     if( postgameMenuInfo.numClients > MAX_SCOREBOARD_CLIENTS ) {
00533         postgameMenuInfo.numClients = MAX_SCOREBOARD_CLIENTS;
00534     }
00535 
00536     for( n = 0; n < postgameMenuInfo.numClients; n++ ) {
00537         postgameMenuInfo.clientNums[n] = atoi( UI_Argv( 8 + n * 3 + 1 ) );
00538         postgameMenuInfo.ranks[n] = atoi( UI_Argv( 8 + n * 3 + 2 ) );
00539         postgameMenuInfo.scores[n] = atoi( UI_Argv( 8 + n * 3 + 3 ) );
00540 
00541         if( postgameMenuInfo.clientNums[n] == playerClientNum ) {
00542             playerGameRank = (postgameMenuInfo.ranks[n] & ~RANK_TIED_FLAG) + 1;
00543         }
00544     }
00545 
00546     UI_SetBestScore( postgameMenuInfo.level, playerGameRank );
00547 
00548     // process award stats and prepare presentation data
00549     awardValues[AWARD_ACCURACY] = atoi( UI_Argv( 3 ) );
00550     awardValues[AWARD_IMPRESSIVE] = atoi( UI_Argv( 4 ) );
00551     awardValues[AWARD_EXCELLENT] = atoi( UI_Argv( 5 ) );
00552     awardValues[AWARD_GAUNTLET] = atoi( UI_Argv( 6 ) );
00553     awardValues[AWARD_FRAGS] = atoi( UI_Argv( 7 ) );
00554     awardValues[AWARD_PERFECT] = atoi( UI_Argv( 8 ) );
00555 
00556     postgameMenuInfo.numAwards = 0;
00557 
00558     if( awardValues[AWARD_ACCURACY] >= 50 ) {
00559         UI_LogAwardData( AWARD_ACCURACY, 1 );
00560         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_ACCURACY;
00561         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_ACCURACY];
00562         postgameMenuInfo.numAwards++;
00563     }
00564 
00565     if( awardValues[AWARD_IMPRESSIVE] ) {
00566         UI_LogAwardData( AWARD_IMPRESSIVE, awardValues[AWARD_IMPRESSIVE] );
00567         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_IMPRESSIVE;
00568         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_IMPRESSIVE];
00569         postgameMenuInfo.numAwards++;
00570     }
00571 
00572     if( awardValues[AWARD_EXCELLENT] ) {
00573         UI_LogAwardData( AWARD_EXCELLENT, awardValues[AWARD_EXCELLENT] );
00574         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_EXCELLENT;
00575         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_EXCELLENT];
00576         postgameMenuInfo.numAwards++;
00577     }
00578 
00579     if( awardValues[AWARD_GAUNTLET] ) {
00580         UI_LogAwardData( AWARD_GAUNTLET, awardValues[AWARD_GAUNTLET] );
00581         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_GAUNTLET;
00582         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_GAUNTLET];
00583         postgameMenuInfo.numAwards++;
00584     }
00585 
00586     oldFrags = UI_GetAwardLevel( AWARD_FRAGS ) / 100;
00587     UI_LogAwardData( AWARD_FRAGS, awardValues[AWARD_FRAGS] );
00588     newFrags = UI_GetAwardLevel( AWARD_FRAGS ) / 100;
00589     if( newFrags > oldFrags ) {
00590         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_FRAGS;
00591         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = newFrags * 100;
00592         postgameMenuInfo.numAwards++;
00593     }
00594 
00595     if( awardValues[AWARD_PERFECT] ) {
00596         UI_LogAwardData( AWARD_PERFECT, 1 );
00597         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_PERFECT;
00598         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = 1;
00599         postgameMenuInfo.numAwards++;
00600     }
00601 
00602     if ( playerGameRank == 1 ) {
00603         postgameMenuInfo.won = UI_TierCompleted( postgameMenuInfo.level );
00604     }
00605     else {
00606         postgameMenuInfo.won = -1;
00607     }
00608 
00609     postgameMenuInfo.starttime = uis.realtime;
00610     postgameMenuInfo.scoreboardtime = uis.realtime;
00611 
00612     trap_Key_SetCatcher( KEYCATCH_UI );
00613     uis.menusp = 0;
00614 
00615     UI_SPPostgameMenu_Init();
00616     UI_PushMenu( &postgameMenuInfo.menu );
00617 
00618     if ( playerGameRank == 1 ) {
00619         Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_next );
00620     }
00621     else {
00622         Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_again );
00623     }
00624 
00625     Prepname( 0 );
00626     Prepname( 1 );
00627     Prepname( 2 );
00628 
00629     if ( playerGameRank != 1 ) {
00630         postgameMenuInfo.winnerSound = trap_S_RegisterSound( va( "sound/player/announce/%s_wins.wav", postgameMenuInfo.placeNames[0] ), qfalse );
00631         trap_Cmd_ExecuteText( EXEC_APPEND, "music music/loss\n" );
00632     }
00633     else {
00634         postgameMenuInfo.winnerSound = trap_S_RegisterSound( "sound/player/announce/youwin.wav", qfalse );
00635         trap_Cmd_ExecuteText( EXEC_APPEND, "music music/win\n" );
00636     }
00637 
00638     postgameMenuInfo.phase = 1;
00639 
00640     postgameMenuInfo.lastTier = UI_GetNumSPTiers();
00641     if ( UI_GetSpecialArenaInfo( "final" ) ) {
00642         postgameMenuInfo.lastTier++;
00643     }
00644 }

void UI_SPSkillMenu const char *  arenaInfo  ) 
 

Definition at line 324 of file ui_spskill.c.

void UI_SPSkillMenu_Cache void   ) 
 

Definition at line 178 of file ui_spskill.c.

Referenced by UI_Cache_f(), and UI_SPSkillMenu_Init().

00178                                   {
00179     trap_R_RegisterShaderNoMip( ART_FRAME );
00180     trap_R_RegisterShaderNoMip( ART_BACK );
00181     trap_R_RegisterShaderNoMip( ART_BACK_FOCUS );
00182     trap_R_RegisterShaderNoMip( ART_FIGHT );
00183     trap_R_RegisterShaderNoMip( ART_FIGHT_FOCUS );
00184     skillMenuInfo.skillpics[0] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE1 );
00185     skillMenuInfo.skillpics[1] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE2 );
00186     skillMenuInfo.skillpics[2] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE3 );
00187     skillMenuInfo.skillpics[3] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE4 );
00188     skillMenuInfo.skillpics[4] = trap_R_RegisterShaderNoMip( ART_MAP_COMPLETE5 );
00189 
00190     skillMenuInfo.nightmareSound = trap_S_RegisterSound( "sound/misc/nightmare.wav", qfalse );
00191     skillMenuInfo.silenceSound = trap_S_RegisterSound( "sound/misc/silence.wav", qfalse );
00192 }

void UI_SPUnlock_f void   ) 
 

Definition at line 753 of file ui_gameinfo.c.

00753                            {
00754     char    arenaKey[16];
00755     char    scores[MAX_INFO_VALUE];
00756     int     level;
00757     int     tier;
00758 
00759     // get scores for skill 1
00760     trap_Cvar_VariableStringBuffer( "g_spScores1", scores, MAX_INFO_VALUE );
00761 
00762     // update scores
00763     for( level = 0; level < ui_numSinglePlayerArenas + ui_numSpecialSinglePlayerArenas; level++ ) {
00764         Com_sprintf( arenaKey, sizeof( arenaKey ), "l%i", level );
00765         Info_SetValueForKey( scores, arenaKey, "1" );
00766     }
00767     trap_Cvar_Set( "g_spScores1", scores );
00768 
00769     // unlock cinematics
00770     for( tier = 1; tier <= 8; tier++ ) {
00771         UI_ShowTierVideo( tier );
00772     }
00773 
00774     trap_Print( "All levels unlocked at skill level 1\n" );
00775 
00776     UI_SPLevelMenu_ReInit();
00777 }

void UI_SPUnlockMedals_f void   ) 
 

Definition at line 785 of file ui_gameinfo.c.

00785                                  {
00786     int     n;
00787     char    key[16];
00788     char    awardData[MAX_INFO_VALUE];
00789 
00790     trap_Cvar_VariableStringBuffer( "g_spAwards", awardData, MAX_INFO_VALUE );
00791 
00792     for( n = 0; n < 6; n++ ) {
00793         Com_sprintf( key, sizeof(key), "a%i", n );
00794         Info_SetValueForKey( awardData, key, "100" );
00795     }
00796 
00797     trap_Cvar_Set( "g_spAwards", awardData );
00798 
00799     trap_Print( "All levels unlocked at 100\n" );
00800 }

void UI_StartDemoLoop void   ) 
 

Definition at line 77 of file ui_atoms.c.

00077                               {
00078     trap_Cmd_ExecuteText( EXEC_APPEND, "d1\n" );
00079 }

void UI_StartServerMenu qboolean  multiplayer  ) 
 

Definition at line 599 of file ui_startserver.c.

00599                                                 {
00600     StartServer_MenuInit();
00601     s_startserver.multiplayer = multiplayer;
00602     UI_PushMenu( &s_startserver.menu );
00603 }

void UI_TeamMainMenu void   ) 
 

Definition at line 207 of file ui_team.c.

Referenced by InGame_Event().

00207                              {
00208     TeamMain_MenuInit();
00209     UI_PushMenu ( &s_teammain.menu );
00210 }

void UI_TeamOrdersMenu void   ) 
 

Definition at line 417 of file ui_teamorders.c.

Referenced by InGame_Event(), and UI_TeamOrdersMenu_f().

00417                                {
00418     UI_TeamOrdersMenu_Init();
00419     UI_PushMenu( &teamOrdersMenuInfo.menu );
00420 }

void UI_TeamOrdersMenu_Cache void   ) 
 

Definition at line 405 of file ui_teamorders.c.

Referenced by UI_TeamOrdersMenu_Init().

00405                                      {
00406     trap_R_RegisterShaderNoMip( ART_FRAME );
00407     trap_R_RegisterShaderNoMip( ART_BACK0 );
00408     trap_R_RegisterShaderNoMip( ART_BACK1 );
00409 }

void UI_TeamOrdersMenu_f void   ) 
 

Definition at line 428 of file ui_teamorders.c.

Referenced by UI_ConsoleCommand().

00428                                  {
00429     uiClientState_t cs;
00430     char    info[MAX_INFO_STRING];
00431     int     team;
00432 
00433     // make sure it's a team game
00434     trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
00435     teamOrdersMenuInfo.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) );
00436     if( teamOrdersMenuInfo.gametype < GT_TEAM ) {
00437         return;
00438     }
00439 
00440     // not available to spectators
00441     trap_GetClientState( &cs );
00442     trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING );
00443     team = atoi( Info_ValueForKey( info, "t" ) );
00444     if( team == TEAM_SPECTATOR ) {
00445         return;
00446     }
00447 
00448     UI_TeamOrdersMenu();
00449 }

int UI_TierCompleted int  levelWon  ) 
 

Definition at line 565 of file ui_gameinfo.c.

00565                                      {
00566     int         level;
00567     int         n;
00568     int         tier;
00569     int         score;
00570     int         skill;
00571     const char  *info;
00572 
00573     tier = levelWon / ARENAS_PER_TIER;
00574     level = tier * ARENAS_PER_TIER;
00575 
00576     if( tier == UI_GetNumSPTiers() ) {
00577         info = UI_GetSpecialArenaInfo( "training" );
00578         if( levelWon == atoi( Info_ValueForKey( info, "num" ) ) ) {
00579             return 0;
00580         }
00581         info = UI_GetSpecialArenaInfo( "final" );
00582         if( !info || levelWon == atoi( Info_ValueForKey( info, "num" ) ) ) {
00583             return tier + 1;
00584         }
00585         return -1;
00586     }
00587 
00588     for( n = 0; n < ARENAS_PER_TIER; n++, level++ ) {
00589         UI_GetBestScore( level, &score, &skill );
00590         if ( score != 1 ) {
00591             return -1;
00592         }
00593     }
00594     return tier + 1;
00595 }

void UI_UpdateCvars void   ) 
 

Definition at line 242 of file ui_main.c.

Referenced by _UI_Refresh(), and UI_Refresh().

00242                             {
00243     int         i;
00244     cvarTable_t *cv;
00245 
00246     for ( i = 0, cv = cvarTable ; i < cvarTableSize ; i++, cv++ ) {
00247         trap_Cvar_Update( cv->vmCvar );
00248     }
00249 }

void UI_UpdateScreen void   ) 
 

Definition at line 1186 of file ui_atoms.c.

01186                              {
01187     trap_UpdateScreen();
01188 }


Variable Documentation

vec4_t color_black
 

Definition at line 43 of file ui_qmenu.c.

Referenced by UI_SPLevelMenu_MenuDraw().

vec4_t color_blue
 

Definition at line 46 of file ui_qmenu.c.

vec4_t color_dim
 

Definition at line 50 of file ui_qmenu.c.

vec4_t color_orange
 

Definition at line 48 of file ui_qmenu.c.

Referenced by ServerOptions_LevelshotDraw(), StartServer_LevelshotDraw(), UI_SaveConfigMenu_SavenameDraw(), and UI_SPLevelMenu_MenuDraw().

vec4_t color_red
 

Definition at line 49 of file ui_qmenu.c.

Referenced by ConfirmMenu_Draw(), DriverInfo_MenuDraw(), MessageMenu_Draw(), PlayerModel_DrawPlayer(), Reset_MenuDraw(), ServerInfo_MenuDraw(), UI_CDKeyMenu_DrawKey(), UI_CreditMenu_Draw(), UI_SPLevelMenu_MenuDraw(), and UI_SPSkillMenu_SkillEvent().

vec4_t color_white
 

Definition at line 44 of file ui_qmenu.c.

Referenced by PlayerSettings_DrawName(), Rankings_DrawText(), UI_AddBotsMenu_Draw(), UI_CDKeyMenu_DrawKey(), UI_CreditMenu_Draw(), UI_DisplayDownloadInfo(), UI_DrawConnectScreen(), UI_SPLevelMenu_MenuDraw(), UI_SPPostgameMenu_MenuDraw(), UI_SPPostgameMenu_MenuDrawScoreLine(), UI_SPSkillMenu_Init(), and UI_SPSkillMenu_SkillEvent().

vec4_t color_yellow
 

Definition at line 45 of file ui_qmenu.c.

Referenced by Controls_ResetDefaults_Draw(), Reset_MenuDraw(), Setup_ResetDefaults_Draw(), UI_CDKeyMenu_DrawKey(), UI_SPLevelMenu_MenuDraw(), UI_SPLevelMenu_ResetDraw(), and UI_SPPostgameMenu_DrawAwardsMedals().

vec4_t list_color
 

vec4_t listbar_color
 

Definition at line 57 of file ui_qmenu.c.

Referenced by Controls_DrawKeyBinding(), Crosshair_Draw(), MenuField_Draw(), PlayerName_Draw(), RadioButton_Draw(), ScrollList_Draw(), SpinControl_Draw(), and UI_CDKeyMenu_DrawKey().

qboolean m_entersound
 

Definition at line 31 of file ui_atoms.c.

vec4_t menu_black_color
 

sfxHandle_t menu_buzz_sound
 

Definition at line 33 of file ui_qmenu.c.

Referenced by Menu_Cache().

vec4_t menu_dark_color
 

vec4_t menu_dim_color
 

Definition at line 42 of file ui_qmenu.c.

vec4_t menu_grayed_color
 

vec4_t menu_highlight_color
 

sfxHandle_t menu_in_sound
 

Definition at line 30 of file ui_qmenu.c.

Referenced by Menu_Cache(), and UI_Refresh().

sfxHandle_t menu_move_sound
 

Definition at line 31 of file ui_qmenu.c.

Referenced by Menu_Cache(), and UI_MouseEvent().

sfxHandle_t menu_null_sound
 

Definition at line 34 of file ui_qmenu.c.

Referenced by Menu_Cache().

sfxHandle_t menu_out_sound
 

Definition at line 32 of file ui_qmenu.c.

Referenced by Menu_Cache(), and UI_PopMenu().

vec4_t menu_red_color
 

vec4_t menu_text_color
 

Definition at line 41 of file ui_qmenu.c.

Referenced by Main_MenuDraw(), and UI_DrawConnectScreen().

vec4_t name_color
 

vec4_t text_color_disabled
 

Definition at line 54 of file ui_qmenu.c.

Referenced by Controls_DrawKeyBinding().

vec4_t text_color_highlight
 

Definition at line 56 of file ui_qmenu.c.

Referenced by Controls_DrawKeyBinding().

vec4_t text_color_normal
 

Definition at line 55 of file ui_qmenu.c.

Referenced by DriverInfo_MenuDraw(), PlayerSettings_DrawName(), and ServerInfo_MenuDraw().

vmCvar_t ui_arenasFile
 

Definition at line 116 of file ui_main.c.

vmCvar_t ui_botsFile
 

Definition at line 117 of file ui_main.c.

vmCvar_t ui_brassTime
 

Definition at line 135 of file ui_main.c.

vmCvar_t ui_browserGameType
 

Definition at line 130 of file ui_main.c.

Referenced by ArenaServers_MenuInit().

vmCvar_t ui_browserMaster
 

Definition at line 129 of file ui_main.c.

Referenced by ArenaServers_MenuInit().

vmCvar_t ui_browserShowEmpty
 

Definition at line 133 of file ui_main.c.

Referenced by ArenaServers_MenuInit(), and UI_BuildServerDisplayList().

vmCvar_t ui_browserShowFull
 

Definition at line 132 of file ui_main.c.

Referenced by ArenaServers_MenuInit(), and UI_BuildServerDisplayList().

vmCvar_t ui_browserSortKey
 

Definition at line 131 of file ui_main.c.

Referenced by ArenaServers_MenuInit().

vmCvar_t ui_cdkey
 

vmCvar_t ui_cdkeychecked
 

Definition at line 157 of file ui_main.c.

Referenced by UI_MainMenu().

vmCvar_t ui_ctf_capturelimit
 

Definition at line 112 of file ui_main.c.

vmCvar_t ui_ctf_friendly
 

Definition at line 114 of file ui_main.c.

vmCvar_t ui_ctf_timelimit
 

Definition at line 113 of file ui_main.c.

vmCvar_t ui_drawCrosshair
 

Definition at line 136 of file ui_main.c.

vmCvar_t ui_drawCrosshairNames
 

Definition at line 137 of file ui_main.c.

vmCvar_t ui_ffa_fraglimit
 

Definition at line 102 of file ui_main.c.

vmCvar_t ui_ffa_timelimit
 

Definition at line 103 of file ui_main.c.

vmCvar_t ui_marks
 

Definition at line 138 of file ui_main.c.

char* ui_medalNames[]
 

Definition at line 80 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_DrawAwardsPresentation().

char* ui_medalPicNames[]
 

Definition at line 81 of file ui_sppostgame.c.

Referenced by UI_SPLevelMenu_Cache(), UI_SPLevelMenu_Init(), UI_SPPostgameMenu_Cache(), and UI_SPPostgameMenu_DrawAwardsMedals().

char* ui_medalSounds[]
 

Definition at line 89 of file ui_sppostgame.c.

Referenced by UI_SPLevelMenu_Cache(), UI_SPPostgameMenu_Cache(), and UI_SPPostgameMenu_DrawAwardsPresentation().

vmCvar_t ui_server1
 

Definition at line 140 of file ui_main.c.

vmCvar_t ui_server10
 

Definition at line 149 of file ui_main.c.

vmCvar_t ui_server11
 

Definition at line 150 of file ui_main.c.

vmCvar_t ui_server12
 

Definition at line 151 of file ui_main.c.

vmCvar_t ui_server13
 

Definition at line 152 of file ui_main.c.

vmCvar_t ui_server14
 

Definition at line 153 of file ui_main.c.

vmCvar_t ui_server15
 

Definition at line 154 of file ui_main.c.

vmCvar_t ui_server16
 

Definition at line 155 of file ui_main.c.

vmCvar_t ui_server2
 

Definition at line 141 of file ui_main.c.

vmCvar_t ui_server3
 

Definition at line 142 of file ui_main.c.

vmCvar_t ui_server4
 

Definition at line 143 of file ui_main.c.

vmCvar_t ui_server5
 

Definition at line 144 of file ui_main.c.

vmCvar_t ui_server6
 

Definition at line 145 of file ui_main.c.

vmCvar_t ui_server7
 

Definition at line 146 of file ui_main.c.

vmCvar_t ui_server8
 

Definition at line 147 of file ui_main.c.

vmCvar_t ui_server9
 

Definition at line 148 of file ui_main.c.

vmCvar_t ui_spAwards
 

Definition at line 123 of file ui_main.c.

vmCvar_t ui_spScores1
 

Definition at line 118 of file ui_main.c.

vmCvar_t ui_spScores2
 

Definition at line 119 of file ui_main.c.

vmCvar_t ui_spScores3
 

Definition at line 120 of file ui_main.c.

vmCvar_t ui_spScores4
 

Definition at line 121 of file ui_main.c.

vmCvar_t ui_spScores5
 

Definition at line 122 of file ui_main.c.

vmCvar_t ui_spSelection
 

Definition at line 127 of file ui_main.c.

vmCvar_t ui_spSkill
 

Definition at line 125 of file ui_main.c.

vmCvar_t ui_spVideos
 

Definition at line 124 of file ui_main.c.

vmCvar_t ui_team_fraglimit
 

Definition at line 108 of file ui_main.c.

vmCvar_t ui_team_friendly
 

Definition at line 110 of file ui_main.c.

vmCvar_t ui_team_timelimit
 

Definition at line 109 of file ui_main.c.

vmCvar_t ui_tourney_fraglimit
 

Definition at line 105 of file ui_main.c.

vmCvar_t ui_tourney_timelimit
 

Definition at line 106 of file ui_main.c.

uiStatic_t uis
 

Definition at line 30 of file ui_atoms.c.

sfxHandle_t weaponChangeSound
 

Definition at line 35 of file ui_qmenu.c.

Referenced by Menu_Cache(), and UI_DrawPlayer().


Generated on Thu Aug 25 14:29:13 2005 for Quake III Arena by  doxygen 1.3.9.1