1 /* 2 * Alizarin Tetris 3 * A generic way to display menus. 4 * 5 * Copyright 2000, Kiri Wagstaff & Westley Weimer 6 */ 7 8 #ifndef __MENU_H 9 #define __MENU_H 10 11 #include "button.h" 12 #include "button.pro" 13 14 typedef struct _ATMenu 15 { 16 int nButtons; 17 ATButton** buttons; 18 char* clicked; /* one per button */ 19 int x, y; /* upper left position */ 20 int w, h; 21 int defaultchoice; 22 } ATMenu; 23 24 typedef struct _WalkRadio 25 { 26 int n; /* number of choices */ 27 char **label; /* array of choice labels */ 28 int x,y; /* upper-left corner */ 29 int defaultchoice; /* the default choice */ 30 int (* action)(struct _WalkRadio *); 31 /* what to do when they make a selection: 32 * a non-zero return value means we are done 33 * with this menu */ 34 int *var_to_set; 35 void *data; 36 int inactive; /* if this is is set, we don't check this 37 * this particular radio menu for input */ 38 /* --- set by setup_radio --- */ 39 Uint32 face_color[2]; 40 Uint32 text_color[2]; 41 Uint32 border_color[2]; 42 int w,h; 43 SDL_Rect area; 44 SDL_Surface **bitmap0; 45 SDL_Surface **bitmap1; 46 } WalkRadio; 47 48 typedef struct _WalkRadioGroup { 49 WalkRadio *wr; 50 int n; /* number of walk-radios */ 51 int cur; /* currently selected walk radio button group */ 52 } WalkRadioGroup; 53 54 #include "menu.pro" 55 56 #endif 57 58 /* 59 * $Log: menu.h,v $ 60 * Revision 1.6 2000/11/06 00:24:01 weimer 61 * add WalkRadioGroup modifications (inactive field for Kiri) and some support 62 * for special pieces 63 * 64 * Revision 1.5 2000/11/02 03:06:20 weimer 65 * better interface for walk-radio menus: we are now ready for Kiri to change 66 * them to add run-time options ... 67 * 68 * Revision 1.4 2000/10/21 01:14:43 weimer 69 * massic autoconf/automake restructure ... 70 * 71 * Revision 1.3 2000/10/12 00:49:08 weimer 72 * added "AI" support and walking radio menus for initial game configuration 73 * 74 * Revision 1.2 2000/09/04 22:49:51 wkiri 75 * gamemenu now uses the new nifty menus. Also, added delete_menu. 76 * 77 * Revision 1.1 2000/09/04 19:54:26 wkiri 78 * Added menus (menu.[ch]). 79 * 80 */ 81