Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6854 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 30, 2006, 3:51:42 AM (19 years ago)
Author:
patrick
Message:

trunk: the menu now works

Location:
trunk/src
Files:
2 edited

Legend:

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

    r6853 r6854  
    109109  EventHandler::getInstance()->subscribe(this, ES_MENU, SDLK_RETURN);
    110110  EventHandler::getInstance()->subscribe(this, ES_MENU, SDLK_SPACE);
     111  EventHandler::getInstance()->subscribe(this, ES_MENU, SDLK_ESCAPE);
    111112
    112113  this->dataTank->localCamera->setRelCoor(this->cameraVector);
     
    196197      PRINTF(0)("setting texture to: |%s|\n", se->getMenuItemImage());
    197198      ie->setTexture(se->getMenuItemImage());
    198       ie->setRelCoor(0.0f,- (this->menuLayer[1]->menuList.size() * 10.0f), 0.0f);
     199      ie->setRelCoor(0.0f,20.0f - (this->menuLayer[1]->menuList.size() * 10.0f), 0.0f);
    199200      ie->setVisibility(false);
    200201      this->menuLayer[1]->menuList.push_back(ie);
     
    280281      if( this->menuSelected == this->menuStartGame)
    281282      {
    282         //this->stop();
    283283        // switch to first submenu
    284284        if( this->menuLayer[1]->menuList.size() == 0)
     
    291291      }
    292292    }
     293    if( event.type == SDLK_ESCAPE && event.bPressed == true)
     294    {
     295      this->setNextStoryID(WORLD_ID_GAMEEND);
     296      this->stop();
     297    }
    293298  }  /* ----------------- LAYER 2 ---------------*/
    294299  else if( this->layerIndex == 1)
     
    298303      this->setNextStoryID( this->menuLayer[1]->storyList[this->menuSelectedIndex]->getStoryID());
    299304      this->stop();
     305    }
     306    if( event.type == SDLK_ESCAPE && event.bPressed == true)
     307    {
     308      this->switchMenuLayer(this->layerIndex, 0);
    300309    }
    301310  }
     
    352361
    353362  this->layerIndex = layer2;
     363  this->menuSelected = this->menuLayer[layer2]->menuList[0];
     364  this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor());
    354365}
    355366
  • trunk/src/util/loading/game_loader.cc

    r6424 r6854  
    7373  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_PAUSE);
    7474  this->eventHandler->subscribe(this, ES_ALL, EV_MAIN_QUIT);          //< External Quit Event
    75   this->eventHandler->subscribe(this, ES_ALL, KeyMapper::PEV_QUIT);
     75  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_QUIT);
    7676  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_NEXT_WORLD);
    7777  this->eventHandler->subscribe(this, ES_GAME, KeyMapper::PEV_PREVIOUS_WORLD);
Note: See TracChangeset for help on using the changeset viewer.