2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
11 * $Logfile: /Freespace2/code/MenuUI/SnazzyUI.h $
16 * Header file for the Snazzy User Interface routines.
19 * Revision 1.2 2002/06/09 04:41:15 relnev
20 * added copyright header
22 * Revision 1.1.1.1 2002/05/03 03:28:12 root
26 * 3 12/18/98 1:13a Dave
27 * Rough 1024x768 support for Direct3D. Proper detection and usage through
30 * 2 10/07/98 10:53a Dave
33 * 1 10/07/98 10:49a Dave
35 * 17 4/09/98 5:51p Lawrance
36 * Be able to disable sounds for certain menus
38 * 16 2/03/98 11:52p Lawrance
39 * call snazzy_flush() from game_flush()
41 * 15 12/23/97 5:28p Hoffoss
42 * Made enter key act the same as clicking the mouse button in main hall
45 * 14 9/07/97 10:06p Lawrance
46 * let snazzy code keep track of mouse status
48 * 13 8/11/97 9:48p Lawrance
49 * don't poll keyboard if not requested
51 * 12 2/25/97 11:11a Lawrance
52 * adding more functionality needed for ship selection screen
54 * 11 12/10/96 4:18p Lawrance
55 * added snazzy_menu_close() call and integrated with existing menus
57 * 10 12/09/96 2:53p Lawrance
58 * fixed bug where both the snazzy code and ui code were reading the
59 * keyboard, and the keypress from the snazzy code was being lost
61 * 9 11/21/96 7:14p Lawrance
62 * converted menu code to use a file (menu.tbl) to get the data for the
65 * 8 11/15/96 12:09p John
66 * Added new UI code. Made mouse not return Enter when you click it.
67 * Changed the doSnazzyUI function and names to be snazzy_menu_xxx.
69 * 7 11/13/96 4:02p Lawrance
70 * complete over-haul of the menu system and the states associated with
73 * 6 11/13/96 8:32a Lawrance
74 * streamlined menu code
76 * 5 11/06/96 8:54a Lawrance
77 * added revision templates, made more efficient
87 #define ESC_PRESSED -2
91 typedef struct menu_region {
92 int mask; // mask color for the region
93 int key; // shortcut key for the region
94 char text[MAX_CHAR]; // The text associated with this item.
95 int click_sound; // Id of sound to play when mask area clicked on
98 // These are the actions thare are returned in the action parameter.
99 #define SNAZZY_OVER 1 // mouse is over a region
100 #define SNAZZY_CLICKED 2 // mouse button has gone from down to up over a region
102 int snazzy_menu_do(ubyte *data, int mask_w, int mask_h, int num_regions, MENU_REGION *regions, int *action, int poll_key = 1, int *key = NULL);
103 void read_menu_tbl(char *menu_name, char *bkg_filename, char *mask_filename, MENU_REGION *regions, int* num_regions, int play_sound=1);
104 void snazzy_menu_add_region(MENU_REGION *region, char* text, int mask, int key, int click_sound = -1);
106 void snazzy_menu_init(); // Call the first time a snazzy menu is inited
107 void snazzy_menu_close();