Changeset 8739 in orxonox.OLD for branches/network
- Timestamp:
- Jun 23, 2006, 10:59:35 AM (18 years ago)
- Location:
- branches/network/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/multiplayer_team_deathmatch.cc
r8738 r8739 70 70 71 71 this->box = NULL; 72 this->table = NULL; 73 this->statsBox = NULL; 72 74 73 75 this->deathScreen = new ImagePlane(); … … 84 86 subscribeEvent( ES_GAME, SDLK_TAB ); 85 87 subscribeEvent( ES_GAME, SDLK_F1 ); 88 subscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 ); 86 89 87 90 this->notifier = new OrxGui::GLGuiNotifier(); … … 106 109 unsubscribeEvent( ES_GAME, SDLK_TAB ); 107 110 unsubscribeEvent( ES_GAME, SDLK_F1 ); 111 unsubscribeEvent( ES_MENU, KeyMapper::PEV_FIRE1 ); 108 112 109 113 if ( this->notifier ) … … 178 182 void MultiplayerTeamDeathmatch::tick(float dt) 179 183 { 184 tickStatsTable(); 180 185 //on client side hostId is -1 until hanshake finished 181 186 if ( SharedNetworkData::getInstance()->getHostID() < 0 ) … … 582 587 } 583 588 } 589 else if ( statsBox && event.type == KeyMapper::PEV_FIRE1 ) 590 { 591 this->hideStats(); 592 } 584 593 } 585 594 … … 638 647 statsBox->setAbsCoor2D( 300, 100 ); 639 648 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); 657 654 658 655 statsBox->showAll(); … … 664 661 void MultiplayerTeamDeathmatch::hideStats( ) 665 662 { 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 */ 675 void 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 102 102 103 103 OrxGui::GLGuiBox* statsBox; 104 OrxGui::GLGuiTable* table; 105 void tickStatsTable(); 104 106 105 107 void showStats();
Note: See TracChangeset
for help on using the changeset viewer.