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