- converted text_type into a class
[supertux.git] / src / menu.h
index 46f41b5..e8baf70 100644 (file)
@@ -14,6 +14,7 @@
 #define SUPERTUX_MENU_H
 
 #include <SDL.h>
+#include <vector>
 #include "texture.h"
 #include "timer.h"
 #include "type.h"
@@ -49,7 +50,7 @@ public:
   void change_text (const char *text);
   void change_input(const char *text);
 
-  static MenuItem* create(MenuItemKind kind, char *text, int init_toggle, Menu* target_menu);
+  static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu);
 };
 
 class Menu
@@ -59,7 +60,6 @@ private:
   int pos_x;
   int pos_y;
   
-  int num_items;
   Menu* last_menu;
   int width();
   int height();
@@ -68,7 +68,7 @@ public:
   Timer effect;
   int arrange_left;
   int active_item;
-  MenuItem* item;
+  std::vector<MenuItem> item;
 
   static void set_current(Menu* pmenu);
 
@@ -76,8 +76,11 @@ public:
   ~Menu();
 
   void additem(MenuItem* pmenu_item);
-  void additem(MenuItemKind kind, char *text, int init_toggle, Menu* target_menu);
+  void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu);
   void action ();
+  
+  /** Remove all entries from the menu */
+  void clear();
 
   /** Check, if the value of the active menu item has changed. */
   int  check  ();
@@ -107,15 +110,17 @@ extern MenuAction menuaction;
 extern bool show_menu;
 extern bool menu_change;
 
-extern texture_type checkbox;
-extern texture_type checkbox_checked;
-extern texture_type back;
-extern texture_type arrow_left;
-extern texture_type arrow_right;
+extern Surface* checkbox;
+extern Surface* checkbox_checked;
+extern Surface* back;
+extern Surface* arrow_left;
+extern Surface* arrow_right;
 
 extern Menu* contrib_menu;
+extern Menu* contrib_subset_menu;
 extern Menu* main_menu;
 extern Menu* game_menu;
+extern Menu* worldmap_menu;
 extern Menu* options_menu;
 extern Menu* options_controls_menu;
 extern Menu* highscore_menu;
@@ -136,5 +141,5 @@ void menu_process_current(void);
 #endif /*SUPERTUX_MENU_H*/
 
 /* Local Variables: */
-/* mode:c++ */
-/* End */
+/* mode: c++ */
+/* End: */