8 http://www.newbreedsoftware.com/supertux/
13 #ifndef SUPERTUX_MENU_H
14 #define SUPERTUX_MENU_H
20 #include "mousecursor.h"
22 /* Kinds of menu items */
34 MN_HL, /* horizontal line */
45 string_list_type* list;
49 menu_item_type* menu_item_create(MenuItemKind kind, char *text, int init_toggle, Menu* target_menu);
50 void menu_item_change_text (menu_item_type* pmenu_item, const char *text);
51 void menu_item_change_input(menu_item_type* pmenu_item, const char *text);
55 friend void menu_event(SDL_Event& event);
58 // position of the menu (ie. center of the menu, not top/left)
73 static void set_current(Menu* pmenu);
78 void additem(menu_item_type* pmenu_item);
79 void additem(MenuItemKind kind, char *text, int init_toggle, Menu* target_menu);
82 /** Check, if the value of the active menu item has changed. */
85 void draw_item(int index, int menu_width, int menu_height);
86 void set_pos(int x, int y, float rw = 0, float rh = 0);
90 /* Action done on the menu */
92 MENU_ACTION_NONE = -1,
102 /* (global) menu variables */
103 extern MenuAction menuaction;
104 extern bool show_menu;
105 extern bool menu_change;
106 extern texture_type checkbox, checkbox_checked, back, arrow_left, arrow_right;
108 extern Menu* contrib_menu;
109 extern Menu* main_menu;
110 extern Menu* game_menu;
111 extern Menu* options_menu;
112 extern Menu* options_controls_menu;
113 extern Menu* highscore_menu;
114 extern Menu* load_game_menu;
115 extern Menu* save_game_menu;
116 extern Menu* current_menu;
118 /* input implementation variables */
119 extern int delete_character;
120 extern char mn_input_char;
122 /* Reset the global menu variables */
123 void menu_reset(void);
125 /* "Calculate" and draw the menu */
126 void menu_process_current(void);
128 /* Check for a menu event */
129 void menu_event(SDL_Event& event);
131 #endif /*SUPERTUX_MENU_H*/
133 /* Local Variables: */