#include <gTeam.h>
Static Public Member Functions | |
static void | TeamMenu () |
Definition at line 34 of file gTeam.h.
void gTeam::TeamMenu | ( | ) | [static] |
Definition at line 301 of file gTeam.cpp.
References uMenu::Enter(), GrowingArrayBase::Len(), MAX_PLAYERS, ePlayer::Name(), ePlayer::PlayerConfig(), ePlayer::PlayerIsInGame(), tOutput::SetTemplateParameter(), and tNEW.
Referenced by MainMenu().
00302 { 00303 int i; 00304 00305 uMenu Menu( tOutput("$team_menu_title") ); 00306 tArray<uMenuItem*> items; 00307 00308 for ( i = MAX_PLAYERS; i>=0; --i ) 00309 { 00310 if ( ePlayer::PlayerIsInGame(i)) 00311 { 00312 ePlayer* player = ePlayer::PlayerConfig( i ); 00313 tOutput help; 00314 help.SetTemplateParameter(1, player->Name() ); 00315 help << "$team_menu_player_help"; 00316 ePlayerNetID* pni = player->netPlayer; 00317 if ( pni ) 00318 items[ items.Len() ] = tNEW( gMenuItemPlayer ) ( &Menu, pni, help ); 00319 } 00320 } 00321 00322 if ( items.Len() > 1 ) 00323 { 00324 Menu.Enter(); 00325 } 00326 else if ( items.Len() >= 1 ) 00327 { 00328 items[0]->Enter(); 00329 } 00330 00331 for ( i = items.Len()-1; i>=0; --i ) 00332 { 00333 delete items(i); 00334 } 00335 }