Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6839 in orxonox.OLD for trunk/src/story_entities/simple_game_menu.cc


Ignore:
Timestamp:
Jan 30, 2006, 12:52:08 AM (18 years ago)
Author:
patrick
Message:

trunk: the menu is processing

File:
1 edited

Legend:

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

    r6837 r6839  
    5656  this->cameraVector = Vector(50.0, 0.0, 0.0);
    5757  this->menuLayer.push_back(new MenuLayer());
     58  this->menuLayer.push_back(new MenuLayer());
    5859  this->layerIndex = 0;
    5960
     
    150151  this->menuSelected = this->menuLayer[0]->menuList[this->menuSelectedIndex];
    151152  this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor());
     153
     154
     155  // loading the storyentities submenu (singleplayer)
     156  const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
     157  std::list<BaseObject*>::const_iterator it;
     158  for( it = storyEntities->begin(); it != storyEntities->end(); it++)
     159  {
     160    StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
     161    if( se->isContainedInMenu())
     162    {
     163      this->menuLayer[1]->storyList.push_back(se);
     164      PRINTF(0)("Got a new menu entry |%s|\n", se->getName());
     165    }
     166  }
    152167}
    153168
     
    217232void SimpleGameMenu::process(const Event &event)
    218233{
     234  /* ----------------- LAYER 1 ---------------*/
    219235  if( this->layerIndex == 0)
    220236  {
     
    230246        //this->stop();
    231247        // switch to first submenu
    232         if( this->menuLayer[1] == NULL)
     248        if( this->menuLayer[1]->menuList.size() == 0)
    233249        {
    234           PRINTF(1)("Haven't got any Story Entities to play!\n");
     250          PRINTF(1)("Haven't got any StoryEntities to play!\n");
    235251          return;
    236252        }
     
    257273      }
    258274    }
    259   }
     275  }  /* ----------------- LAYER 2 ---------------*/
    260276  else if( this->layerIndex == 1)
    261277  {
Note: See TracChangeset for help on using the changeset viewer.