#include "ui_local.h"
Include dependency graph for ui_teamorders.c:

Go to the source code of this file.
Data Structures | |
| struct | teamOrdersMenuInfo_t |
Defines | |
| #define | ART_BACK0 "menu/art/back_0" |
| #define | ART_BACK1 "menu/art/back_1" |
| #define | ART_FRAME "menu/art/addbotframe" |
| #define | ID_LIST_BOTS 10 |
| #define | ID_LIST_CTF_ORDERS 11 |
| #define | ID_LIST_TEAM_ORDERS 12 |
| #define | NUM_CTF_ORDERS 7 |
| #define | NUM_TEAM_ORDERS 6 |
Functions | |
| void | UI_TeamOrdersMenu (void) |
| void | UI_TeamOrdersMenu_BackEvent (void *ptr, int event) |
| void | UI_TeamOrdersMenu_BuildBotList (void) |
| void | UI_TeamOrdersMenu_Cache (void) |
| void | UI_TeamOrdersMenu_f (void) |
| void | UI_TeamOrdersMenu_Init (void) |
| sfxHandle_t | UI_TeamOrdersMenu_Key (int key) |
| void | UI_TeamOrdersMenu_ListDraw (void *self) |
| void | UI_TeamOrdersMenu_ListEvent (void *ptr, int event) |
| void | UI_TeamOrdersMenu_SetList (int id) |
Variables | |
| const char * | ctfMessages [] |
| const char * | ctfOrders [] |
| const char * | teamMessages [] |
| const char * | teamOrders [] |
| teamOrdersMenuInfo_t | teamOrdersMenuInfo |
|
|
Definition at line 36 of file ui_teamorders.c. |
|
|
Definition at line 37 of file ui_teamorders.c. |
|
|
Definition at line 35 of file ui_teamorders.c. |
|
|
Definition at line 39 of file ui_teamorders.c. Referenced by UI_TeamOrdersMenu_Init(), and UI_TeamOrdersMenu_SetList(). |
|
|
Definition at line 40 of file ui_teamorders.c. Referenced by UI_TeamOrdersMenu_ListEvent(), and UI_TeamOrdersMenu_SetList(). |
|
|
Definition at line 41 of file ui_teamorders.c. Referenced by UI_TeamOrdersMenu_ListEvent(), and UI_TeamOrdersMenu_SetList(). |
|
|
Definition at line 63 of file ui_teamorders.c. |
|
|
Definition at line 85 of file ui_teamorders.c. |
|
|
Definition at line 417 of file ui_teamorders.c. References teamOrdersMenuInfo_t::menu, teamOrdersMenuInfo, UI_PushMenu(), and UI_TeamOrdersMenu_Init(). 00417 {
00418 UI_TeamOrdersMenu_Init();
00419 UI_PushMenu( &teamOrdersMenuInfo.menu );
00420 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 111 of file ui_teamorders.c. References UI_PopMenu(). 00111 {
00112 if( event != QM_ACTIVATED ) {
00113 return;
00114 }
00115 UI_PopMenu();
00116 }
|
Here is the call graph for this function:

|
|
Definition at line 293 of file ui_teamorders.c. References atoi, teamOrdersMenuInfo_t::botNames, teamOrdersMenuInfo_t::bots, uiClientState_t::clientNum, CS_PLAYERS, CS_SERVERINFO, teamOrdersMenuInfo_t::gametype, Info_ValueForKey(), MAX_INFO_STRING, n, teamOrdersMenuInfo_t::numBots, Q_CleanStr(), Q_strncpyz(), teamOrdersMenuInfo, trap_GetClientState(), and trap_GetConfigString(). Referenced by UI_TeamOrdersMenu_Init(). 00293 {
00294 uiClientState_t cs;
00295 int numPlayers;
00296 int isBot;
00297 int n;
00298 char playerTeam;
00299 char botTeam;
00300 char info[MAX_INFO_STRING];
00301
00302 for( n = 0; n < 9; n++ ) {
00303 teamOrdersMenuInfo.bots[n] = teamOrdersMenuInfo.botNames[n];
00304 }
00305
00306 trap_GetClientState( &cs );
00307
00308 Q_strncpyz( teamOrdersMenuInfo.botNames[0], "Everyone", 16 );
00309 teamOrdersMenuInfo.numBots = 1;
00310
00311 trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
00312 numPlayers = atoi( Info_ValueForKey( info, "sv_maxclients" ) );
00313 teamOrdersMenuInfo.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) );
00314
00315 for( n = 0; n < numPlayers && teamOrdersMenuInfo.numBots < 9; n++ ) {
00316 trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING );
00317
00318 playerTeam = TEAM_SPECTATOR; // bk001204 = possible uninit use
00319
00320 if( n == cs.clientNum ) {
00321 playerTeam = *Info_ValueForKey( info, "t" );
00322 continue;
00323 }
00324
00325 isBot = atoi( Info_ValueForKey( info, "skill" ) );
00326 if( !isBot ) {
00327 continue;
00328 }
00329
00330 botTeam = *Info_ValueForKey( info, "t" );
00331 if( botTeam != playerTeam ) {
00332 continue;
00333 }
00334
00335 Q_strncpyz( teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.numBots], Info_ValueForKey( info, "n" ), 16 );
00336 Q_CleanStr( teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.numBots] );
00337 teamOrdersMenuInfo.numBots++;
00338 }
00339 }
|
Here is the call graph for this function:

|
|
Definition at line 405 of file ui_teamorders.c. References ART_BACK0, ART_BACK1, ART_FRAME, and trap_R_RegisterShaderNoMip(). 00405 {
00406 trap_R_RegisterShaderNoMip( ART_FRAME );
00407 trap_R_RegisterShaderNoMip( ART_BACK0 );
00408 trap_R_RegisterShaderNoMip( ART_BACK1 );
00409 }
|
Here is the call graph for this function:

|
|
Definition at line 428 of file ui_teamorders.c. References atoi, uiClientState_t::clientNum, CS_PLAYERS, CS_SERVERINFO, teamOrdersMenuInfo_t::gametype, Info_ValueForKey(), MAX_INFO_STRING, teamOrdersMenuInfo, trap_GetClientState(), trap_GetConfigString(), and UI_TeamOrdersMenu(). 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 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 155 of file ui_teamorders.c. References menucommon_s::bottom, menucommon_s::callback, uiStatic_t::cursory, menulist_s::curvalue, menulist_s::generic, K_DOWNARROW, K_KP_DOWNARROW, K_KP_UPARROW, K_MOUSE1, K_UPARROW, l, menucommon_s::left, teamOrdersMenuInfo_t::list, teamOrdersMenuInfo_t::menu, Menu_DefaultKey(), Menu_ItemAtCursor(), menulist_s::numitems, menulist_s::oldvalue, QM_ACTIVATED, menucommon_s::right, sfxHandle_t, teamOrdersMenuInfo, menucommon_s::top, UI_CursorInRect(), uis, x, and y. 00155 {
00156 menulist_s *l;
00157 int x;
00158 int y;
00159 int index;
00160
00161 l = (menulist_s *)Menu_ItemAtCursor( &teamOrdersMenuInfo.menu );
00162 if( l != &teamOrdersMenuInfo.list ) {
00163 return Menu_DefaultKey( &teamOrdersMenuInfo.menu, key );
00164 }
00165
00166 switch( key ) {
00167 case K_MOUSE1:
00168 x = l->generic.left;
00169 y = l->generic.top;
00170 if( UI_CursorInRect( x, y, l->generic.right - x, l->generic.bottom - y ) ) {
00171 index = (uis.cursory - y) / PROP_HEIGHT;
00172 l->oldvalue = l->curvalue;
00173 l->curvalue = index;
00174
00175 if( l->generic.callback ) {
00176 l->generic.callback( l, QM_ACTIVATED );
00177 return menu_move_sound;
00178 }
00179 }
00180 return menu_null_sound;
00181
00182 case K_KP_UPARROW:
00183 case K_UPARROW:
00184 l->oldvalue = l->curvalue;
00185
00186 if( l->curvalue == 0 ) {
00187 l->curvalue = l->numitems - 1;
00188 }
00189 else {
00190 l->curvalue--;
00191 }
00192 return menu_move_sound;
00193
00194 case K_KP_DOWNARROW:
00195 case K_DOWNARROW:
00196 l->oldvalue = l->curvalue;
00197
00198 if( l->curvalue == l->numitems - 1 ) {
00199 l->curvalue = 0;;
00200 }
00201 else {
00202 l->curvalue++;
00203 }
00204 return menu_move_sound;
00205 }
00206
00207 return Menu_DefaultKey( &teamOrdersMenuInfo.menu, key );
00208 }
|
Here is the call graph for this function:

|
|
Definition at line 216 of file ui_teamorders.c. References _tag_menuframework::cursor, menulist_s::curvalue, menulist_s::generic, i, menulist_s::itemnames, l, menucommon_s::menuPosition, menulist_s::numitems, menucommon_s::parent, qboolean, UI_DrawProportionalString(), UI_LEFT, UI_SMALLFONT, x, menucommon_s::y, and y. 00216 {
00217 menulist_s *l;
00218 int x;
00219 int y;
00220 int i;
00221 float *color;
00222 qboolean hasfocus;
00223 int style;
00224
00225 l = (menulist_s *)self;
00226
00227 hasfocus = (l->generic.parent->cursor == l->generic.menuPosition);
00228
00229 x = 320;//l->generic.x;
00230 y = l->generic.y;
00231 for( i = 0; i < l->numitems; i++ ) {
00232 style = UI_LEFT|UI_SMALLFONT|UI_CENTER;
00233 if( i == l->curvalue ) {
00234 color = color_yellow;
00235 if( hasfocus ) {
00236 style |= UI_PULSE;
00237 }
00238 }
00239 else {
00240 color = color_orange;
00241 }
00242
00243 UI_DrawProportionalString( x, y, l->itemnames[i], style, color );
00244 y += PROP_HEIGHT;
00245 }
00246 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 254 of file ui_teamorders.c. References teamOrdersMenuInfo_t::botNames, Com_sprintf(), ctfMessages, EXEC_APPEND, teamOrdersMenuInfo_t::gametype, menucommon_s::id, ID_LIST_CTF_ORDERS, ID_LIST_TEAM_ORDERS, teamOrdersMenuInfo_t::selectedBot, teamMessages, teamOrdersMenuInfo, trap_Cmd_ExecuteText(), UI_PopMenu(), UI_TeamOrdersMenu_SetList(), and va(). 00254 {
00255 int id;
00256 int selection;
00257 char message[256];
00258
00259 if (event != QM_ACTIVATED)
00260 return;
00261
00262 id = ((menulist_s *)ptr)->generic.id;
00263 selection = ((menulist_s *)ptr)->curvalue;
00264
00265 if( id == ID_LIST_BOTS ) {
00266 teamOrdersMenuInfo.selectedBot = selection;
00267 if( teamOrdersMenuInfo.gametype == GT_CTF ) {
00268 UI_TeamOrdersMenu_SetList( ID_LIST_CTF_ORDERS );
00269 }
00270 else {
00271 UI_TeamOrdersMenu_SetList( ID_LIST_TEAM_ORDERS );
00272 }
00273 return;
00274 }
00275
00276 if( id == ID_LIST_CTF_ORDERS ) {
00277 Com_sprintf( message, sizeof(message), ctfMessages[selection], teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.selectedBot] );
00278 }
00279 else {
00280 Com_sprintf( message, sizeof(message), teamMessages[selection], teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.selectedBot] );
00281 }
00282
00283 trap_Cmd_ExecuteText( EXEC_APPEND, va( "say_team \"%s\"\n", message ) );
00284 UI_PopMenu();
00285 }
|
Here is the call graph for this function:

|
|
|
Initial value: {
"i am the leader",
"%s defend the base",
"%s follow me",
"%s get enemy flag",
"%s camp here",
"%s report",
"i stop being the leader",
NULL
}
Definition at line 74 of file ui_teamorders.c. Referenced by UI_TeamOrdersMenu_ListEvent(). |
|
|
Initial value: {
"I Am the Leader",
"Defend the Base",
"Follow Me",
"Get Enemy Flag",
"Camp Here",
"Report",
"I Relinquish Command",
NULL
}
Definition at line 64 of file ui_teamorders.c. |
|
|
Initial value: {
"i am the leader",
"%s follow me",
"%s roam",
"%s camp here",
"%s report",
"i stop being the leader",
NULL
}
Definition at line 95 of file ui_teamorders.c. Referenced by UI_TeamOrdersMenu_ListEvent(). |
|
|
Initial value: {
"I Am the Leader",
"Follow Me",
"Roam",
"Camp Here",
"Report",
"I Relinquish Command",
NULL
}
Definition at line 86 of file ui_teamorders.c. |
|
|
Definition at line 61 of file ui_teamorders.c. Referenced by UI_TeamOrdersMenu(), UI_TeamOrdersMenu_BuildBotList(), UI_TeamOrdersMenu_f(), UI_TeamOrdersMenu_Init(), UI_TeamOrdersMenu_Key(), UI_TeamOrdersMenu_ListEvent(), and UI_TeamOrdersMenu_SetList(). |
1.3.9.1