2 * $Logfile: /Freespace2/code/Hud/HUDconfig.h $
7 * Header file for HUD configuration
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 4 8/02/99 9:55p Dave
15 * Hardcode a nice hud color config for the demo.
17 * 3 6/08/99 1:14a Dave
18 * Multi colored hud test.
20 * 2 10/07/98 10:53a Dave
23 * 1 10/07/98 10:49a Dave
25 * 30 4/29/98 6:00p Dave
26 * Fixed chatbox font colors. Made observer offscreen indicators work.
27 * Numerous small UI fixes. Fix rank limitations for mp games.
29 * 29 4/16/98 4:07p Hoffoss
30 * Fixed bug with palette reseting when loading a new pilot. Also made
31 * barracks default to palette merging mode.
33 * 28 4/14/98 6:16p Lawrance
34 * Fix bug that was preventing non-green HUD color from getting set.
36 * 27 3/26/98 5:45p Lawrance
37 * Added new gauges to HUD config
39 * 26 3/12/98 5:45p Dave
40 * Put in new observer HUD. Made it possible for observers to join at the
41 * beginning of a game and follow it around as an observer full-time.
43 * 25 2/22/98 4:17p John
44 * More string externalization classification... 190 left to go!
46 * 24 1/28/98 6:19p Dave
47 * Reduced standalone memory usage ~8 megs. Put in support for handling
48 * multiplayer submenu handling for endgame, etc.
50 * 23 1/18/98 5:09p Lawrance
51 * Added support for TEAM_TRAITOR
53 * 22 1/17/98 10:02p Lawrance
54 * Fix bug with damage popup that would sometimes display with <none>.
56 * 21 1/14/98 11:07p Lawrance
57 * Hook in brightness slider to HUD config.
59 * 20 1/13/98 5:33p Lawrance
60 * Tweaking HUD config.
62 * 19 1/12/98 11:16p Lawrance
63 * Wonderful HUD config.
65 * 18 1/10/98 12:41a Lawrance
66 * start work on new HUD config
68 * 17 1/05/98 9:38p Lawrance
69 * Implement flashing HUD gauges.
71 * 16 12/16/97 9:13p Lawrance
72 * Integrate new gauges into HUD config.
74 * 15 11/06/97 5:01p Dave
75 * Finished reworking standalone multiplayer sequencing. Put in
76 * configurable observer-mode HUD.
78 * 14 11/06/97 9:53a Dave
80 * 13 11/03/97 5:38p Dave
81 * Cleaned up more multiplayer sequencing. Added OBJ_OBSERVER module/type.
82 * Restructured HUD_config structs/flags.
84 * 12 10/28/97 12:43a Lawrance
85 * fix bug that was not setting HUD config correctly when a new pilot was
88 * 11 9/22/97 11:46p Lawrance
89 * make default radar range infinity
91 * 10 9/06/97 2:13p Mike
92 * Replace support for TEAM_NEUTRAL
94 * 9 8/31/97 6:38p Lawrance
95 * pass in frametime to do_frame loop
97 * 8 5/26/97 5:49p Lawrance
98 * supporting max range on radar
100 * 7 3/26/97 8:56a Lawrance
101 * removing target and game debug flags from HUD config
103 * 6 3/19/97 5:53p Lawrance
104 * integrating new Misc_sounds[] array (replaces old Game_sounds
107 * 5 1/28/97 5:33p Lawrance
108 * saving number of msg window lines in save game and player file
110 * 4 12/10/96 4:18p Lawrance
111 * took out In_hud_config and use game state instead
113 * 3 12/08/96 1:54a Lawrance
114 * integrating hud configuration
116 * 2 11/29/96 6:10p Lawrance
117 * HUD configuration working
129 #define HUD_COLOR_GREEN 0
130 #define HUD_COLOR_BLUE 1
131 #define HUD_COLOR_AMBER 2
133 // specify the max distance that the radar should detect objects
134 // Index in Radar_ranges[] array to get values
136 #define RR_MAX_RANGES 3 // keep up to date
139 #define RR_INFINITY 2
140 extern float Radar_ranges[RR_MAX_RANGES];
141 extern char *Radar_range_text(int range_num);
143 #define RP_SHOW_DEBRIS (1<<0)
144 #define RP_SHOW_FRIENDLY_MISSILES (1<<1)
145 #define RP_SHOW_HOSTILE_MISSILES (1<<2)
147 #define RP_DEFAULT ( RP_SHOW_DEBRIS | RP_SHOW_FRIENDLY_MISSILES | RP_SHOW_HOSTILE_MISSILES )
149 extern int HUD_observer_default_flags;
150 extern int HUD_observer_default_flags2;
151 extern int HUD_default_popup_mask;
152 extern int HUD_default_popup_mask2;
153 extern int HUD_config_default_flags;
154 extern int HUD_config_default_flags2;
156 typedef struct HUD_CONFIG_TYPE {
157 int show_flags; // whether to show gauge
158 int show_flags2; // whether to show gauge
159 int popup_flags; // whether gauge is popup
160 int popup_flags2; // whether gauge is popup
161 int num_msg_window_lines;
162 int rp_flags; // see RP_ flags above
163 int rp_dist; // one of RR_ #defines above
164 int is_observer; // 1 or 0, observer mode or not, respectively
165 int main_color; // the main color
167 // colors for all the gauges
168 color clr[NUM_HUD_GAUGES];
171 extern HUD_CONFIG_TYPE HUD_config;
173 void hud_config_init();
174 void hud_config_do_frame(float frametime);
175 void hud_config_close();
177 void hud_set_default_hud_config(player *p);
178 void hud_config_set_gauge_flags(int gauge_index, int on_flag, int popup_flag);
180 void hud_config_restore();
181 void hud_config_backup();
182 void hud_config_as_observer(ship *shipp,ai_info *aif);
185 void hud_config_as_observer();
186 void hud_config_as_player();
187 void hud_config_display_text(char* gauge_text, int x, int y);
188 void hud_set_display_gauge_cbox();
190 // leave hud config without accepting changes
191 void hud_config_cancel();
193 // leave hud config with accepting changes
194 void hud_config_commit();
196 // flag access/manipulation routines
197 int hud_config_show_flag_is_set(int i);;
198 void hud_config_show_flag_set(int i);
199 void hud_config_show_flag_clear(int i);
200 int hud_config_popup_flag_is_set(int i);
201 void hud_config_popup_flag_set(int i);
202 void hud_config_popup_flag_clear(int i);
204 void hud_config_record_color(int color);
206 // load up the given hcf file
207 void hud_config_color_load(char *name);