Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 18, 2007, 5:06:59 PM (17 years ago)
Author:
rennerc
Message:

dead gui :D

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r10714 r10718  
    4242#include "shared_network_data.h"
    4343
     44#include "event_handler.h"
     45
     46#include "story_entity.h"
    4447
    4548
     
    126129  registerEvent(KeyMapper::PEV_FIRE1);
    127130  registerEvent(EV_MOUSE_MOTION);
     131 
     132  this->deadBox = NULL;
    128133
    129134  // weapon manager for the fps
     
    276281void FPSPlayer::tick (float time)
    277282{
    278      // Second init-step
     283  if ( deadBox != NULL )
     284  {
     285    OrxGui::GLGuiHandler::getInstance()->tick( time );
     286  }
     287     
     288  // Second init-step
    279289  if ( !this->initWeapon )
    280290  {
     
    587597{
    588598  Playable::destroy( killer );
    589 
     599  this->showDeadScreen();
     600  myList = this->getOMListNumber();
    590601  toList( OM_DEAD );
    591602}
     
    595606        State::getPlayer()->hud().notifyUser(message);
    596607}
     608
     609void FPSPlayer::onButtonContinue( )
     610{
     611  OrxGui::GLGuiHandler::getInstance()->deactivateCursor( true );
     612  EventHandler::getInstance()->popState();
     613  WorldEntity::reset();
     614  toList( myList );
     615  deadBox->hideAll();
     616}
     617
     618void FPSPlayer::onButtonExit( )
     619{
     620  State::getCurrentStoryEntity()->setNextStoryID( 0 );
     621  State::getCurrentStoryEntity()->stop();
     622}
     623
     624void 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}
Note: See TracChangeset for help on using the changeset viewer.