/[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.9 by mhawlisch, Wed Feb 19 16:42:43 2003 UTC revision 1.10 by mhawlisch, Mon Feb 24 12:16:49 2003 UTC
# Line 139  namespace Line 139  namespace
139    
140          // Private methods.          // Private methods.
141          void show_credits();          void show_credits();
142                    void show_help();
143                    void show_text( const char *text[]);
144    
145          // Variables.          // Variables.
146          Widget *newgame;          Widget *newgame;
147          Widget *playenigma;          Widget *playenigma;
148          Widget *playoxyd;          Widget *playoxyd;
149          Widget *leveled;          Widget *leveled;
150            Widget *manual;
151          Widget *options;          Widget *options;
152          Widget *credits;          Widget *credits;
153          Widget *quit;          Widget *quit;
# Line 719  MainMenu::MainMenu() Line 722  MainMenu::MainMenu()
722          playoxyd = b.add(new TextButton("Play Oxyd & Co", this));          playoxyd = b.add(new TextButton("Play Oxyd & Co", this));
723      }      }
724      leveled = 0; //b.add(new TextButton("Editor", this));      leveled = 0; //b.add(new TextButton("Editor", this));
725        manual = b.add(new TextButton("Manual", 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));
728      quit    = b.add(new TextButton("Quit", this));      quit    = b.add(new TextButton("Quit", this));
# Line 758  MainMenu::on_action(Widget *w) Line 762  MainMenu::on_action(Widget *w)
762          m.manage(video::GetScreen());          m.manage(video::GetScreen());
763          invalidate_all();          invalidate_all();
764      }      }
765      else if (w == credits) {      else if (w == manual) {
766            show_help ();
767        } else if (w == credits) {
768          show_credits ();          show_credits ();
769      } else if (w == options) {      } else if (w == options) {
770          GUI_OptionsMenu();          GUI_OptionsMenu();
# Line 772  MainMenu::on_action(Widget *w) Line 778  MainMenu::on_action(Widget *w)
778  }  }
779    
780  void  void
781    MainMenu::show_text( const char *text[])
782    {
783        Screen *scr = video::GetScreen ();
784        GC gc (scr->get_drawable());
785        blit (gc, 0,0, enigma::GetImage("menu_bg"));
786    
787    
788        Font *f = enigma::GetFont("menufont");
789        for (int i=0; text[i]; ++i)
790        {
791            f->render (scr, 40, 20+i*f->get_height(), text[i]);
792        }
793        scr->update_all ();
794        scr->flush_updates();
795    
796        SDL_Event e;
797        for (;;) {
798            SDL_WaitEvent(&e);
799            if (e.type == SDL_KEYDOWN || e.type == SDL_MOUSEBUTTONDOWN)
800                break;
801        }
802    }
803    
804    void
805  MainMenu::show_credits ()  MainMenu::show_credits ()
806  {  {
807      static char *credits[] = {      static const char *credits[] = {
808          "Main developer:",          "Main developer:",
809          "  DANIEL HECK",          "  DANIEL HECK",
810          "",          "",
# Line 799  MainMenu::show_credits () Line 829  MainMenu::show_credits ()
829          0          0
830      };      };
831    
832      Screen *scr = video::GetScreen ();          show_text( credits);
833      GC gc (scr->get_drawable());  }
     blit (gc, 0,0, enigma::GetImage("menu_bg"));  
   
834    
835      Font *f = enigma::GetFont("menufont");  void
836      for (int i=0; credits[i]; ++i)  MainMenu::show_help ()
837      {  {
838          f->render (scr, 40, 20+i*f->get_height(), credits[i]);      static const char *screen1[] = {
839      }                  "Introduction:",
840      scr->update_all ();                  "",
841      scr->flush_updates();          "The idea behind Enigma is simple: In most levels your job is to find",
842                    "pairs of \"Oxyd\" stones (you will recognize them when you see them)",
843                    "with matching colors. You have to open all oxyd stones but they only",
844                    "stay open when opening two stones of the same color one after",
845                    "another. Just play the first levels in the \"Oxyd & Co\" group and you",
846                    "will get the idea.",
847                    "In some other levels, called \"meditation landscapes\" you have a",
848                    "somewhat different job: You control a couple of small white marbles",
849                    "simultaneously and have to put each of them into a pit on the floor.",
850                    "",
851                    "Moving around:",
852                    "",
853                    "You control the marble by moving around the mouse into the desired",
854                    "direction. But be careful, because the marble has some mass and",
855                    "the floor some friction, the marble needs some time to accelerate or",
856                    "stop.",
857                    "Larger levels scroll when you reach the outermost part of the visible",
858                    "part on the screen.",
859                    "",
860            0
861        };
862        static const char *screen2[] = {
863                    "The Floor:",
864                    "",
865                    "On most types of floor you can move around riskless but the speed",
866                    "of your marble may vary.",
867                    "When moving into abyss or water you will die.",
868                    "Ice is very slippery.",
869                    "You cannot control your marble in space.",
870                    "",
871                    "Items and Inventory:",
872                    "",
873                    "In many levels you can see different items. You can pick them up",
874                    "by simply rolling over them. The items are then stored in your",
875                    "inventory, which you control using the left and right mouse button.",
876                    "The leftmost item will be activated when pressing the left mouse",
877                    "button and you can rotate the items using the right mouse button.",
878                    "Some items can mutate when hit by a laser or crushed by a stone.",
879                    "",
880            0
881        };
882        static const char *screen3[] = {
883                    "Something about stones:",
884                    "",
885                    "Most of the time the stones are nothing more than walls.",
886                    "Some special stones are movable when hit strong enought.",
887                    "The wooden stone will build new floor if moved into water, space or",
888                    "abyss.",
889                    "Others can be destroyed using a hammer, dynamite or a laser.",
890                    "Doors can be opened using a switch or trigger hidden somewhere",
891                    "around in the level.",
892                    "Some magic stones can be changed when hit using a magicwand.",
893                    "And some depend on the color of your marble.",
894                    "",
895            0
896        };
897    
898      SDL_Event e;          show_text( screen1);
899      for (;;) {          show_text( screen2);
900          SDL_WaitEvent(&e);          show_text( screen3);
         if (e.type == SDL_KEYDOWN || e.type == SDL_MOUSEBUTTONDOWN)  
             break;  
     }  
901  }  }
902    
903  //----------------------------------------------------------------------  //----------------------------------------------------------------------

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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