Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

ui_local.h (21739B)


      1 /*
      2 ===========================================================================
      3 Copyright (C) 1999-2005 Id Software, Inc.
      4 
      5 This file is part of Quake III Arena source code.
      6 
      7 Quake III Arena source code is free software; you can redistribute it
      8 and/or modify it under the terms of the GNU General Public License as
      9 published by the Free Software Foundation; either version 2 of the License,
     10 or (at your option) any later version.
     11 
     12 Quake III Arena source code is distributed in the hope that it will be
     13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 GNU General Public License for more details.
     16 
     17 You should have received a copy of the GNU General Public License
     18 along with Foobar; if not, write to the Free Software
     19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     20 ===========================================================================
     21 */
     22 //
     23 #ifndef __UI_LOCAL_H__
     24 #define __UI_LOCAL_H__
     25 
     26 #include "../game/q_shared.h"
     27 #include "../cgame/tr_types.h"
     28 //NOTE: include the ui_public.h from the new UI
     29 #include "../ui/ui_public.h" // bk001205 - yes, do have to use this
     30 //redefine to old API version
     31 #undef UI_API_VERSION
     32 #define UI_API_VERSION	4
     33 #include "keycodes.h"
     34 #include "../game/bg_public.h"
     35 
     36 typedef void (*voidfunc_f)(void);
     37 
     38 extern vmCvar_t	ui_ffa_fraglimit;
     39 extern vmCvar_t	ui_ffa_timelimit;
     40 
     41 extern vmCvar_t	ui_tourney_fraglimit;
     42 extern vmCvar_t	ui_tourney_timelimit;
     43 
     44 extern vmCvar_t	ui_team_fraglimit;
     45 extern vmCvar_t	ui_team_timelimit;
     46 extern vmCvar_t	ui_team_friendly;
     47 
     48 extern vmCvar_t	ui_ctf_capturelimit;
     49 extern vmCvar_t	ui_ctf_timelimit;
     50 extern vmCvar_t	ui_ctf_friendly;
     51 
     52 extern vmCvar_t	ui_arenasFile;
     53 extern vmCvar_t	ui_botsFile;
     54 extern vmCvar_t	ui_spScores1;
     55 extern vmCvar_t	ui_spScores2;
     56 extern vmCvar_t	ui_spScores3;
     57 extern vmCvar_t	ui_spScores4;
     58 extern vmCvar_t	ui_spScores5;
     59 extern vmCvar_t	ui_spAwards;
     60 extern vmCvar_t	ui_spVideos;
     61 extern vmCvar_t	ui_spSkill;
     62 
     63 extern vmCvar_t	ui_spSelection;
     64 
     65 extern vmCvar_t	ui_browserMaster;
     66 extern vmCvar_t	ui_browserGameType;
     67 extern vmCvar_t	ui_browserSortKey;
     68 extern vmCvar_t	ui_browserShowFull;
     69 extern vmCvar_t	ui_browserShowEmpty;
     70 
     71 extern vmCvar_t	ui_brassTime;
     72 extern vmCvar_t	ui_drawCrosshair;
     73 extern vmCvar_t	ui_drawCrosshairNames;
     74 extern vmCvar_t	ui_marks;
     75 
     76 extern vmCvar_t	ui_server1;
     77 extern vmCvar_t	ui_server2;
     78 extern vmCvar_t	ui_server3;
     79 extern vmCvar_t	ui_server4;
     80 extern vmCvar_t	ui_server5;
     81 extern vmCvar_t	ui_server6;
     82 extern vmCvar_t	ui_server7;
     83 extern vmCvar_t	ui_server8;
     84 extern vmCvar_t	ui_server9;
     85 extern vmCvar_t	ui_server10;
     86 extern vmCvar_t	ui_server11;
     87 extern vmCvar_t	ui_server12;
     88 extern vmCvar_t	ui_server13;
     89 extern vmCvar_t	ui_server14;
     90 extern vmCvar_t	ui_server15;
     91 extern vmCvar_t	ui_server16;
     92 
     93 extern vmCvar_t	ui_cdkey;
     94 extern vmCvar_t	ui_cdkeychecked;
     95 
     96 
     97 //
     98 // ui_qmenu.c
     99 //
    100 
    101 #define RCOLUMN_OFFSET			( BIGCHAR_WIDTH )
    102 #define LCOLUMN_OFFSET			(-BIGCHAR_WIDTH )
    103 
    104 #define SLIDER_RANGE			10
    105 #define	MAX_EDIT_LINE			256
    106 
    107 #define MAX_MENUDEPTH			8
    108 #define MAX_MENUITEMS			64
    109 
    110 #define MTYPE_NULL				0
    111 #define MTYPE_SLIDER			1	
    112 #define MTYPE_ACTION			2
    113 #define MTYPE_SPINCONTROL		3
    114 #define MTYPE_FIELD				4
    115 #define MTYPE_RADIOBUTTON		5
    116 #define MTYPE_BITMAP			6	
    117 #define MTYPE_TEXT				7
    118 #define MTYPE_SCROLLLIST		8
    119 #define MTYPE_PTEXT				9
    120 #define MTYPE_BTEXT				10
    121 
    122 #define QMF_BLINK				0x00000001
    123 #define QMF_SMALLFONT			0x00000002
    124 #define QMF_LEFT_JUSTIFY		0x00000004
    125 #define QMF_CENTER_JUSTIFY		0x00000008
    126 #define QMF_RIGHT_JUSTIFY		0x00000010
    127 #define QMF_NUMBERSONLY			0x00000020	// edit field is only numbers
    128 #define QMF_HIGHLIGHT			0x00000040
    129 #define QMF_HIGHLIGHT_IF_FOCUS	0x00000080	// steady focus
    130 #define QMF_PULSEIFFOCUS		0x00000100	// pulse if focus
    131 #define QMF_HASMOUSEFOCUS		0x00000200
    132 #define QMF_NOONOFFTEXT			0x00000400
    133 #define QMF_MOUSEONLY			0x00000800	// only mouse input allowed
    134 #define QMF_HIDDEN				0x00001000	// skips drawing
    135 #define QMF_GRAYED				0x00002000	// grays and disables
    136 #define QMF_INACTIVE			0x00004000	// disables any input
    137 #define QMF_NODEFAULTINIT		0x00008000	// skip default initialization
    138 #define QMF_OWNERDRAW			0x00010000
    139 #define QMF_PULSE				0x00020000
    140 #define QMF_LOWERCASE			0x00040000	// edit field is all lower case
    141 #define QMF_UPPERCASE			0x00080000	// edit field is all upper case
    142 #define QMF_SILENT				0x00100000
    143 
    144 // callback notifications
    145 #define QM_GOTFOCUS				1
    146 #define QM_LOSTFOCUS			2
    147 #define QM_ACTIVATED			3
    148 
    149 typedef struct _tag_menuframework
    150 {
    151 	int	cursor;
    152 	int cursor_prev;
    153 
    154 	int	nitems;
    155 	void *items[MAX_MENUITEMS];
    156 
    157 	void (*draw) (void);
    158 	sfxHandle_t (*key) (int key);
    159 
    160 	qboolean	wrapAround;
    161 	qboolean	fullscreen;
    162 	qboolean	showlogo;
    163 } menuframework_s;
    164 
    165 typedef struct
    166 {
    167 	int type;
    168 	const char *name;
    169 	int	id;
    170 	int x, y;
    171 	int left;
    172 	int	top;
    173 	int	right;
    174 	int	bottom;
    175 	menuframework_s *parent;
    176 	int menuPosition;
    177 	unsigned flags;
    178 
    179 	void (*callback)( void *self, int event );
    180 	void (*statusbar)( void *self );
    181 	void (*ownerdraw)( void *self );
    182 } menucommon_s;
    183 
    184 typedef struct {
    185 	int		cursor;
    186 	int		scroll;
    187 	int		widthInChars;
    188 	char	buffer[MAX_EDIT_LINE];
    189 	int		maxchars;
    190 } mfield_t;
    191 
    192 typedef struct
    193 {
    194 	menucommon_s	generic;
    195 	mfield_t		field;
    196 } menufield_s;
    197 
    198 typedef struct 
    199 {
    200 	menucommon_s generic;
    201 
    202 	float minvalue;
    203 	float maxvalue;
    204 	float curvalue;
    205 
    206 	float range;
    207 } menuslider_s;
    208 
    209 typedef struct
    210 {
    211 	menucommon_s generic;
    212 
    213 	int	oldvalue;
    214 	int curvalue;
    215 	int	numitems;
    216 	int	top;
    217 		
    218 	const char **itemnames;
    219 
    220 	int width;
    221 	int height;
    222 	int	columns;
    223 	int	seperation;
    224 } menulist_s;
    225 
    226 typedef struct
    227 {
    228 	menucommon_s generic;
    229 } menuaction_s;
    230 
    231 typedef struct
    232 {
    233 	menucommon_s generic;
    234 	int curvalue;
    235 } menuradiobutton_s;
    236 
    237 typedef struct
    238 {
    239 	menucommon_s	generic;
    240 	char*			focuspic;	
    241 	char*			errorpic;
    242 	qhandle_t		shader;
    243 	qhandle_t		focusshader;
    244 	int				width;
    245 	int				height;
    246 	float*			focuscolor;
    247 } menubitmap_s;
    248 
    249 typedef struct
    250 {
    251 	menucommon_s	generic;
    252 	char*			string;
    253 	int				style;
    254 	float*			color;
    255 } menutext_s;
    256 
    257 extern void			Menu_Cache( void );
    258 extern void			Menu_Focus( menucommon_s *m );
    259 extern void			Menu_AddItem( menuframework_s *menu, void *item );
    260 extern void			Menu_AdjustCursor( menuframework_s *menu, int dir );
    261 extern void			Menu_Draw( menuframework_s *menu );
    262 extern void			*Menu_ItemAtCursor( menuframework_s *m );
    263 extern sfxHandle_t	Menu_ActivateItem( menuframework_s *s, menucommon_s* item );
    264 extern void			Menu_SetCursor( menuframework_s *s, int cursor );
    265 extern void			Menu_SetCursorToItem( menuframework_s *m, void* ptr );
    266 extern sfxHandle_t	Menu_DefaultKey( menuframework_s *s, int key );
    267 extern void			Bitmap_Init( menubitmap_s *b );
    268 extern void			Bitmap_Draw( menubitmap_s *b );
    269 extern void			ScrollList_Draw( menulist_s *l );
    270 extern sfxHandle_t	ScrollList_Key( menulist_s *l, int key );
    271 extern sfxHandle_t	menu_in_sound;
    272 extern sfxHandle_t	menu_move_sound;
    273 extern sfxHandle_t	menu_out_sound;
    274 extern sfxHandle_t	menu_buzz_sound;
    275 extern sfxHandle_t	menu_null_sound;
    276 extern sfxHandle_t	weaponChangeSound;
    277 extern vec4_t		menu_text_color;
    278 extern vec4_t		menu_grayed_color;
    279 extern vec4_t		menu_dark_color;
    280 extern vec4_t		menu_highlight_color;
    281 extern vec4_t		menu_red_color;
    282 extern vec4_t		menu_black_color;
    283 extern vec4_t		menu_dim_color;
    284 extern vec4_t		color_black;
    285 extern vec4_t		color_white;
    286 extern vec4_t		color_yellow;
    287 extern vec4_t		color_blue;
    288 extern vec4_t		color_orange;
    289 extern vec4_t		color_red;
    290 extern vec4_t		color_dim;
    291 extern vec4_t		name_color;
    292 extern vec4_t		list_color;
    293 extern vec4_t		listbar_color;
    294 extern vec4_t		text_color_disabled; 
    295 extern vec4_t		text_color_normal;
    296 extern vec4_t		text_color_highlight;
    297 
    298 extern char	*ui_medalNames[];
    299 extern char	*ui_medalPicNames[];
    300 extern char	*ui_medalSounds[];
    301 
    302 //
    303 // ui_mfield.c
    304 //
    305 extern void			MField_Clear( mfield_t *edit );
    306 extern void			MField_KeyDownEvent( mfield_t *edit, int key );
    307 extern void			MField_CharEvent( mfield_t *edit, int ch );
    308 extern void			MField_Draw( mfield_t *edit, int x, int y, int style, vec4_t color );
    309 extern void			MenuField_Init( menufield_s* m );
    310 extern void			MenuField_Draw( menufield_s *f );
    311 extern sfxHandle_t	MenuField_Key( menufield_s* m, int* key );
    312 
    313 //
    314 // ui_menu.c
    315 //
    316 extern void MainMenu_Cache( void );
    317 extern void UI_MainMenu(void);
    318 extern void UI_RegisterCvars( void );
    319 extern void UI_UpdateCvars( void );
    320 
    321 //
    322 // ui_credits.c
    323 //
    324 extern void UI_CreditMenu( void );
    325 
    326 //
    327 // ui_ingame.c
    328 //
    329 extern void InGame_Cache( void );
    330 extern void UI_InGameMenu(void);
    331 
    332 //
    333 // ui_confirm.c
    334 //
    335 extern void ConfirmMenu_Cache( void );
    336 extern void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)( qboolean result ) );
    337 extern void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void ), void (*action)( qboolean result ) );
    338 extern void UI_Message( const char **lines );
    339 
    340 //
    341 // ui_setup.c
    342 //
    343 extern void UI_SetupMenu_Cache( void );
    344 extern void UI_SetupMenu(void);
    345 
    346 //
    347 // ui_team.c
    348 //
    349 extern void UI_TeamMainMenu( void );
    350 extern void TeamMain_Cache( void );
    351 
    352 //
    353 // ui_connect.c
    354 //
    355 extern void UI_DrawConnectScreen( qboolean overlay );
    356 
    357 //
    358 // ui_controls2.c
    359 //
    360 extern void UI_ControlsMenu( void );
    361 extern void Controls_Cache( void );
    362 
    363 //
    364 // ui_demo2.c
    365 //
    366 extern void UI_DemosMenu( void );
    367 extern void Demos_Cache( void );
    368 
    369 //
    370 // ui_cinematics.c
    371 //
    372 extern void UI_CinematicsMenu( void );
    373 extern void UI_CinematicsMenu_f( void );
    374 extern void UI_CinematicsMenu_Cache( void );
    375 
    376 //
    377 // ui_mods.c
    378 //
    379 extern void UI_ModsMenu( void );
    380 extern void UI_ModsMenu_Cache( void );
    381 
    382 //
    383 // ui_cdkey.c
    384 //
    385 extern void UI_CDKeyMenu( void );
    386 extern void UI_CDKeyMenu_Cache( void );
    387 extern void UI_CDKeyMenu_f( void );
    388 
    389 //
    390 // ui_playermodel.c
    391 //
    392 extern void UI_PlayerModelMenu( void );
    393 extern void PlayerModel_Cache( void );
    394 
    395 //
    396 // ui_playersettings.c
    397 //
    398 extern void UI_PlayerSettingsMenu( void );
    399 extern void PlayerSettings_Cache( void );
    400 
    401 //
    402 // ui_preferences.c
    403 //
    404 extern void UI_PreferencesMenu( void );
    405 extern void Preferences_Cache( void );
    406 
    407 //
    408 // ui_specifyleague.c
    409 //
    410 extern void UI_SpecifyLeagueMenu( void );
    411 extern void SpecifyLeague_Cache( void );
    412 
    413 //
    414 // ui_specifyserver.c
    415 //
    416 extern void UI_SpecifyServerMenu( void );
    417 extern void SpecifyServer_Cache( void );
    418 
    419 //
    420 // ui_servers2.c
    421 //
    422 #define MAX_FAVORITESERVERS 16
    423 
    424 extern void UI_ArenaServersMenu( void );
    425 extern void ArenaServers_Cache( void );
    426 
    427 //
    428 // ui_startserver.c
    429 //
    430 extern void UI_StartServerMenu( qboolean multiplayer );
    431 extern void StartServer_Cache( void );
    432 extern void ServerOptions_Cache( void );
    433 extern void UI_BotSelectMenu( char *bot );
    434 extern void UI_BotSelectMenu_Cache( void );
    435 
    436 //
    437 // ui_serverinfo.c
    438 //
    439 extern void UI_ServerInfoMenu( void );
    440 extern void ServerInfo_Cache( void );
    441 
    442 //
    443 // ui_video.c
    444 //
    445 extern void UI_GraphicsOptionsMenu( void );
    446 extern void GraphicsOptions_Cache( void );
    447 extern void DriverInfo_Cache( void );
    448 
    449 //
    450 // ui_players.c
    451 //
    452 
    453 //FIXME ripped from cg_local.h
    454 typedef struct {
    455 	int			oldFrame;
    456 	int			oldFrameTime;		// time when ->oldFrame was exactly on
    457 
    458 	int			frame;
    459 	int			frameTime;			// time when ->frame will be exactly on
    460 
    461 	float		backlerp;
    462 
    463 	float		yawAngle;
    464 	qboolean	yawing;
    465 	float		pitchAngle;
    466 	qboolean	pitching;
    467 
    468 	int			animationNumber;	// may include ANIM_TOGGLEBIT
    469 	animation_t	*animation;
    470 	int			animationTime;		// time when the first frame of the animation will be exact
    471 } lerpFrame_t;
    472 
    473 typedef struct {
    474 	// model info
    475 	qhandle_t		legsModel;
    476 	qhandle_t		legsSkin;
    477 	lerpFrame_t		legs;
    478 
    479 	qhandle_t		torsoModel;
    480 	qhandle_t		torsoSkin;
    481 	lerpFrame_t		torso;
    482 
    483 	qhandle_t		headModel;
    484 	qhandle_t		headSkin;
    485 
    486 	animation_t		animations[MAX_ANIMATIONS];
    487 
    488 	qhandle_t		weaponModel;
    489 	qhandle_t		barrelModel;
    490 	qhandle_t		flashModel;
    491 	vec3_t			flashDlightColor;
    492 	int				muzzleFlashTime;
    493 
    494 	// currently in use drawing parms
    495 	vec3_t			viewAngles;
    496 	vec3_t			moveAngles;
    497 	weapon_t		currentWeapon;
    498 	int				legsAnim;
    499 	int				torsoAnim;
    500 
    501 	// animation vars
    502 	weapon_t		weapon;
    503 	weapon_t		lastWeapon;
    504 	weapon_t		pendingWeapon;
    505 	int				weaponTimer;
    506 	int				pendingLegsAnim;
    507 	int				torsoAnimationTimer;
    508 
    509 	int				pendingTorsoAnim;
    510 	int				legsAnimationTimer;
    511 
    512 	qboolean		chat;
    513 	qboolean		newModel;
    514 
    515 	qboolean		barrelSpinning;
    516 	float			barrelAngle;
    517 	int				barrelTime;
    518 
    519 	int				realWeapon;
    520 } playerInfo_t;
    521 
    522 void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int time );
    523 void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model );
    524 void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat );
    525 qboolean UI_RegisterClientModelname( playerInfo_t *pi, const char *modelSkinName );
    526 
    527 //
    528 // ui_atoms.c
    529 //
    530 typedef struct {
    531 	int					frametime;
    532 	int					realtime;
    533 	int					cursorx;
    534 	int					cursory;
    535 	int					menusp;
    536 	menuframework_s*	activemenu;
    537 	menuframework_s*	stack[MAX_MENUDEPTH];
    538 	glconfig_t			glconfig;
    539 	qboolean			debug;
    540 	qhandle_t			whiteShader;
    541 	qhandle_t			menuBackShader;
    542 	qhandle_t			menuBackNoLogoShader;
    543 	qhandle_t			charset;
    544 	qhandle_t			charsetProp;
    545 	qhandle_t			charsetPropGlow;
    546 	qhandle_t			charsetPropB;
    547 	qhandle_t			cursor;
    548 	qhandle_t			rb_on;
    549 	qhandle_t			rb_off;
    550 	float				scale;
    551 	float				bias;
    552 	qboolean			demoversion;
    553 	qboolean			firstdraw;
    554 } uiStatic_t;
    555 
    556 extern void			UI_Init( void );
    557 extern void			UI_Shutdown( void );
    558 extern void			UI_KeyEvent( int key, int down );
    559 extern void			UI_MouseEvent( int dx, int dy );
    560 extern void			UI_Refresh( int realtime );
    561 extern qboolean		UI_ConsoleCommand( int realTime );
    562 extern float		UI_ClampCvar( float min, float max, float value );
    563 extern void			UI_DrawNamedPic( float x, float y, float width, float height, const char *picname );
    564 extern void			UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ); 
    565 extern void			UI_FillRect( float x, float y, float width, float height, const float *color );
    566 extern void			UI_DrawRect( float x, float y, float width, float height, const float *color );
    567 extern void			UI_UpdateScreen( void );
    568 extern void			UI_SetColor( const float *rgba );
    569 extern void			UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
    570 extern void			UI_DrawBannerString( int x, int y, const char* str, int style, vec4_t color );
    571 extern float		UI_ProportionalSizeScale( int style );
    572 extern void			UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t color );
    573 extern void			UI_DrawProportionalString_AutoWrapped( int x, int ystart, int xmax, int ystep, const char* str, int style, vec4_t color );
    574 extern int			UI_ProportionalStringWidth( const char* str );
    575 extern void			UI_DrawString( int x, int y, const char* str, int style, vec4_t color );
    576 extern void			UI_DrawChar( int x, int y, int ch, int style, vec4_t color );
    577 extern qboolean 	UI_CursorInRect (int x, int y, int width, int height);
    578 extern void			UI_AdjustFrom640( float *x, float *y, float *w, float *h );
    579 extern void			UI_DrawTextBox (int x, int y, int width, int lines);
    580 extern qboolean		UI_IsFullscreen( void );
    581 extern void			UI_SetActiveMenu( uiMenuCommand_t menu );
    582 extern void			UI_PushMenu ( menuframework_s *menu );
    583 extern void			UI_PopMenu (void);
    584 extern void			UI_ForceMenuOff (void);
    585 extern char			*UI_Argv( int arg );
    586 extern char			*UI_Cvar_VariableString( const char *var_name );
    587 extern void			UI_Refresh( int time );
    588 extern void			UI_StartDemoLoop( void );
    589 extern qboolean		m_entersound;
    590 extern uiStatic_t	uis;
    591 
    592 //
    593 // ui_spLevel.c
    594 //
    595 void UI_SPLevelMenu_Cache( void );
    596 void UI_SPLevelMenu( void );
    597 void UI_SPLevelMenu_f( void );
    598 void UI_SPLevelMenu_ReInit( void );
    599 
    600 //
    601 // ui_spArena.c
    602 //
    603 void UI_SPArena_Start( const char *arenaInfo );
    604 
    605 //
    606 // ui_spPostgame.c
    607 //
    608 void UI_SPPostgameMenu_Cache( void );
    609 void UI_SPPostgameMenu_f( void );
    610 
    611 //
    612 // ui_spSkill.c
    613 //
    614 void UI_SPSkillMenu( const char *arenaInfo );
    615 void UI_SPSkillMenu_Cache( void );
    616 
    617 //
    618 // ui_syscalls.c
    619 //
    620 void			trap_Print( const char *string );
    621 void			trap_Error( const char *string );
    622 int				trap_Milliseconds( void );
    623 void			trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
    624 void			trap_Cvar_Update( vmCvar_t *vmCvar );
    625 void			trap_Cvar_Set( const char *var_name, const char *value );
    626 float			trap_Cvar_VariableValue( const char *var_name );
    627 void			trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize );
    628 void			trap_Cvar_SetValue( const char *var_name, float value );
    629 void			trap_Cvar_Reset( const char *name );
    630 void			trap_Cvar_Create( const char *var_name, const char *var_value, int flags );
    631 void			trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize );
    632 int				trap_Argc( void );
    633 void			trap_Argv( int n, char *buffer, int bufferLength );
    634 void			trap_Cmd_ExecuteText( int exec_when, const char *text );	// don't use EXEC_NOW!
    635 int				trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode );
    636 void			trap_FS_Read( void *buffer, int len, fileHandle_t f );
    637 void			trap_FS_Write( const void *buffer, int len, fileHandle_t f );
    638 void			trap_FS_FCloseFile( fileHandle_t f );
    639 int				trap_FS_GetFileList(  const char *path, const char *extension, char *listbuf, int bufsize );
    640 int				trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t
    641 qhandle_t		trap_R_RegisterModel( const char *name );
    642 qhandle_t		trap_R_RegisterSkin( const char *name );
    643 qhandle_t		trap_R_RegisterShaderNoMip( const char *name );
    644 void			trap_R_ClearScene( void );
    645 void			trap_R_AddRefEntityToScene( const refEntity_t *re );
    646 void			trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts );
    647 void			trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b );
    648 void			trap_R_RenderScene( const refdef_t *fd );
    649 void			trap_R_SetColor( const float *rgba );
    650 void			trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
    651 void			trap_UpdateScreen( void );
    652 int				trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName );
    653 void			trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum );
    654 sfxHandle_t	trap_S_RegisterSound( const char *sample, qboolean compressed );
    655 void			trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen );
    656 void			trap_Key_GetBindingBuf( int keynum, char *buf, int buflen );
    657 void			trap_Key_SetBinding( int keynum, const char *binding );
    658 qboolean		trap_Key_IsDown( int keynum );
    659 qboolean		trap_Key_GetOverstrikeMode( void );
    660 void			trap_Key_SetOverstrikeMode( qboolean state );
    661 void			trap_Key_ClearStates( void );
    662 int				trap_Key_GetCatcher( void );
    663 void			trap_Key_SetCatcher( int catcher );
    664 void			trap_GetClipboardData( char *buf, int bufsize );
    665 void			trap_GetClientState( uiClientState_t *state );
    666 void			trap_GetGlconfig( glconfig_t *glconfig );
    667 int				trap_GetConfigString( int index, char* buff, int buffsize );
    668 int				trap_LAN_GetServerCount( int source );
    669 void			trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen );
    670 void			trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen );
    671 int				trap_LAN_GetPingQueueCount( void );
    672 int				trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen );
    673 void			trap_LAN_ClearPing( int n );
    674 void			trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime );
    675 void			trap_LAN_GetPingInfo( int n, char *buf, int buflen );
    676 int				trap_MemoryRemaining( void );
    677 void			trap_GetCDKey( char *buf, int buflen );
    678 void			trap_SetCDKey( char *buf );
    679 
    680 qboolean               trap_VerifyCDKey( const char *key, const char *chksum); // bk001208 - RC4
    681 
    682 void			trap_SetPbClStatus( int status );
    683 
    684 //
    685 // ui_addbots.c
    686 //
    687 void UI_AddBots_Cache( void );
    688 void UI_AddBotsMenu( void );
    689 
    690 //
    691 // ui_removebots.c
    692 //
    693 void UI_RemoveBots_Cache( void );
    694 void UI_RemoveBotsMenu( void );
    695 
    696 //
    697 // ui_teamorders.c
    698 //
    699 extern void UI_TeamOrdersMenu( void );
    700 extern void UI_TeamOrdersMenu_f( void );
    701 extern void UI_TeamOrdersMenu_Cache( void );
    702 
    703 //
    704 // ui_loadconfig.c
    705 //
    706 void UI_LoadConfig_Cache( void );
    707 void UI_LoadConfigMenu( void );
    708 
    709 //
    710 // ui_saveconfig.c
    711 //
    712 void UI_SaveConfigMenu_Cache( void );
    713 void UI_SaveConfigMenu( void );
    714 
    715 //
    716 // ui_display.c
    717 //
    718 void UI_DisplayOptionsMenu_Cache( void );
    719 void UI_DisplayOptionsMenu( void );
    720 
    721 //
    722 // ui_sound.c
    723 //
    724 void UI_SoundOptionsMenu_Cache( void );
    725 void UI_SoundOptionsMenu( void );
    726 
    727 //
    728 // ui_network.c
    729 //
    730 void UI_NetworkOptionsMenu_Cache( void );
    731 void UI_NetworkOptionsMenu( void );
    732 
    733 //
    734 // ui_gameinfo.c
    735 //
    736 typedef enum {
    737 	AWARD_ACCURACY,
    738 	AWARD_IMPRESSIVE,
    739 	AWARD_EXCELLENT,
    740 	AWARD_GAUNTLET,
    741 	AWARD_FRAGS,
    742 	AWARD_PERFECT
    743 } awardType_t;
    744 
    745 const char *UI_GetArenaInfoByNumber( int num );
    746 const char *UI_GetArenaInfoByMap( const char *map );
    747 const char *UI_GetSpecialArenaInfo( const char *tag );
    748 int UI_GetNumArenas( void );
    749 int UI_GetNumSPArenas( void );
    750 int UI_GetNumSPTiers( void );
    751 
    752 char *UI_GetBotInfoByNumber( int num );
    753 char *UI_GetBotInfoByName( const char *name );
    754 int UI_GetNumBots( void );
    755 
    756 void UI_GetBestScore( int level, int *score, int *skill );
    757 void UI_SetBestScore( int level, int score );
    758 int UI_TierCompleted( int levelWon );
    759 qboolean UI_ShowTierVideo( int tier );
    760 qboolean UI_CanShowTierVideo( int tier );
    761 int  UI_GetCurrentGame( void );
    762 void UI_NewGame( void );
    763 void UI_LogAwardData( int award, int data );
    764 int UI_GetAwardLevel( int award );
    765 
    766 void UI_SPUnlock_f( void );
    767 void UI_SPUnlockMedals_f( void );
    768 
    769 void UI_InitGameinfo( void );
    770 
    771 //GRank
    772 
    773 //
    774 // ui_rankings.c
    775 //
    776 void Rankings_DrawText( void* self );
    777 void Rankings_DrawName( void* self );
    778 void Rankings_DrawPassword( void* self );
    779 void Rankings_Cache( void );
    780 void UI_RankingsMenu( void );
    781 
    782 //
    783 // ui_login.c
    784 //
    785 void Login_Cache( void );
    786 void UI_LoginMenu( void );
    787 
    788 //
    789 // ui_signup.c
    790 //
    791 void Signup_Cache( void );
    792 void UI_SignupMenu( void );
    793 
    794 //
    795 // ui_rankstatus.c
    796 //
    797 void RankStatus_Cache( void );
    798 void UI_RankStatusMenu( void );
    799 
    800 #endif