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

ui_ingame.c File Reference

#include "ui_local.h"

Include dependency graph for ui_ingame.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  ingamemenu_t

Defines

#define ID_ADDBOTS   11
#define ID_LEAVEARENA   15
#define ID_QUIT   17
#define ID_REMOVEBOTS   12
#define ID_RESTART   16
#define ID_RESUME   18
#define ID_SERVERINFO   14
#define ID_SETUP   13
#define ID_TEAM   10
#define ID_TEAMORDERS   19
#define INGAME_FRAME   "menu/art/addbotframe"
#define INGAME_MENU_VERTICAL_SPACING   28

Functions

void InGame_Cache (void)
void InGame_Event (void *ptr, int notification)
void InGame_MenuInit (void)
void InGame_QuitAction (qboolean result)
void InGame_RestartAction (qboolean result)
void UI_InGameMenu (void)

Variables

ingamemenu_t s_ingame


Define Documentation

#define ID_ADDBOTS   11
 

Definition at line 40 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_LEAVEARENA   15
 

Definition at line 44 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_QUIT   17
 

Definition at line 46 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_REMOVEBOTS   12
 

Definition at line 41 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_RESTART   16
 

Definition at line 45 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_RESUME   18
 

Definition at line 47 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_SERVERINFO   14
 

Definition at line 43 of file ui_ingame.c.

Referenced by InGame_Event().

#define ID_SETUP   13
 

Definition at line 42 of file ui_ingame.c.

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

#define ID_TEAM   10
 

Definition at line 39 of file ui_ingame.c.

#define ID_TEAMORDERS   19
 

Definition at line 48 of file ui_ingame.c.

Referenced by InGame_Event().

#define INGAME_FRAME   "menu/art/addbotframe"
 

Definition at line 35 of file ui_ingame.c.

Referenced by InGame_Cache().

#define INGAME_MENU_VERTICAL_SPACING   28
 

Definition at line 37 of file ui_ingame.c.


Function Documentation

void InGame_Cache void   ) 
 

Definition at line 329 of file ui_ingame.c.

References INGAME_FRAME, and trap_R_RegisterShaderNoMip().

Referenced by InGame_MenuInit(), and UI_Cache_f().

00329                           {
00330     trap_R_RegisterShaderNoMip( INGAME_FRAME );
00331 }

Here is the call graph for this function:

void InGame_Event void *  ptr,
int  notification
 

Definition at line 104 of file ui_ingame.c.

References EXEC_APPEND, ID_ADDBOTS, ID_LEAVEARENA, ID_QUIT, ID_REMOVEBOTS, ID_RESTART, ID_RESUME, ID_SERVERINFO, ID_SETUP, ID_TEAM, ID_TEAMORDERS, InGame_QuitAction(), InGame_RestartAction(), NULL, trap_Cmd_ExecuteText(), UI_AddBotsMenu(), UI_ConfirmMenu(), UI_PopMenu(), UI_RemoveBotsMenu(), UI_ServerInfoMenu(), UI_SetupMenu(), UI_TeamMainMenu(), UI_TeamOrdersMenu(), and voidfunc_f.

00104                                                  {
00105     if( notification != QM_ACTIVATED ) {
00106         return;
00107     }
00108 
00109     switch( ((menucommon_s*)ptr)->id ) {
00110     case ID_TEAM:
00111         UI_TeamMainMenu();
00112         break;
00113 
00114     case ID_SETUP:
00115         UI_SetupMenu();
00116         break;
00117 
00118     case ID_LEAVEARENA:
00119         trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect\n" );
00120         break;
00121 
00122     case ID_RESTART:
00123         UI_ConfirmMenu( "RESTART ARENA?", (voidfunc_f)NULL, InGame_RestartAction );
00124         break;
00125 
00126     case ID_QUIT:
00127         UI_ConfirmMenu( "EXIT GAME?",  (voidfunc_f)NULL, InGame_QuitAction );
00128         break;
00129 
00130     case ID_SERVERINFO:
00131         UI_ServerInfoMenu();
00132         break;
00133 
00134     case ID_ADDBOTS:
00135         UI_AddBotsMenu();
00136         break;
00137 
00138     case ID_REMOVEBOTS:
00139         UI_RemoveBotsMenu();
00140         break;
00141 
00142     case ID_TEAMORDERS:
00143         UI_TeamOrdersMenu();
00144         break;
00145 
00146     case ID_RESUME:
00147         UI_PopMenu();
00148         break;
00149     }
00150 }

Here is the call graph for this function:

void InGame_MenuInit void   ) 
 

Definition at line 158 of file ui_ingame.c.

References ingamemenu_t::addbots, atoi, menucommon_s::callback, uiClientState_t::clientNum, menutext_s::color, CS_PLAYERS, menucommon_s::flags, ingamemenu_t::frame, _tag_menuframework::fullscreen, menutext_s::generic, menubitmap_s::generic, menubitmap_s::height, menucommon_s::id, Info_ValueForKey(), InGame_Cache(), ingamemenu_t::leave, MAX_INFO_STRING, memset(), ingamemenu_t::menu, Menu_AddItem(), menucommon_s::name, QMF_CENTER_JUSTIFY, ingamemenu_t::quit, ingamemenu_t::removebots, ingamemenu_t::restart, ingamemenu_t::resume, s_ingame, ingamemenu_t::server, ingamemenu_t::setup, menutext_s::string, menutext_s::style, ingamemenu_t::team, ingamemenu_t::teamorders, trap_Cvar_VariableValue(), trap_GetClientState(), trap_GetConfigString(), menucommon_s::type, UI_CENTER, menubitmap_s::width, _tag_menuframework::wrapAround, menucommon_s::x, y, and menucommon_s::y.

Referenced by UI_InGameMenu().

00158                              {
00159     int     y;
00160     uiClientState_t cs;
00161     char    info[MAX_INFO_STRING];
00162     int     team;
00163 
00164     memset( &s_ingame, 0 ,sizeof(ingamemenu_t) );
00165 
00166     InGame_Cache();
00167 
00168     s_ingame.menu.wrapAround = qtrue;
00169     s_ingame.menu.fullscreen = qfalse;
00170 
00171     s_ingame.frame.generic.type         = MTYPE_BITMAP;
00172     s_ingame.frame.generic.flags        = QMF_INACTIVE;
00173     s_ingame.frame.generic.name         = INGAME_FRAME;
00174     s_ingame.frame.generic.x            = 320-233;//142;
00175     s_ingame.frame.generic.y            = 240-166;//118;
00176     s_ingame.frame.width                = 466;//359;
00177     s_ingame.frame.height               = 332;//256;
00178 
00179     //y = 96;
00180     y = 88;
00181     s_ingame.team.generic.type          = MTYPE_PTEXT;
00182     s_ingame.team.generic.flags         = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00183     s_ingame.team.generic.x             = 320;
00184     s_ingame.team.generic.y             = y;
00185     s_ingame.team.generic.id            = ID_TEAM;
00186     s_ingame.team.generic.callback      = InGame_Event; 
00187     s_ingame.team.string                = "START";
00188     s_ingame.team.color                 = color_red;
00189     s_ingame.team.style                 = UI_CENTER|UI_SMALLFONT;
00190 
00191     y += INGAME_MENU_VERTICAL_SPACING;
00192     s_ingame.addbots.generic.type       = MTYPE_PTEXT;
00193     s_ingame.addbots.generic.flags      = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00194     s_ingame.addbots.generic.x          = 320;
00195     s_ingame.addbots.generic.y          = y;
00196     s_ingame.addbots.generic.id         = ID_ADDBOTS;
00197     s_ingame.addbots.generic.callback   = InGame_Event; 
00198     s_ingame.addbots.string             = "ADD BOTS";
00199     s_ingame.addbots.color              = color_red;
00200     s_ingame.addbots.style              = UI_CENTER|UI_SMALLFONT;
00201     if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {
00202         s_ingame.addbots.generic.flags |= QMF_GRAYED;
00203     }
00204 
00205     y += INGAME_MENU_VERTICAL_SPACING;
00206     s_ingame.removebots.generic.type        = MTYPE_PTEXT;
00207     s_ingame.removebots.generic.flags       = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00208     s_ingame.removebots.generic.x           = 320;
00209     s_ingame.removebots.generic.y           = y;
00210     s_ingame.removebots.generic.id          = ID_REMOVEBOTS;
00211     s_ingame.removebots.generic.callback    = InGame_Event; 
00212     s_ingame.removebots.string              = "REMOVE BOTS";
00213     s_ingame.removebots.color               = color_red;
00214     s_ingame.removebots.style               = UI_CENTER|UI_SMALLFONT;
00215     if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {
00216         s_ingame.removebots.generic.flags |= QMF_GRAYED;
00217     }
00218 
00219     y += INGAME_MENU_VERTICAL_SPACING;
00220     s_ingame.teamorders.generic.type        = MTYPE_PTEXT;
00221     s_ingame.teamorders.generic.flags       = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00222     s_ingame.teamorders.generic.x           = 320;
00223     s_ingame.teamorders.generic.y           = y;
00224     s_ingame.teamorders.generic.id          = ID_TEAMORDERS;
00225     s_ingame.teamorders.generic.callback    = InGame_Event; 
00226     s_ingame.teamorders.string              = "TEAM ORDERS";
00227     s_ingame.teamorders.color               = color_red;
00228     s_ingame.teamorders.style               = UI_CENTER|UI_SMALLFONT;
00229     if( !(trap_Cvar_VariableValue( "g_gametype" ) >= GT_TEAM) ) {
00230         s_ingame.teamorders.generic.flags |= QMF_GRAYED;
00231     }
00232     else {
00233         trap_GetClientState( &cs );
00234         trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING );
00235         team = atoi( Info_ValueForKey( info, "t" ) );
00236         if( team == TEAM_SPECTATOR ) {
00237             s_ingame.teamorders.generic.flags |= QMF_GRAYED;
00238         }
00239     }
00240 
00241     y += INGAME_MENU_VERTICAL_SPACING;
00242     s_ingame.setup.generic.type         = MTYPE_PTEXT;
00243     s_ingame.setup.generic.flags        = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00244     s_ingame.setup.generic.x            = 320;
00245     s_ingame.setup.generic.y            = y;
00246     s_ingame.setup.generic.id           = ID_SETUP;
00247     s_ingame.setup.generic.callback     = InGame_Event; 
00248     s_ingame.setup.string               = "SETUP";
00249     s_ingame.setup.color                = color_red;
00250     s_ingame.setup.style                = UI_CENTER|UI_SMALLFONT;
00251 
00252     y += INGAME_MENU_VERTICAL_SPACING;
00253     s_ingame.server.generic.type        = MTYPE_PTEXT;
00254     s_ingame.server.generic.flags       = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00255     s_ingame.server.generic.x           = 320;
00256     s_ingame.server.generic.y           = y;
00257     s_ingame.server.generic.id          = ID_SERVERINFO;
00258     s_ingame.server.generic.callback    = InGame_Event; 
00259     s_ingame.server.string              = "SERVER INFO";
00260     s_ingame.server.color               = color_red;
00261     s_ingame.server.style               = UI_CENTER|UI_SMALLFONT;
00262 
00263     y += INGAME_MENU_VERTICAL_SPACING;
00264     s_ingame.restart.generic.type       = MTYPE_PTEXT;
00265     s_ingame.restart.generic.flags      = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00266     s_ingame.restart.generic.x          = 320;
00267     s_ingame.restart.generic.y          = y;
00268     s_ingame.restart.generic.id         = ID_RESTART;
00269     s_ingame.restart.generic.callback   = InGame_Event; 
00270     s_ingame.restart.string             = "RESTART ARENA";
00271     s_ingame.restart.color              = color_red;
00272     s_ingame.restart.style              = UI_CENTER|UI_SMALLFONT;
00273     if( !trap_Cvar_VariableValue( "sv_running" ) ) {
00274         s_ingame.restart.generic.flags |= QMF_GRAYED;
00275     }
00276 
00277     y += INGAME_MENU_VERTICAL_SPACING;
00278     s_ingame.resume.generic.type            = MTYPE_PTEXT;
00279     s_ingame.resume.generic.flags           = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00280     s_ingame.resume.generic.x               = 320;
00281     s_ingame.resume.generic.y               = y;
00282     s_ingame.resume.generic.id              = ID_RESUME;
00283     s_ingame.resume.generic.callback        = InGame_Event; 
00284     s_ingame.resume.string                  = "RESUME GAME";
00285     s_ingame.resume.color                   = color_red;
00286     s_ingame.resume.style                   = UI_CENTER|UI_SMALLFONT;
00287 
00288     y += INGAME_MENU_VERTICAL_SPACING;
00289     s_ingame.leave.generic.type         = MTYPE_PTEXT;
00290     s_ingame.leave.generic.flags        = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00291     s_ingame.leave.generic.x            = 320;
00292     s_ingame.leave.generic.y            = y;
00293     s_ingame.leave.generic.id           = ID_LEAVEARENA;
00294     s_ingame.leave.generic.callback     = InGame_Event; 
00295     s_ingame.leave.string               = "LEAVE ARENA";
00296     s_ingame.leave.color                = color_red;
00297     s_ingame.leave.style                = UI_CENTER|UI_SMALLFONT;
00298 
00299     y += INGAME_MENU_VERTICAL_SPACING;
00300     s_ingame.quit.generic.type          = MTYPE_PTEXT;
00301     s_ingame.quit.generic.flags         = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
00302     s_ingame.quit.generic.x             = 320;
00303     s_ingame.quit.generic.y             = y;
00304     s_ingame.quit.generic.id            = ID_QUIT;
00305     s_ingame.quit.generic.callback      = InGame_Event; 
00306     s_ingame.quit.string                = "EXIT GAME";
00307     s_ingame.quit.color                 = color_red;
00308     s_ingame.quit.style                 = UI_CENTER|UI_SMALLFONT;
00309 
00310     Menu_AddItem( &s_ingame.menu, &s_ingame.frame );
00311     Menu_AddItem( &s_ingame.menu, &s_ingame.team );
00312     Menu_AddItem( &s_ingame.menu, &s_ingame.addbots );
00313     Menu_AddItem( &s_ingame.menu, &s_ingame.removebots );
00314     Menu_AddItem( &s_ingame.menu, &s_ingame.teamorders );
00315     Menu_AddItem( &s_ingame.menu, &s_ingame.setup );
00316     Menu_AddItem( &s_ingame.menu, &s_ingame.server );
00317     Menu_AddItem( &s_ingame.menu, &s_ingame.restart );
00318     Menu_AddItem( &s_ingame.menu, &s_ingame.resume );
00319     Menu_AddItem( &s_ingame.menu, &s_ingame.leave );
00320     Menu_AddItem( &s_ingame.menu, &s_ingame.quit );
00321 }

Here is the call graph for this function:

void InGame_QuitAction qboolean  result  )  [static]
 

Definition at line 90 of file ui_ingame.c.

References UI_CreditMenu(), and UI_PopMenu().

Referenced by InGame_Event().

00090                                                  {
00091     if( !result ) {
00092         return;
00093     }
00094     UI_PopMenu();
00095     UI_CreditMenu();
00096 }

Here is the call graph for this function:

void InGame_RestartAction qboolean  result  )  [static]
 

Definition at line 75 of file ui_ingame.c.

References EXEC_APPEND, trap_Cmd_ExecuteText(), and UI_PopMenu().

Referenced by InGame_Event().

00075                                                     {
00076     if( !result ) {
00077         return;
00078     }
00079 
00080     UI_PopMenu();
00081     trap_Cmd_ExecuteText( EXEC_APPEND, "map_restart 0\n" );
00082 }

Here is the call graph for this function:

void UI_InGameMenu void   ) 
 

Definition at line 339 of file ui_ingame.c.

References uiStatic_t::cursorx, uiStatic_t::cursory, InGame_MenuInit(), ingamemenu_t::menu, uiStatic_t::menusp, s_ingame, UI_PushMenu(), and uis.

Referenced by UI_SetActiveMenu().

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 }

Here is the call graph for this function:


Variable Documentation

ingamemenu_t s_ingame [static]
 

Definition at line 67 of file ui_ingame.c.

Referenced by InGame_MenuInit(), and UI_InGameMenu().


Generated on Thu Aug 25 14:28:47 2005 for Quake III Arena by  doxygen 1.3.9.1