Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8674 in orxonox.OLD


Ignore:
Timestamp:
Jun 21, 2006, 3:57:37 PM (18 years ago)
Author:
bensch
Message:

Game-Menu begin

Location:
branches/gui/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl/glgui_button.cc

    r8672 r8674  
    9898
    9999
     100  bool GLGuiButton::processEvent(const Event& event)
     101  {
     102    if (event.type == SDLK_SPACE && !event.bPressed)
     103    {
     104      emit(released());
     105      return true;
     106    }
     107    return false;
     108  }
     109
     110
    100111  /**
    101112   * @brief draws the GLGuiButton
  • branches/gui/src/lib/gui/gl/glgui_button.h

    r8667 r8674  
    4040
    4141      virtual void draw() const;
     42      virtual bool processEvent(const Event& event);
    4243
    4344      DeclareSignal0(clicked);
    4445      DeclareSignal0(released);
     46
    4547
    4648    protected:
  • branches/gui/src/story_entities/game_menu.cc

    r8673 r8674  
    134134ErrorMessage GameMenu::loadData()
    135135{
     136  this->mainMenuBox = new OrxGui::GLGuiBox();
     137  {
     138    OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play");
     139    this->mainMenuBox->pack(startButton);
     140
     141
     142    OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit");
     143    this->mainMenuBox->pack(quitButton);
     144    quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu));
     145
     146
     147  }
     148
     149
    136150  GameWorld::loadData();
    137151}
     
    160174{
    161175  EventHandler::getInstance()->pushState(ES_MENU);
     176
     177  this->mainMenuBox->showAll();
    162178
    163179  /* now call the underlying*/
     
    226242void GameMenu::process(const Event &event)
    227243{
     244  if( event.type == SDLK_ESCAPE && event.bPressed == true)
     245  {
     246    this->setNextStoryID(WORLD_ID_GAMEEND);
     247    this->stop();
     248  }
     249
    228250}
    229251
  • branches/gui/src/story_entities/game_menu.h

    r8673 r8674  
    6464
    6565  private:
    66     OrxGui::GLGuiBox*                 mainMenu;
     66    OrxGui::GLGuiBox*                 mainMenuBox;
    6767    OrxGui::GLGuiBox*                 audioBox;
    6868    OrxGui::GLGuiBox*                 videoBox;
Note: See TracChangeset for help on using the changeset viewer.