Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6874 in orxonox.OLD for trunk/src/story_entities/campaign.cc


Ignore:
Timestamp:
Jan 30, 2006, 11:03:30 PM (18 years ago)
Author:
patrick
Message:

trunk: the menu control better implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/campaign.cc

    r6862 r6874  
    4040  assert( root != NULL);
    4141
     42  this->bReturnToMenu = false;
     43
    4244  this->campaignData = new CampaignData(root);
    4345  this->loadParams(root);
     
    7779
    7880  this->isRunning = true;
     81  this->bReturnToMenu = false;
    7982  this->run();
    8083}
     
    106109{
    107110  PRINTF(4)("Stopping the current Campaign\n");
    108   //this->isRunning = false;
     111  this->bReturnToMenu = true;
    109112  if( this->currentEntity != NULL)
    110113  {
    111     this->currentEntity->setNextStoryID(0);
    112114    this->currentEntity->stop();
    113115  }
     
    129131    PRINTF(0)("Campaign is starting StoryEntity nr:%i\n", this->currentEntity->getStoryID());
    130132
     133    // check if return to menu
     134    if( this->bReturnToMenu)
     135    {
     136      this->currentEntity = this->campaignData->getLevel(WORLD_ID_MENU);
     137      this->bReturnToMenu = false;
     138    }
     139
     140    this->campaignData->setCurrentEntity(this->currentEntity);
     141
    131142    this->currentEntity->init();
    132 
    133143    this->currentEntity->loadData();
    134144    this->currentEntity->start();
    135145    this->currentEntity->unloadData();
    136146  }
    137   PRINTF(2)("There is no StoryEnity left to play, returning to Main Menu\n");
     147  PRINTF(2)("There is no StoryEnity left to play, quitting game\n");
    138148}
    139149
Note: See TracChangeset for help on using the changeset viewer.