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

ui_local.h

Go to the documentation of this file.
00001 /*
00002 ===========================================================================
00003 Copyright (C) 1999-2005 Id Software, Inc.
00004 
00005 This file is part of Quake III Arena source code.
00006 
00007 Quake III Arena source code is free software; you can redistribute it
00008 and/or modify it under the terms of the GNU General Public License as
00009 published by the Free Software Foundation; either version 2 of the License,
00010 or (at your option) any later version.
00011 
00012 Quake III Arena source code is distributed in the hope that it will be
00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Foobar; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 ===========================================================================
00021 */
00022 //
00023 #ifndef __UI_LOCAL_H__
00024 #define __UI_LOCAL_H__
00025 
00026 #include "../game/q_shared.h"
00027 #include "../cgame/tr_types.h"
00028 #include "ui_public.h"
00029 #include "keycodes.h"
00030 #include "../game/bg_public.h"
00031 #include "ui_shared.h"
00032 
00033 // global display context
00034 
00035 extern vmCvar_t ui_ffa_fraglimit;
00036 extern vmCvar_t ui_ffa_timelimit;
00037 
00038 extern vmCvar_t ui_tourney_fraglimit;
00039 extern vmCvar_t ui_tourney_timelimit;
00040 
00041 extern vmCvar_t ui_team_fraglimit;
00042 extern vmCvar_t ui_team_timelimit;
00043 extern vmCvar_t ui_team_friendly;
00044 
00045 extern vmCvar_t ui_ctf_capturelimit;
00046 extern vmCvar_t ui_ctf_timelimit;
00047 extern vmCvar_t ui_ctf_friendly;
00048 
00049 extern vmCvar_t ui_arenasFile;
00050 extern vmCvar_t ui_botsFile;
00051 extern vmCvar_t ui_spScores1;
00052 extern vmCvar_t ui_spScores2;
00053 extern vmCvar_t ui_spScores3;
00054 extern vmCvar_t ui_spScores4;
00055 extern vmCvar_t ui_spScores5;
00056 extern vmCvar_t ui_spAwards;
00057 extern vmCvar_t ui_spVideos;
00058 extern vmCvar_t ui_spSkill;
00059 
00060 extern vmCvar_t ui_spSelection;
00061 
00062 extern vmCvar_t ui_browserMaster;
00063 extern vmCvar_t ui_browserGameType;
00064 extern vmCvar_t ui_browserSortKey;
00065 extern vmCvar_t ui_browserShowFull;
00066 extern vmCvar_t ui_browserShowEmpty;
00067 
00068 extern vmCvar_t ui_brassTime;
00069 extern vmCvar_t ui_drawCrosshair;
00070 extern vmCvar_t ui_drawCrosshairNames;
00071 extern vmCvar_t ui_marks;
00072 
00073 extern vmCvar_t ui_server1;
00074 extern vmCvar_t ui_server2;
00075 extern vmCvar_t ui_server3;
00076 extern vmCvar_t ui_server4;
00077 extern vmCvar_t ui_server5;
00078 extern vmCvar_t ui_server6;
00079 extern vmCvar_t ui_server7;
00080 extern vmCvar_t ui_server8;
00081 extern vmCvar_t ui_server9;
00082 extern vmCvar_t ui_server10;
00083 extern vmCvar_t ui_server11;
00084 extern vmCvar_t ui_server12;
00085 extern vmCvar_t ui_server13;
00086 extern vmCvar_t ui_server14;
00087 extern vmCvar_t ui_server15;
00088 extern vmCvar_t ui_server16;
00089 
00090 extern vmCvar_t ui_cdkey;
00091 extern vmCvar_t ui_cdkeychecked;
00092 
00093 extern vmCvar_t ui_captureLimit;
00094 extern vmCvar_t ui_fragLimit;
00095 extern vmCvar_t ui_gameType;
00096 extern vmCvar_t ui_netGameType;
00097 extern vmCvar_t ui_actualNetGameType;
00098 extern vmCvar_t ui_joinGameType;
00099 extern vmCvar_t ui_netSource;
00100 extern vmCvar_t ui_serverFilterType;
00101 extern vmCvar_t ui_dedicated;
00102 extern vmCvar_t ui_opponentName;
00103 extern vmCvar_t ui_menuFiles;
00104 extern vmCvar_t ui_currentTier;
00105 extern vmCvar_t ui_currentMap;
00106 extern vmCvar_t ui_currentNetMap;
00107 extern vmCvar_t ui_mapIndex;
00108 extern vmCvar_t ui_currentOpponent;
00109 extern vmCvar_t ui_selectedPlayer;
00110 extern vmCvar_t ui_selectedPlayerName;
00111 extern vmCvar_t ui_lastServerRefresh_0;
00112 extern vmCvar_t ui_lastServerRefresh_1;
00113 extern vmCvar_t ui_lastServerRefresh_2;
00114 extern vmCvar_t ui_lastServerRefresh_3;
00115 extern vmCvar_t ui_singlePlayerActive;
00116 extern vmCvar_t ui_scoreAccuracy;
00117 extern vmCvar_t ui_scoreImpressives;
00118 extern vmCvar_t ui_scoreExcellents;
00119 extern vmCvar_t ui_scoreDefends;
00120 extern vmCvar_t ui_scoreAssists;
00121 extern vmCvar_t ui_scoreGauntlets;
00122 extern vmCvar_t ui_scoreScore;
00123 extern vmCvar_t ui_scorePerfect;
00124 extern vmCvar_t ui_scoreTeam;
00125 extern vmCvar_t ui_scoreBase;
00126 extern vmCvar_t ui_scoreTimeBonus;
00127 extern vmCvar_t ui_scoreSkillBonus;
00128 extern vmCvar_t ui_scoreShutoutBonus;
00129 extern vmCvar_t ui_scoreTime;
00130 extern vmCvar_t ui_smallFont;
00131 extern vmCvar_t ui_bigFont;
00132 extern vmCvar_t ui_serverStatusTimeOut;
00133 
00134 
00135 
00136 //
00137 // ui_qmenu.c
00138 //
00139 
00140 #define RCOLUMN_OFFSET          ( BIGCHAR_WIDTH )
00141 #define LCOLUMN_OFFSET          (-BIGCHAR_WIDTH )
00142 
00143 #define SLIDER_RANGE            10
00144 #define MAX_EDIT_LINE           256
00145 
00146 #define MAX_MENUDEPTH           8
00147 #define MAX_MENUITEMS           96
00148 
00149 #define MTYPE_NULL              0
00150 #define MTYPE_SLIDER            1   
00151 #define MTYPE_ACTION            2
00152 #define MTYPE_SPINCONTROL       3
00153 #define MTYPE_FIELD             4
00154 #define MTYPE_RADIOBUTTON       5
00155 #define MTYPE_BITMAP            6   
00156 #define MTYPE_TEXT              7
00157 #define MTYPE_SCROLLLIST        8
00158 #define MTYPE_PTEXT             9
00159 #define MTYPE_BTEXT             10
00160 
00161 #define QMF_BLINK               0x00000001
00162 #define QMF_SMALLFONT           0x00000002
00163 #define QMF_LEFT_JUSTIFY        0x00000004
00164 #define QMF_CENTER_JUSTIFY      0x00000008
00165 #define QMF_RIGHT_JUSTIFY       0x00000010
00166 #define QMF_NUMBERSONLY         0x00000020  // edit field is only numbers
00167 #define QMF_HIGHLIGHT           0x00000040
00168 #define QMF_HIGHLIGHT_IF_FOCUS  0x00000080  // steady focus
00169 #define QMF_PULSEIFFOCUS        0x00000100  // pulse if focus
00170 #define QMF_HASMOUSEFOCUS       0x00000200
00171 #define QMF_NOONOFFTEXT         0x00000400
00172 #define QMF_MOUSEONLY           0x00000800  // only mouse input allowed
00173 #define QMF_HIDDEN              0x00001000  // skips drawing
00174 #define QMF_GRAYED              0x00002000  // grays and disables
00175 #define QMF_INACTIVE            0x00004000  // disables any input
00176 #define QMF_NODEFAULTINIT       0x00008000  // skip default initialization
00177 #define QMF_OWNERDRAW           0x00010000
00178 #define QMF_PULSE               0x00020000
00179 #define QMF_LOWERCASE           0x00040000  // edit field is all lower case
00180 #define QMF_UPPERCASE           0x00080000  // edit field is all upper case
00181 #define QMF_SILENT              0x00100000
00182 
00183 // callback notifications
00184 #define QM_GOTFOCUS             1
00185 #define QM_LOSTFOCUS            2
00186 #define QM_ACTIVATED            3
00187 
00188 typedef struct _tag_menuframework
00189 {
00190     int cursor;
00191     int cursor_prev;
00192 
00193     int nitems;
00194     void *items[MAX_MENUITEMS];
00195 
00196     void (*draw) (void);
00197     sfxHandle_t (*key) (int key);
00198 
00199     qboolean    wrapAround;
00200     qboolean    fullscreen;
00201     qboolean    showlogo;
00202 } menuframework_s;
00203 
00204 typedef struct
00205 {
00206     int type;
00207     const char *name;
00208     int id;
00209     int x, y;
00210     int left;
00211     int top;
00212     int right;
00213     int bottom;
00214     menuframework_s *parent;
00215     int menuPosition;
00216     unsigned flags;
00217 
00218     void (*callback)( void *self, int event );
00219     void (*statusbar)( void *self );
00220     void (*ownerdraw)( void *self );
00221 } menucommon_s;
00222 
00223 typedef struct {
00224     int     cursor;
00225     int     scroll;
00226     int     widthInChars;
00227     char    buffer[MAX_EDIT_LINE];
00228     int     maxchars;
00229 } mfield_t;
00230 
00231 typedef struct
00232 {
00233     menucommon_s    generic;
00234     mfield_t        field;
00235 } menufield_s;
00236 
00237 typedef struct 
00238 {
00239     menucommon_s generic;
00240 
00241     float minvalue;
00242     float maxvalue;
00243     float curvalue;
00244 
00245     float range;
00246 } menuslider_s;
00247 
00248 typedef struct
00249 {
00250     menucommon_s generic;
00251 
00252     int oldvalue;
00253     int curvalue;
00254     int numitems;
00255     int top;
00256         
00257     const char **itemnames;
00258 
00259     int width;
00260     int height;
00261     int columns;
00262     int seperation;
00263 } menulist_s;
00264 
00265 typedef struct
00266 {
00267     menucommon_s generic;
00268 } menuaction_s;
00269 
00270 typedef struct
00271 {
00272     menucommon_s generic;
00273     int curvalue;
00274 } menuradiobutton_s;
00275 
00276 typedef struct
00277 {
00278     menucommon_s    generic;
00279     char*           focuspic;   
00280     char*           errorpic;
00281     qhandle_t       shader;
00282     qhandle_t       focusshader;
00283     int             width;
00284     int             height;
00285     float*          focuscolor;
00286 } menubitmap_s;
00287 
00288 typedef struct
00289 {
00290     menucommon_s    generic;
00291     char*           string;
00292     int             style;
00293     float*          color;
00294 } menutext_s;
00295 
00296 extern void         Menu_Cache( void );
00297 extern void         Menu_Focus( menucommon_s *m );
00298 extern void         Menu_AddItem( menuframework_s *menu, void *item );
00299 extern void         Menu_AdjustCursor( menuframework_s *menu, int dir );
00300 extern void         Menu_Draw( menuframework_s *menu );
00301 extern void         *Menu_ItemAtCursor( menuframework_s *m );
00302 extern sfxHandle_t  Menu_ActivateItem( menuframework_s *s, menucommon_s* item );
00303 extern void         Menu_SetCursor( menuframework_s *s, int cursor );
00304 extern void         Menu_SetCursorToItem( menuframework_s *m, void* ptr );
00305 extern sfxHandle_t  Menu_DefaultKey( menuframework_s *s, int key );
00306 extern void         Bitmap_Init( menubitmap_s *b );
00307 extern void         Bitmap_Draw( menubitmap_s *b );
00308 extern void         ScrollList_Draw( menulist_s *l );
00309 extern sfxHandle_t  ScrollList_Key( menulist_s *l, int key );
00310 extern sfxHandle_t  menu_in_sound;
00311 extern sfxHandle_t  menu_move_sound;
00312 extern sfxHandle_t  menu_out_sound;
00313 extern sfxHandle_t  menu_buzz_sound;
00314 extern sfxHandle_t  menu_null_sound;
00315 extern sfxHandle_t  weaponChangeSound;
00316 extern vec4_t       menu_text_color;
00317 extern vec4_t       menu_grayed_color;
00318 extern vec4_t       menu_dark_color;
00319 extern vec4_t       menu_highlight_color;
00320 extern vec4_t       menu_red_color;
00321 extern vec4_t       menu_black_color;
00322 extern vec4_t       menu_dim_color;
00323 extern vec4_t       color_black;
00324 extern vec4_t       color_white;
00325 extern vec4_t       color_yellow;
00326 extern vec4_t       color_blue;
00327 extern vec4_t       color_orange;
00328 extern vec4_t       color_red;
00329 extern vec4_t       color_dim;
00330 extern vec4_t       name_color;
00331 extern vec4_t       list_color;
00332 extern vec4_t       listbar_color;
00333 extern vec4_t       text_color_disabled; 
00334 extern vec4_t       text_color_normal;
00335 extern vec4_t       text_color_highlight;
00336 
00337 extern char *ui_medalNames[];
00338 extern char *ui_medalPicNames[];
00339 extern char *ui_medalSounds[];
00340 
00341 //
00342 // ui_mfield.c
00343 //
00344 extern void         MField_Clear( mfield_t *edit );
00345 extern void         MField_KeyDownEvent( mfield_t *edit, int key );
00346 extern void         MField_CharEvent( mfield_t *edit, int ch );
00347 extern void         MField_Draw( mfield_t *edit, int x, int y, int style, vec4_t color );
00348 extern void         MenuField_Init( menufield_s* m );
00349 extern void         MenuField_Draw( menufield_s *f );
00350 extern sfxHandle_t  MenuField_Key( menufield_s* m, int* key );
00351 
00352 //
00353 // ui_main.c
00354 //
00355 void UI_Report();
00356 void UI_Load();
00357 void UI_LoadMenus(const char *menuFile, qboolean reset);
00358 void _UI_SetActiveMenu( uiMenuCommand_t menu );
00359 int UI_AdjustTimeByGame(int time);
00360 void UI_ShowPostGame(qboolean newHigh);
00361 void UI_ClearScores();
00362 void UI_LoadArenas(void);
00363 
00364 //
00365 // ui_menu.c
00366 //
00367 extern void MainMenu_Cache( void );
00368 extern void UI_MainMenu(void);
00369 extern void UI_RegisterCvars( void );
00370 extern void UI_UpdateCvars( void );
00371 
00372 //
00373 // ui_credits.c
00374 //
00375 extern void UI_CreditMenu( void );
00376 
00377 //
00378 // ui_ingame.c
00379 //
00380 extern void InGame_Cache( void );
00381 extern void UI_InGameMenu(void);
00382 
00383 //
00384 // ui_confirm.c
00385 //
00386 extern void ConfirmMenu_Cache( void );
00387 extern void UI_ConfirmMenu( const char *question, void (*draw)( void ), void (*action)( qboolean result ) );
00388 
00389 //
00390 // ui_setup.c
00391 //
00392 extern void UI_SetupMenu_Cache( void );
00393 extern void UI_SetupMenu(void);
00394 
00395 //
00396 // ui_team.c
00397 //
00398 extern void UI_TeamMainMenu( void );
00399 extern void TeamMain_Cache( void );
00400 
00401 //
00402 // ui_connect.c
00403 //
00404 extern void UI_DrawConnectScreen( qboolean overlay );
00405 
00406 //
00407 // ui_controls2.c
00408 //
00409 extern void UI_ControlsMenu( void );
00410 extern void Controls_Cache( void );
00411 
00412 //
00413 // ui_demo2.c
00414 //
00415 extern void UI_DemosMenu( void );
00416 extern void Demos_Cache( void );
00417 
00418 //
00419 // ui_cinematics.c
00420 //
00421 extern void UI_CinematicsMenu( void );
00422 extern void UI_CinematicsMenu_f( void );
00423 extern void UI_CinematicsMenu_Cache( void );
00424 
00425 //
00426 // ui_mods.c
00427 //
00428 extern void UI_ModsMenu( void );
00429 extern void UI_ModsMenu_Cache( void );
00430 
00431 //
00432 // ui_cdkey.c
00433 //
00434 extern void UI_CDKeyMenu( void );
00435 extern void UI_CDKeyMenu_Cache( void );
00436 extern void UI_CDKeyMenu_f( void );
00437 
00438 //
00439 // ui_playermodel.c
00440 //
00441 extern void UI_PlayerModelMenu( void );
00442 extern void PlayerModel_Cache( void );
00443 
00444 //
00445 // ui_playersettings.c
00446 //
00447 extern void UI_PlayerSettingsMenu( void );
00448 extern void PlayerSettings_Cache( void );
00449 
00450 //
00451 // ui_preferences.c
00452 //
00453 extern void UI_PreferencesMenu( void );
00454 extern void Preferences_Cache( void );
00455 
00456 //
00457 // ui_specifyleague.c
00458 //
00459 extern void UI_SpecifyLeagueMenu( void );
00460 extern void SpecifyLeague_Cache( void );
00461 
00462 //
00463 // ui_specifyserver.c
00464 //
00465 extern void UI_SpecifyServerMenu( void );
00466 extern void SpecifyServer_Cache( void );
00467 
00468 //
00469 // ui_servers2.c
00470 //
00471 #define MAX_FAVORITESERVERS 16
00472 
00473 extern void UI_ArenaServersMenu( void );
00474 extern void ArenaServers_Cache( void );
00475 
00476 //
00477 // ui_startserver.c
00478 //
00479 extern void UI_StartServerMenu( qboolean multiplayer );
00480 extern void StartServer_Cache( void );
00481 extern void ServerOptions_Cache( void );
00482 extern void UI_BotSelectMenu( char *bot );
00483 extern void UI_BotSelectMenu_Cache( void );
00484 
00485 //
00486 // ui_serverinfo.c
00487 //
00488 extern void UI_ServerInfoMenu( void );
00489 extern void ServerInfo_Cache( void );
00490 
00491 //
00492 // ui_video.c
00493 //
00494 extern void UI_GraphicsOptionsMenu( void );
00495 extern void GraphicsOptions_Cache( void );
00496 extern void DriverInfo_Cache( void );
00497 
00498 //
00499 // ui_players.c
00500 //
00501 
00502 //FIXME ripped from cg_local.h
00503 typedef struct {
00504     int         oldFrame;
00505     int         oldFrameTime;       // time when ->oldFrame was exactly on
00506 
00507     int         frame;
00508     int         frameTime;          // time when ->frame will be exactly on
00509 
00510     float       backlerp;
00511 
00512     float       yawAngle;
00513     qboolean    yawing;
00514     float       pitchAngle;
00515     qboolean    pitching;
00516 
00517     int         animationNumber;    // may include ANIM_TOGGLEBIT
00518     animation_t *animation;
00519     int         animationTime;      // time when the first frame of the animation will be exact
00520 } lerpFrame_t;
00521 
00522 typedef struct {
00523     // model info
00524     qhandle_t       legsModel;
00525     qhandle_t       legsSkin;
00526     lerpFrame_t     legs;
00527 
00528     qhandle_t       torsoModel;
00529     qhandle_t       torsoSkin;
00530     lerpFrame_t     torso;
00531 
00532     qhandle_t       headModel;
00533     qhandle_t       headSkin;
00534 
00535     animation_t     animations[MAX_TOTALANIMATIONS];
00536 
00537     qhandle_t       weaponModel;
00538     qhandle_t       barrelModel;
00539     qhandle_t       flashModel;
00540     vec3_t          flashDlightColor;
00541     int             muzzleFlashTime;
00542 
00543     // currently in use drawing parms
00544     vec3_t          viewAngles;
00545     vec3_t          moveAngles;
00546     weapon_t        currentWeapon;
00547     int             legsAnim;
00548     int             torsoAnim;
00549 
00550     // animation vars
00551     weapon_t        weapon;
00552     weapon_t        lastWeapon;
00553     weapon_t        pendingWeapon;
00554     int             weaponTimer;
00555     int             pendingLegsAnim;
00556     int             torsoAnimationTimer;
00557 
00558     int             pendingTorsoAnim;
00559     int             legsAnimationTimer;
00560 
00561     qboolean        chat;
00562     qboolean        newModel;
00563 
00564     qboolean        barrelSpinning;
00565     float           barrelAngle;
00566     int             barrelTime;
00567 
00568     int             realWeapon;
00569 } playerInfo_t;
00570 
00571 void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int time );
00572 void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model, const char *headmodel, char *teamName );
00573 void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNum, qboolean chat );
00574 qboolean UI_RegisterClientModelname( playerInfo_t *pi, const char *modelSkinName , const char *headName, const char *teamName);
00575 
00576 //
00577 // ui_atoms.c
00578 //
00579 // this is only used in the old ui, the new ui has it's own version
00580 typedef struct {
00581     int                 frametime;
00582     int                 realtime;
00583     int                 cursorx;
00584     int                 cursory;
00585     glconfig_t  glconfig;
00586     qboolean        debug;
00587     qhandle_t       whiteShader;
00588     qhandle_t       menuBackShader;
00589     qhandle_t       menuBackShader2;
00590     qhandle_t       menuBackNoLogoShader;
00591     qhandle_t       charset;
00592     qhandle_t       charsetProp;
00593     qhandle_t       charsetPropGlow;
00594     qhandle_t       charsetPropB;
00595     qhandle_t       cursor;
00596     qhandle_t       rb_on;
00597     qhandle_t       rb_off;
00598     float               scale;
00599     float               bias;
00600     qboolean        demoversion;
00601     qboolean        firstdraw;
00602 } uiStatic_t;
00603 
00604 
00605 // new ui stuff
00606 #define UI_NUMFX 7
00607 #define MAX_HEADS 64
00608 #define MAX_ALIASES 64
00609 #define MAX_HEADNAME  32
00610 #define MAX_TEAMS 64
00611 #define MAX_GAMETYPES 16
00612 #define MAX_MAPS 128
00613 #define MAX_SPMAPS 16
00614 #define PLAYERS_PER_TEAM 5
00615 #define MAX_PINGREQUESTS        32
00616 #define MAX_ADDRESSLENGTH       64
00617 #define MAX_HOSTNAMELENGTH      22
00618 #define MAX_MAPNAMELENGTH       16
00619 #define MAX_STATUSLENGTH        64
00620 #define MAX_LISTBOXWIDTH        59
00621 #define UI_FONT_THRESHOLD       0.1
00622 #define MAX_DISPLAY_SERVERS     2048
00623 #define MAX_SERVERSTATUS_LINES  128
00624 #define MAX_SERVERSTATUS_TEXT   1024
00625 #define MAX_FOUNDPLAYER_SERVERS 16
00626 #define TEAM_MEMBERS 5
00627 #define GAMES_ALL           0
00628 #define GAMES_FFA           1
00629 #define GAMES_TEAMPLAY      2
00630 #define GAMES_TOURNEY       3
00631 #define GAMES_CTF           4
00632 #define MAPS_PER_TIER 3
00633 #define MAX_TIERS 16
00634 #define MAX_MODS 64
00635 #define MAX_DEMOS 256
00636 #define MAX_MOVIES 256
00637 #define MAX_PLAYERMODELS 256
00638 
00639 
00640 typedef struct {
00641   const char *name;
00642     const char *imageName;
00643   qhandle_t headImage;
00644     const char *base;
00645     qboolean active;
00646     int reference;
00647 } characterInfo;
00648 
00649 typedef struct {
00650     const char *name;
00651     const char *ai;
00652     const char *action;
00653 } aliasInfo;
00654 
00655 typedef struct {
00656   const char *teamName;
00657     const char *imageName;
00658     const char *teamMembers[TEAM_MEMBERS];
00659   qhandle_t teamIcon;
00660   qhandle_t teamIcon_Metal;
00661   qhandle_t teamIcon_Name;
00662     int cinematic;
00663 } teamInfo;
00664 
00665 typedef struct {
00666   const char *gameType;
00667   int gtEnum;
00668 } gameTypeInfo;
00669 
00670 typedef struct {
00671   const char *mapName;
00672   const char *mapLoadName;
00673     const char *imageName;
00674     const char *opponentName;
00675     int teamMembers;
00676   int typeBits;
00677     int cinematic;
00678     int timeToBeat[MAX_GAMETYPES];
00679     qhandle_t levelShot;
00680     qboolean active;
00681 } mapInfo;
00682 
00683 typedef struct {
00684     const char *tierName;
00685     const char *maps[MAPS_PER_TIER];
00686     int gameTypes[MAPS_PER_TIER];
00687     qhandle_t mapHandles[MAPS_PER_TIER];
00688 } tierInfo;
00689 
00690 typedef struct serverFilter_s {
00691     const char *description;
00692     const char *basedir;
00693 } serverFilter_t;
00694 
00695 typedef struct {
00696     char    adrstr[MAX_ADDRESSLENGTH];
00697     int     start;
00698 } pinglist_t;
00699 
00700 
00701 typedef struct serverStatus_s {
00702     pinglist_t pingList[MAX_PINGREQUESTS];
00703     int     numqueriedservers;
00704     int     currentping;
00705     int     nextpingtime;
00706     int     maxservers;
00707     int     refreshtime;
00708     int     numServers;
00709     int     sortKey;
00710     int     sortDir;
00711     int     lastCount;
00712     qboolean refreshActive;
00713     int     currentServer;
00714     int     displayServers[MAX_DISPLAY_SERVERS];
00715     int     numDisplayServers;
00716     int     numPlayersOnServers;
00717     int     nextDisplayRefresh;
00718     int     nextSortTime;
00719     qhandle_t currentServerPreview;
00720     int     currentServerCinematic;
00721     int     motdLen;
00722     int     motdWidth;
00723     int     motdPaintX;
00724     int     motdPaintX2;
00725     int     motdOffset;
00726     int     motdTime;
00727     char    motd[MAX_STRING_CHARS];
00728 } serverStatus_t;
00729 
00730 
00731 typedef struct {
00732     char        adrstr[MAX_ADDRESSLENGTH];
00733     char        name[MAX_ADDRESSLENGTH];
00734     int         startTime;
00735     int         serverNum;
00736     qboolean    valid;
00737 } pendingServer_t;
00738 
00739 typedef struct {
00740     int num;
00741     pendingServer_t server[MAX_SERVERSTATUSREQUESTS];
00742 } pendingServerStatus_t;
00743 
00744 typedef struct {
00745     char address[MAX_ADDRESSLENGTH];
00746     char *lines[MAX_SERVERSTATUS_LINES][4];
00747     char text[MAX_SERVERSTATUS_TEXT];
00748     char pings[MAX_CLIENTS * 3];
00749     int numLines;
00750 } serverStatusInfo_t;
00751 
00752 typedef struct {
00753     const char *modName;
00754     const char *modDescr;
00755 } modInfo_t;
00756 
00757 
00758 typedef struct {
00759     displayContextDef_t uiDC;
00760     int newHighScoreTime;
00761     int newBestTime;
00762     int showPostGameTime;
00763     qboolean newHighScore;
00764     qboolean demoAvailable;
00765     qboolean soundHighScore;
00766     
00767     int characterCount;
00768     int botIndex;
00769     characterInfo characterList[MAX_HEADS];
00770 
00771     int aliasCount;
00772     aliasInfo aliasList[MAX_ALIASES];
00773 
00774     int teamCount;
00775     teamInfo teamList[MAX_TEAMS];
00776 
00777     int numGameTypes;
00778     gameTypeInfo gameTypes[MAX_GAMETYPES];
00779 
00780     int numJoinGameTypes;
00781     gameTypeInfo joinGameTypes[MAX_GAMETYPES];
00782 
00783     int redBlue;
00784     int playerCount;
00785     int myTeamCount;
00786     int teamIndex;
00787     int playerRefresh;
00788     int playerIndex;
00789     int playerNumber; 
00790     qboolean teamLeader;
00791     char playerNames[MAX_CLIENTS][MAX_NAME_LENGTH];
00792     char teamNames[MAX_CLIENTS][MAX_NAME_LENGTH];
00793     int teamClientNums[MAX_CLIENTS];
00794 
00795     int mapCount;
00796     mapInfo mapList[MAX_MAPS];
00797 
00798 
00799     int tierCount;
00800     tierInfo tierList[MAX_TIERS];
00801 
00802     int skillIndex;
00803 
00804     modInfo_t modList[MAX_MODS];
00805     int modCount;
00806     int modIndex;
00807 
00808     const char *demoList[MAX_DEMOS];
00809     int demoCount;
00810     int demoIndex;
00811 
00812     const char *movieList[MAX_MOVIES];
00813     int movieCount;
00814     int movieIndex;
00815     int previewMovie;
00816 
00817     serverStatus_t serverStatus;
00818 
00819     // for the showing the status of a server
00820     char serverStatusAddress[MAX_ADDRESSLENGTH];
00821     serverStatusInfo_t serverStatusInfo;
00822     int nextServerStatusRefresh;
00823 
00824     // to retrieve the status of server to find a player
00825     pendingServerStatus_t pendingServerStatus;
00826     char findPlayerName[MAX_STRING_CHARS];
00827     char foundPlayerServerAddresses[MAX_FOUNDPLAYER_SERVERS][MAX_ADDRESSLENGTH];
00828     char foundPlayerServerNames[MAX_FOUNDPLAYER_SERVERS][MAX_ADDRESSLENGTH];
00829     int currentFoundPlayerServer;
00830     int numFoundPlayerServers;
00831     int nextFindPlayerRefresh;
00832 
00833     int currentCrosshair;
00834     int startPostGameTime;
00835     sfxHandle_t newHighScoreSound;
00836 
00837     int             q3HeadCount;
00838     char            q3HeadNames[MAX_PLAYERMODELS][64];
00839     qhandle_t   q3HeadIcons[MAX_PLAYERMODELS];
00840     int             q3SelectedHead;
00841 
00842     int effectsColor;
00843 
00844     qboolean inGameLoad;
00845 
00846 }   uiInfo_t;
00847 
00848 extern uiInfo_t uiInfo;
00849 
00850 
00851 extern void         UI_Init( void );
00852 extern void         UI_Shutdown( void );
00853 extern void         UI_KeyEvent( int key );
00854 extern void         UI_MouseEvent( int dx, int dy );
00855 extern void         UI_Refresh( int realtime );
00856 extern qboolean     UI_ConsoleCommand( int realTime );
00857 extern float        UI_ClampCvar( float min, float max, float value );
00858 extern void         UI_DrawNamedPic( float x, float y, float width, float height, const char *picname );
00859 extern void         UI_DrawHandlePic( float x, float y, float w, float h, qhandle_t hShader ); 
00860 extern void         UI_FillRect( float x, float y, float width, float height, const float *color );
00861 extern void         UI_DrawRect( float x, float y, float width, float height, const float *color );
00862 extern void     UI_DrawTopBottom(float x, float y, float w, float h);
00863 extern void     UI_DrawSides(float x, float y, float w, float h);
00864 extern void         UI_UpdateScreen( void );
00865 extern void         UI_SetColor( const float *rgba );
00866 extern void         UI_LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
00867 extern void         UI_DrawBannerString( int x, int y, const char* str, int style, vec4_t color );
00868 extern float        UI_ProportionalSizeScale( int style );
00869 extern void         UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t color );
00870 extern int          UI_ProportionalStringWidth( const char* str );
00871 extern void         UI_DrawString( int x, int y, const char* str, int style, vec4_t color );
00872 extern void         UI_DrawChar( int x, int y, int ch, int style, vec4_t color );
00873 extern qboolean     UI_CursorInRect (int x, int y, int width, int height);
00874 extern void         UI_AdjustFrom640( float *x, float *y, float *w, float *h );
00875 extern void         UI_DrawTextBox (int x, int y, int width, int lines);
00876 extern qboolean     UI_IsFullscreen( void );
00877 extern void         UI_SetActiveMenu( uiMenuCommand_t menu );
00878 extern void         UI_PushMenu ( menuframework_s *menu );
00879 extern void         UI_PopMenu (void);
00880 extern void         UI_ForceMenuOff (void);
00881 extern char         *UI_Argv( int arg );
00882 extern char         *UI_Cvar_VariableString( const char *var_name );
00883 extern void         UI_Refresh( int time );
00884 extern void         UI_KeyEvent( int key );
00885 extern void         UI_StartDemoLoop( void );
00886 extern qboolean     m_entersound;
00887 void UI_LoadBestScores(const char *map, int game);
00888 extern uiStatic_t   uis;
00889 
00890 //
00891 // ui_spLevel.c
00892 //
00893 void UI_SPLevelMenu_Cache( void );
00894 void UI_SPLevelMenu( void );
00895 void UI_SPLevelMenu_f( void );
00896 void UI_SPLevelMenu_ReInit( void );
00897 
00898 //
00899 // ui_spArena.c
00900 //
00901 void UI_SPArena_Start( const char *arenaInfo );
00902 
00903 //
00904 // ui_spPostgame.c
00905 //
00906 void UI_SPPostgameMenu_Cache( void );
00907 void UI_SPPostgameMenu_f( void );
00908 
00909 //
00910 // ui_spSkill.c
00911 //
00912 void UI_SPSkillMenu( const char *arenaInfo );
00913 void UI_SPSkillMenu_Cache( void );
00914 
00915 //
00916 // ui_syscalls.c
00917 //
00918 void            trap_Print( const char *string );
00919 void            trap_Error( const char *string );
00920 int             trap_Milliseconds( void );
00921 void            trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
00922 void            trap_Cvar_Update( vmCvar_t *vmCvar );
00923 void            trap_Cvar_Set( const char *var_name, const char *value );
00924 float           trap_Cvar_VariableValue( const char *var_name );
00925 void            trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize );
00926 void            trap_Cvar_SetValue( const char *var_name, float value );
00927 void            trap_Cvar_Reset( const char *name );
00928 void            trap_Cvar_Create( const char *var_name, const char *var_value, int flags );
00929 void            trap_Cvar_InfoStringBuffer( int bit, char *buffer, int bufsize );
00930 int             trap_Argc( void );
00931 void            trap_Argv( int n, char *buffer, int bufferLength );
00932 void            trap_Cmd_ExecuteText( int exec_when, const char *text );    // don't use EXEC_NOW!
00933 int             trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mode );
00934 void            trap_FS_Read( void *buffer, int len, fileHandle_t f );
00935 void            trap_FS_Write( const void *buffer, int len, fileHandle_t f );
00936 void            trap_FS_FCloseFile( fileHandle_t f );
00937 int             trap_FS_GetFileList(  const char *path, const char *extension, char *listbuf, int bufsize );
00938 int             trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t
00939 qhandle_t       trap_R_RegisterModel( const char *name );
00940 qhandle_t       trap_R_RegisterSkin( const char *name );
00941 qhandle_t       trap_R_RegisterShaderNoMip( const char *name );
00942 void            trap_R_ClearScene( void );
00943 void            trap_R_AddRefEntityToScene( const refEntity_t *re );
00944 void            trap_R_AddPolyToScene( qhandle_t hShader , int numVerts, const polyVert_t *verts );
00945 void            trap_R_AddLightToScene( const vec3_t org, float intensity, float r, float g, float b );
00946 void            trap_R_RenderScene( const refdef_t *fd );
00947 void            trap_R_SetColor( const float *rgba );
00948 void            trap_R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader );
00949 void            trap_R_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs );
00950 void            trap_UpdateScreen( void );
00951 int             trap_CM_LerpTag( orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName );
00952 void            trap_S_StartLocalSound( sfxHandle_t sfx, int channelNum );
00953 sfxHandle_t     trap_S_RegisterSound( const char *sample, qboolean compressed );
00954 void            trap_Key_KeynumToStringBuf( int keynum, char *buf, int buflen );
00955 void            trap_Key_GetBindingBuf( int keynum, char *buf, int buflen );
00956 void            trap_Key_SetBinding( int keynum, const char *binding );
00957 qboolean        trap_Key_IsDown( int keynum );
00958 qboolean        trap_Key_GetOverstrikeMode( void );
00959 void            trap_Key_SetOverstrikeMode( qboolean state );
00960 void            trap_Key_ClearStates( void );
00961 int             trap_Key_GetCatcher( void );
00962 void            trap_Key_SetCatcher( int catcher );
00963 void            trap_GetClipboardData( char *buf, int bufsize );
00964 void            trap_GetClientState( uiClientState_t *state );
00965 void            trap_GetGlconfig( glconfig_t *glconfig );
00966 int             trap_GetConfigString( int index, char* buff, int buffsize );
00967 int             trap_LAN_GetServerCount( int source );
00968 void            trap_LAN_GetServerAddressString( int source, int n, char *buf, int buflen );
00969 void            trap_LAN_GetServerInfo( int source, int n, char *buf, int buflen );
00970 int             trap_LAN_GetServerPing( int source, int n );
00971 int             trap_LAN_GetPingQueueCount( void );
00972 void            trap_LAN_ClearPing( int n );
00973 void            trap_LAN_GetPing( int n, char *buf, int buflen, int *pingtime );
00974 void            trap_LAN_GetPingInfo( int n, char *buf, int buflen );
00975 void            trap_LAN_LoadCachedServers();
00976 void            trap_LAN_SaveCachedServers();
00977 void            trap_LAN_MarkServerVisible(int source, int n, qboolean visible);
00978 int             trap_LAN_ServerIsVisible( int source, int n);
00979 qboolean        trap_LAN_UpdateVisiblePings( int source );
00980 int             trap_LAN_AddServer(int source, const char *name, const char *addr);
00981 void            trap_LAN_RemoveServer(int source, const char *addr);
00982 void            trap_LAN_ResetPings(int n);
00983 int             trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen );
00984 int             trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 );
00985 int             trap_MemoryRemaining( void );
00986 void            trap_GetCDKey( char *buf, int buflen );
00987 void            trap_SetCDKey( char *buf );
00988 void            trap_R_RegisterFont(const char *pFontname, int pointSize, fontInfo_t *font);
00989 void            trap_S_StopBackgroundTrack( void );
00990 void            trap_S_StartBackgroundTrack( const char *intro, const char *loop);
00991 int             trap_CIN_PlayCinematic( const char *arg0, int xpos, int ypos, int width, int height, int bits);
00992 e_status        trap_CIN_StopCinematic(int handle);
00993 e_status        trap_CIN_RunCinematic (int handle);
00994 void            trap_CIN_DrawCinematic (int handle);
00995 void            trap_CIN_SetExtents (int handle, int x, int y, int w, int h);
00996 int             trap_RealTime(qtime_t *qtime);
00997 void            trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset );
00998 qboolean        trap_VerifyCDKey( const char *key, const char *chksum);
00999 
01000 void            trap_SetPbClStatus( int status );
01001 
01002 //
01003 // ui_addbots.c
01004 //
01005 void UI_AddBots_Cache( void );
01006 void UI_AddBotsMenu( void );
01007 
01008 //
01009 // ui_removebots.c
01010 //
01011 void UI_RemoveBots_Cache( void );
01012 void UI_RemoveBotsMenu( void );
01013 
01014 //
01015 // ui_teamorders.c
01016 //
01017 extern void UI_TeamOrdersMenu( void );
01018 extern void UI_TeamOrdersMenu_f( void );
01019 extern void UI_TeamOrdersMenu_Cache( void );
01020 
01021 //
01022 // ui_loadconfig.c
01023 //
01024 void UI_LoadConfig_Cache( void );
01025 void UI_LoadConfigMenu( void );
01026 
01027 //
01028 // ui_saveconfig.c
01029 //
01030 void UI_SaveConfigMenu_Cache( void );
01031 void UI_SaveConfigMenu( void );
01032 
01033 //
01034 // ui_display.c
01035 //
01036 void UI_DisplayOptionsMenu_Cache( void );
01037 void UI_DisplayOptionsMenu( void );
01038 
01039 //
01040 // ui_sound.c
01041 //
01042 void UI_SoundOptionsMenu_Cache( void );
01043 void UI_SoundOptionsMenu( void );
01044 
01045 //
01046 // ui_network.c
01047 //
01048 void UI_NetworkOptionsMenu_Cache( void );
01049 void UI_NetworkOptionsMenu( void );
01050 
01051 //
01052 // ui_gameinfo.c
01053 //
01054 typedef enum {
01055     AWARD_ACCURACY,
01056     AWARD_IMPRESSIVE,
01057     AWARD_EXCELLENT,
01058     AWARD_GAUNTLET,
01059     AWARD_FRAGS,
01060     AWARD_PERFECT
01061 } awardType_t;
01062 
01063 const char *UI_GetArenaInfoByNumber( int num );
01064 const char *UI_GetArenaInfoByMap( const char *map );
01065 const char *UI_GetSpecialArenaInfo( const char *tag );
01066 int UI_GetNumArenas( void );
01067 int UI_GetNumSPArenas( void );
01068 int UI_GetNumSPTiers( void );
01069 
01070 char *UI_GetBotInfoByNumber( int num );
01071 char *UI_GetBotInfoByName( const char *name );
01072 int UI_GetNumBots( void );
01073 void UI_LoadBots( void );
01074 char *UI_GetBotNameByNumber( int num );
01075 
01076 void UI_GetBestScore( int level, int *score, int *skill );
01077 void UI_SetBestScore( int level, int score );
01078 int UI_TierCompleted( int levelWon );
01079 qboolean UI_ShowTierVideo( int tier );
01080 qboolean UI_CanShowTierVideo( int tier );
01081 int  UI_GetCurrentGame( void );
01082 void UI_NewGame( void );
01083 void UI_LogAwardData( int award, int data );
01084 int UI_GetAwardLevel( int award );
01085 
01086 void UI_SPUnlock_f( void );
01087 void UI_SPUnlockMedals_f( void );
01088 
01089 void UI_InitGameinfo( void );
01090 
01091 //
01092 // ui_login.c
01093 //
01094 void Login_Cache( void );
01095 void UI_LoginMenu( void );
01096 
01097 //
01098 // ui_signup.c
01099 //
01100 void Signup_Cache( void );
01101 void UI_SignupMenu( void );
01102 
01103 //
01104 // ui_rankstatus.c
01105 //
01106 void RankStatus_Cache( void );
01107 void UI_RankStatusMenu( void );
01108 
01109 
01110 // new ui 
01111 
01112 #define ASSET_BACKGROUND "uiBackground"
01113 
01114 // for tracking sp game info in Team Arena
01115 typedef struct postGameInfo_s {
01116     int score;
01117     int redScore;
01118     int blueScore;
01119     int perfects;
01120     int accuracy;
01121     int impressives;
01122     int excellents;
01123     int defends;
01124     int assists;
01125     int gauntlets;
01126     int captures;
01127     int time;
01128     int timeBonus;
01129     int shutoutBonus;
01130     int skillBonus;
01131     int baseScore;
01132 } postGameInfo_t;
01133 
01134 
01135 
01136 #endif

Generated on Thu Aug 25 12:37:40 2005 for Quake III Arena by  doxygen 1.3.9.1