Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6862 in orxonox.OLD


Ignore:
Timestamp:
Jan 30, 2006, 11:22:25 AM (18 years ago)
Author:
patrick
Message:

trunk: the game now always jumps back to the menu

Location:
trunk/src
Files:
5 edited

Legend:

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

    r6834 r6862  
    106106{
    107107  PRINTF(4)("Stopping the current Campaign\n");
    108   this->isRunning = false;
     108  //this->isRunning = false;
    109109  if( this->currentEntity != NULL)
    110110  {
     111    this->currentEntity->setNextStoryID(0);
    111112    this->currentEntity->stop();
    112113  }
     
    134135    this->currentEntity->unloadData();
    135136  }
    136   PRINTF(2)("There is no StoryEnity left to play, quitting\n");
     137  PRINTF(2)("There is no StoryEnity left to play, returning to Main Menu\n");
    137138}
    138139
  • trunk/src/story_entities/simple_game_menu.cc

    r6855 r6862  
    5959  this->menuLayer.push_back(new MenuLayer());
    6060  this->menuLayer.push_back(new MenuLayer());
     61
    6162  this->layerIndex = 0;
     63  this->menuSelectedIndex = 0;
    6264
    6365  this->loadParams(root);
     
    114116
    115117  GraphicsEngine::getInstance()->displayFPS(false);
     118
     119  this->layerIndex = 0;
     120  this->menuSelectedIndex = 0;
    116121}
    117122
     
    205210
    206211
     212ErrorMessage SimpleGameMenu::unloadData()
     213{
     214  GameWorld::unloadData();
     215
     216  EventHandler::getInstance()->unsubscribe(this, ES_MENU);
     217
     218  std::vector<ImageEntity*>::iterator it;
     219  std::vector<MenuLayer*>::iterator mit;
     220  for(mit = this->menuLayer.begin(); mit != this->menuLayer.end(); mit++)
     221  {
     222    (*mit)->menuList.erase((*mit)->menuList.begin(), (*mit)->menuList.end());
     223    (*mit)->storyList.erase((*mit)->storyList.begin(), (*mit)->storyList.end());
     224  }
     225}
     226
    207227
    208228/**
  • trunk/src/story_entities/simple_game_menu.h

    r6839 r6862  
    5050    virtual ErrorMessage init();
    5151    virtual ErrorMessage loadData();
     52    virtual ErrorMessage unloadData();
    5253
    5354    virtual bool start();
  • trunk/src/util/loading/game_loader.cc

    r6854 r6862  
    4747  this->setClassID(CL_GAME_LOADER, "GameLoader");
    4848  this->setName("GameLoader");
    49 
     49  this->bRun = true;
    5050}
    5151
     
    162162{
    163163  if(this->currentCampaign != NULL)
     164  {
    164165    this->currentCampaign->start();
     166  }
    165167}
    166168
  • trunk/src/util/loading/game_loader.h

    r6424 r6862  
    7070  Uint32                 startTime;            //!< start time of the campaign
    7171  bool                   isPaused;             //!< if the game is paused
     72  bool                   bRun;                 //!< true if stop
    7273
    7374  Campaign*              currentCampaign;      //!< reference to the current campaign playing
Note: See TracChangeset for help on using the changeset viewer.