8 http://www.newbreedsoftware.com/supertux/
13 #ifndef SUPERTUX_MENU_H
14 #define SUPERTUX_MENU_H
21 #include "mousecursor.h"
23 /* Kinds of menu items */
35 MN_HL, /* horizontal line */
47 string_list_type* list;
50 void change_text (const char *text);
51 void change_input(const char *text);
53 static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu);
59 /* Action done on the menu */
61 MENU_ACTION_NONE = -1,
71 // position of the menu (ie. center of the menu, not top/left)
76 /** input event for the menu */
77 MenuAction menuaction;
79 /* input implementation variables */
87 static Menu* current_;
92 std::vector<MenuItem> item;
94 /** Set the current menu, if pmenu is NULL, hide the current menu */
95 static void set_current(Menu* pmenu);
96 static Menu* current() { return current_; }
101 void additem(MenuItem* pmenu_item);
102 void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu);
105 /** Remove all entries from the menu */
108 /** Check, if the value of the active menu item has changed. */
111 void draw_item(int index, int menu_width, int menu_height);
112 void set_pos(int x, int y, float rw = 0, float rh = 0);
114 /** translate a SDL_Event into a menu_action */
115 void event(SDL_Event& event);
118 extern Surface* checkbox;
119 extern Surface* checkbox_checked;
120 extern Surface* back;
121 extern Surface* arrow_left;
122 extern Surface* arrow_right;
124 extern Menu* contrib_menu;
125 extern Menu* contrib_subset_menu;
126 extern Menu* main_menu;
127 extern Menu* game_menu;
128 extern Menu* worldmap_menu;
129 extern Menu* options_menu;
130 extern Menu* options_controls_menu;
131 extern Menu* highscore_menu;
132 extern Menu* load_game_menu;
133 extern Menu* save_game_menu;
135 #endif /*SUPERTUX_MENU_H*/
137 /* Local Variables: */