Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8739 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 23, 2006, 10:59:35 AM (18 years ago)
Author:
rennerc
Message:

showing/hiding frags works now

Location:
branches/network/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/util/multiplayer_team_deathmatch.cc

    r8738 r8739  
    7070 
    7171  this->box = NULL;
     72  this->table = NULL;
     73  this->statsBox = NULL;
    7274
    7375  this->deathScreen = new ImagePlane();
     
    8486  subscribeEvent( ES_GAME, SDLK_TAB );
    8587  subscribeEvent( ES_GAME, SDLK_F1 );
     88  subscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 );
    8689 
    8790  this->notifier = new OrxGui::GLGuiNotifier();
     
    106109  unsubscribeEvent( ES_GAME, SDLK_TAB );
    107110  unsubscribeEvent( ES_GAME, SDLK_F1 );
     111  unsubscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 );
    108112 
    109113  if ( this->notifier )
     
    178182void MultiplayerTeamDeathmatch::tick(float dt)
    179183{
     184  tickStatsTable();
    180185  //on client side hostId is -1 until hanshake finished
    181186  if ( SharedNetworkData::getInstance()->getHostID() < 0 )
     
    582587    }
    583588  }
     589  else if ( statsBox && event.type == KeyMapper::PEV_FIRE1 )
     590  {
     591    this->hideStats();
     592  }
    584593}
    585594
     
    638647  statsBox->setAbsCoor2D( 300, 100 );
    639648 
    640   OrxGui::GLGuiTable * table = new OrxGui::GLGuiTable( 4, 4 );
    641  
    642   statsBox->pack( table );
    643  
    644   //table->setColumnWidth( 0, 500.0f );
    645   //table->setColumnWidth( 1, 500.0f );
    646  
    647   //table->setRowHeight( 0, 500 );
    648  
    649   table->setEntry( 0, 1, "Red Team" );
    650   table->setEntry( 1, 1, "Blue Team" );
    651  
    652   //table->setRowHeight( 1, 500 );
    653   //table->setRowHeight( 2, 500 );
    654  
    655   //table->setEntry( 0, 2, "Johan Vogel" );
    656   //table->setEntry( 1, 2, "Koebi Kuhn" );
     649  this->table = new OrxGui::GLGuiTable(4, 4);
     650
     651  statsBox->pack( this->table );
     652 
     653  statsBox->setAbsCoor2D(50, 200);
    657654 
    658655  statsBox->showAll();
     
    664661void MultiplayerTeamDeathmatch::hideStats( )
    665662{
    666 }
    667 
    668 
    669 
    670 
     663    if ( statsBox )
     664    {
     665      delete statsBox;
     666      statsBox = NULL;
     667    }
     668     
     669    EventHandler::getInstance()->popState();
     670}
     671
     672/**
     673 * fill stats table with values
     674 */
     675void MultiplayerTeamDeathmatch::tickStatsTable( )
     676{
     677  if ( !this->statsBox )
     678    return;
     679
     680  std::vector<std::string> headers;
     681  headers.push_back("Red Team");
     682  headers.push_back("");
     683  headers.push_back("Blue Team");
     684  headers.push_back("");
     685  this->table->setHeader(headers);
     686 
     687  this->table->setEntry( 0, 1, "Alain Sutter" );
     688  this->table->setEntry( 1, 1, "0" );
     689  this->table->setEntry( 2, 1, "Koebi Kuhn" );
     690  this->table->setEntry( 3, 1, "3" );
     691}
     692
     693
     694
     695
  • branches/network/src/util/multiplayer_team_deathmatch.h

    r8738 r8739  
    102102   
    103103    OrxGui::GLGuiBox* statsBox;
     104    OrxGui::GLGuiTable* table;
     105    void tickStatsTable();
    104106   
    105107    void showStats();
Note: See TracChangeset for help on using the changeset viewer.