Changeset 10718 in orxonox.OLD for branches/presentation/src/world_entities/creatures
- Timestamp:
- Jun 18, 2007, 5:06:59 PM (17 years ago)
- Location:
- branches/presentation/src/world_entities/creatures
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/creatures/fps_player.cc
r10714 r10718 42 42 #include "shared_network_data.h" 43 43 44 #include "event_handler.h" 45 46 #include "story_entity.h" 44 47 45 48 … … 126 129 registerEvent(KeyMapper::PEV_FIRE1); 127 130 registerEvent(EV_MOUSE_MOTION); 131 132 this->deadBox = NULL; 128 133 129 134 // weapon manager for the fps … … 276 281 void FPSPlayer::tick (float time) 277 282 { 278 // Second init-step 283 if ( deadBox != NULL ) 284 { 285 OrxGui::GLGuiHandler::getInstance()->tick( time ); 286 } 287 288 // Second init-step 279 289 if ( !this->initWeapon ) 280 290 { … … 587 597 { 588 598 Playable::destroy( killer ); 589 599 this->showDeadScreen(); 600 myList = this->getOMListNumber(); 590 601 toList( OM_DEAD ); 591 602 } … … 595 606 State::getPlayer()->hud().notifyUser(message); 596 607 } 608 609 void FPSPlayer::onButtonContinue( ) 610 { 611 OrxGui::GLGuiHandler::getInstance()->deactivateCursor( true ); 612 EventHandler::getInstance()->popState(); 613 WorldEntity::reset(); 614 toList( myList ); 615 deadBox->hideAll(); 616 } 617 618 void FPSPlayer::onButtonExit( ) 619 { 620 State::getCurrentStoryEntity()->setNextStoryID( 0 ); 621 State::getCurrentStoryEntity()->stop(); 622 } 623 624 void FPSPlayer::showDeadScreen( ) 625 { 626 EventHandler::getInstance()->pushState( ES_MENU ); 627 628 OrxGui::GLGuiHandler::getInstance()->activateCursor(); 629 630 if ( deadBox ) 631 delete deadBox; 632 deadBox = new OrxGui::GLGuiBox(); 633 deadBox->setAbsCoor2D( 100, 100 ); 634 635 OrxGui::GLGuiText* text = new OrxGui::GLGuiText(); 636 text->setText( "Game Over! - You died!" ); 637 OrxGui::GLGuiPushButton* exitButton = new OrxGui::GLGuiPushButton( "exit" ); 638 exitButton->released.connect(this, &FPSPlayer::onButtonExit); 639 OrxGui::GLGuiPushButton* continueButton = new OrxGui::GLGuiPushButton( "continue" ); 640 continueButton->released.connect(this, &FPSPlayer::onButtonContinue); 641 642 deadBox->pack( text ); 643 deadBox->pack( continueButton ); 644 deadBox->pack( exitButton ); 645 646 deadBox->showAll(); 647 } -
branches/presentation/src/world_entities/creatures/fps_player.h
r10705 r10718 9 9 10 10 #include "playable.h" 11 #include "glgui.h" 11 12 12 13 … … 76 77 FPSSniperRifle* weapon; 77 78 79 OM_LIST myList; 80 OrxGui::GLGuiBox* deadBox; 81 void onButtonContinue(); 82 void onButtonExit(); 83 void showDeadScreen(); 84 78 85 }; 79 86
Note: See TracChangeset
for help on using the changeset viewer.