/[enigma]/enigma/src/menus.cc
ViewVC logotype

Diff of /enigma/src/menus.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by dheck, Wed Feb 12 23:15:24 2003 UTC revision 1.8 by mhawlisch, Wed Feb 19 14:05:48 2003 UTC
# Line 124  namespace Line 124  namespace
124          void draw_background(px::GC &gc);          void draw_background(px::GC &gc);
125      private:      private:
126          vector<Widget *> buttons;          vector<Widget *> buttons;
127            Widget *back;
128      };      };
129            
130      class MainMenu : public Menu {      class MainMenu : public Menu {
# Line 664  LevelMenu::draw_background(px::GC &gc) Line 665  LevelMenu::draw_background(px::GC &gc)
665    
666  LevelPackMenu::LevelPackMenu()  LevelPackMenu::LevelPackMenu()
667  {  {
668      BuildVList b(this, Rect(0,0,150,40), 5);      //BuildVList vlist(this, Rect(510,400,100,28), 5);
669        //vlist.add( new TextButton("Back", this));
670    
671        BuildVList b(this, Rect((640-150)/2,200,150,40), 5);
672    
673      for (unsigned i=0; i<enigma::LevelPacks.size(); ++i) {      for (unsigned i=0; i<enigma::LevelPacks.size(); ++i) {
674          LevelPack *lp = enigma::LevelPacks[i];          LevelPack *lp = enigma::LevelPacks[i];
675            if( lp->levels.size() > 0)
676          buttons.push_back(b.add(new TextButton(lp->name, this)));          buttons.push_back(b.add(new TextButton(lp->name, this)));
677      }      }
678        
679        BuildVList vlist(this, Rect(510,433,100,28), 5);
680        back = new TextButton("Back", this);
681        vlist.add( back);
682  }  }
683    
684  void  void
# Line 681  LevelPackMenu::on_action(Widget *w) Line 690  LevelPackMenu::on_action(Widget *w)
690              m.manage(video::GetScreen());              m.manage(video::GetScreen());
691              invalidate_all();              invalidate_all();
692          }          }
693    
694        if( w == back)
695                Menu::quit();
696  }  }
697    
698  void  void
# Line 701  LevelPackMenu::draw_background(px::GC &g Line 713  LevelPackMenu::draw_background(px::GC &g
713  MainMenu::MainMenu()  MainMenu::MainMenu()
714  {  {
715      BuildVList b(this, Rect((640-150)/2,200,150,40), 5);      BuildVList b(this, Rect((640-150)/2,200,150,40), 5);
716      newgame = 0; //b.add(new TextButton("New Game", this));      if (enigma::LevelPacks.size() > 2) {
717      playenigma = b.add(new TextButton("Play Enigma", this));          newgame = b.add(new TextButton("New Game", this));
718      playoxyd = b.add(new TextButton("Play Oxyd & Co", this));          playenigma = 0;
719            playoxyd = 0;
720        } else {
721            newgame = 0;
722            playenigma = b.add(new TextButton("Play Enigma", this));
723            playoxyd = b.add(new TextButton("Play Oxyd & Co", this));
724        }
725      leveled = 0; //b.add(new TextButton("Editor", this));      leveled = 0; //b.add(new TextButton("Editor", this));
726      options = b.add(new TextButton("Options", this));      options = b.add(new TextButton("Options", this));
727      credits = b.add(new TextButton("Credits", this));      credits = b.add(new TextButton("Credits", this));
# Line 731  MainMenu::on_action(Widget *w) Line 749  MainMenu::on_action(Widget *w)
749  {  {
750      if (w == newgame) {      if (w == newgame) {
751          LevelPackMenu m;          LevelPackMenu m;
752          m.center(video::GetScreen());          //m.center(video::GetScreen());
753          m.manage(video::GetScreen());          m.manage(video::GetScreen());
754      }      }
755      else if (w == playenigma) {      else if (w == playenigma) {

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26