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 // position of the menu (ie. center of the menu, not top/left)
71 std::vector<MenuItem> item;
73 static void set_current(Menu* pmenu);
78 void additem(MenuItem* pmenu_item);
79 void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu);
82 /** Remove all entries from the menu */
85 /** Check, if the value of the active menu item has changed. */
88 void draw_item(int index, int menu_width, int menu_height);
89 void set_pos(int x, int y, float rw = 0, float rh = 0);
91 /* Check for a menu event */
92 void event(SDL_Event& event);
96 /* Action done on the menu */
98 MENU_ACTION_NONE = -1,
108 /* (global) menu variables */
109 extern MenuAction menuaction;
110 extern bool show_menu;
111 extern bool menu_change;
113 extern texture_type checkbox;
114 extern texture_type checkbox_checked;
115 extern texture_type back;
116 extern texture_type arrow_left;
117 extern texture_type arrow_right;
119 extern Menu* contrib_menu;
120 extern Menu* contrib_subset_menu;
121 extern Menu* main_menu;
122 extern Menu* game_menu;
123 extern Menu* options_menu;
124 extern Menu* options_controls_menu;
125 extern Menu* highscore_menu;
126 extern Menu* load_game_menu;
127 extern Menu* save_game_menu;
128 extern Menu* current_menu;
130 /* input implementation variables */
131 extern int delete_character;
132 extern char mn_input_char;
134 /* Reset the global menu variables */
135 void menu_reset(void);
137 /* "Calculate" and draw the menu */
138 void menu_process_current(void);
140 #endif /*SUPERTUX_MENU_H*/
142 /* Local Variables: */