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/HUDmessage.cpp $
15 * C module that controls and manages the message window on the HUD
18 * Revision 1.4 2002/06/09 04:41:21 relnev
19 * added copyright header
21 * Revision 1.3 2002/06/02 04:26:34 relnev
24 * Revision 1.2 2002/05/03 13:34:33 theoddone33
27 * Revision 1.1.1.1 2002/05/03 03:28:09 root
31 * 23 9/08/99 5:38p Jefff
33 * 22 9/08/99 2:38p Jefff
34 * sound pausing going to menu from game
36 * 21 9/07/99 9:42p Jefff
38 * 20 9/02/99 11:47a Jefff
39 * yet another hud message length adjustment. yeesh.
41 * 19 8/25/99 10:08a Jefff
42 * fixed another messge cut-off bug
44 * 18 8/23/99 11:12a Jefff
45 * fixed 1024 message cut-off bug
47 * 17 8/20/99 2:26p Jefff
48 * hud message text wrapping problem in hires fixed
50 * 16 8/03/99 7:27p Jefff
51 * hud messages go completely across screnn in high res now
53 * 15 8/03/99 6:21p Jefff
54 * fixed stupid bug with objectives screen key
56 * 14 8/01/99 12:39p Dave
57 * Added HUD contrast control key (for nebula).
59 * 13 7/29/99 2:58p Jefff
60 * Ingame objective screen icon key now uses normal objective icons and
61 * text is drawn in code.
63 * 12 6/16/99 5:26p Dave
64 * Fixed some bitmap and coordinate problems on the mission scrollback
67 * 11 6/10/99 3:43p Dave
68 * Do a better job of syncing text colors to HUD gauges.
70 * 10 2/02/99 10:13a Neilk
73 * 9 2/01/99 5:55p Dave
74 * Removed the idea of explicit bitmaps for buttons. Fixed text
75 * highlighting for disabled gadgets.
77 * 8 1/30/99 5:08p Dave
78 * More new hi-res stuff.Support for nice D3D textures.
80 * 7 1/30/99 3:09p Neilk
81 * More mission log coord fixes
83 * 6 1/30/99 2:59p Neilk
84 * Fixed more mission log coords
86 * 5 1/29/99 7:57p Neilk
87 * Added support for multiresolutions
89 * 4 1/06/99 2:24p Dave
90 * Stubs and release build fixes.
92 * 3 10/13/98 9:28a Dave
93 * Started neatening up freespace.h. Many variables renamed and
94 * reorganized. Added AlphaColors.[h,cpp]
96 * 2 10/07/98 10:53a Dave
99 * 1 10/07/98 10:49a Dave
101 * 89 6/09/98 5:17p Lawrance
102 * French/German localization
104 * 88 6/09/98 10:31a Hoffoss
105 * Created index numbers for all xstr() references. Any new xstr() stuff
106 * added from here on out should be added to the end if the list. The
107 * current list count can be found in FreeSpace.cpp (search for
110 * 87 5/19/98 8:36p Andsager
111 * Fix bug where last line of message log would not show if more than one
114 * 86 4/27/98 8:49p Allender
115 * make terran command display in white (with correct code anyway).
117 * 85 4/25/98 11:49p Lawrance
120 * 84 4/25/98 9:10p Hoffoss
121 * Fixed bug with scrollback origin.
123 * 83 4/25/98 5:22p Hoffoss
124 * Fixed some problems with scrolling and positioning, and added code to
125 * support pageup/pagedown.
127 * 82 4/14/98 5:06p Dave
128 * Don't load or send invalid pilot pics. Fixed chatbox graphic errors.
129 * Made chatbox display team icons in a team vs. team game. Fixed up pause
130 * and endgame sequencing issues.
132 * 81 4/14/98 2:44p Hoffoss
133 * Made arrow keys do what tab does.
135 * 80 4/08/98 4:10p John
136 * Removed all remaining traces of the evil gr_init_font_ex.
138 * 79 4/07/98 11:33a Hoffoss
139 * Fixed bug where scroll offset was wrong when first entering the F4
142 * 78 4/05/98 3:30p Dave
143 * Print netplayer messages in brighter green on the hud, with
144 * accompanying sound. Echo netplayer messages on sending machine. Fixed
145 * standalone sequencing bug where host never get the "enter mission"
148 * 77 3/27/98 11:57a Dave
149 * Put in expression checking for text messages.
151 * 76 3/17/98 4:01p Hoffoss
152 * Added HUD_SOURCE_TERRAN_CMD and changed code to utilize it when a
153 * message is being sent from Terran Command.
155 * 75 3/16/98 5:55p Lawrance
156 * Increase width of HUD message line, don't draw lines while comm menu is
159 * 74 3/12/98 4:03p Hoffoss
160 * Changed formatting used in hug scrollbacl log.
162 * 73 3/09/98 4:47p Hoffoss
163 * Changed F4 screen to start in objectives mode rather than HUD messages
166 * 72 3/09/98 2:50p Hoffoss
167 * Changed to use different palette file, and fixed bug with text
168 * overrunning the right edge of screen.
170 * 71 3/02/98 5:42p John
171 * Removed WinAVI stuff from Freespace. Made all HUD gauges wriggle from
172 * afterburner. Made gr_set_clip work good with negative x &y. Made
173 * model_caching be on by default. Made each cached model have it's own
174 * bitmap id. Made asteroids not rotate when model_caching is on.
176 * 70 2/27/98 4:55p Hoffoss
177 * Fixed some alignment problems.
179 * 69 2/27/98 4:37p Hoffoss
180 * Combined Objectives screen into Mission Log screen.
182 * 68 2/22/98 4:17p John
183 * More string externalization classification... 190 left to go!
185 * 67 2/22/98 12:19p John
186 * Externalized some strings
188 * 66 2/06/98 2:58p Hoffoss
189 * Fixed bug where mission log scrolls twice when using the arrow keys.
191 * 65 1/29/98 10:26a Hoffoss
192 * Made changes so arrow buttons repeat scrolling when held down.
194 * 64 1/20/98 4:39p Hoffoss
195 * Added mission time display to scrollback log screen.
197 * 63 1/18/98 5:09p Lawrance
198 * Added support for TEAM_TRAITOR
200 * 62 1/12/98 11:16p Lawrance
201 * Wonderful HUD config.
203 * 61 1/08/98 1:33p Hoffoss
204 * Made scroll offset reset to bottom of list instead of top.
206 * 60 1/05/98 2:59p Hoffoss
207 * Fixed bug with messages drawing outside of limits.
209 * 59 1/02/98 9:10p Lawrance
210 * Big changes to how colors get set on the HUD.
212 * 58 1/02/98 10:23a Hoffoss
213 * Fixed incorrect scrolling directions in message scrollback log.
215 * 57 12/11/97 10:17p Dave
216 * Put in some checks to make sure HUD_printfs aren't
217 * done in certain multiplayer situations.
219 * 56 12/05/97 2:16p Hoffoss
220 * Made hidden hud messages actually not show up in scrollback.
222 * 55 12/03/97 6:07p Dave
223 * Added assert that hud scrollback initialized before adding messages to
226 * 54 12/03/97 4:16p Hoffoss
227 * Changed sound stuff used in interface screens for interface purposes.
229 * 53 12/03/97 11:35a Hoffoss
230 * Made changes to HUD messages send throughout the game.
232 * 52 12/02/97 5:57p Hoffoss
233 * Changed Hud messaging code to align text to right after sending ship's
236 * 51 12/01/97 4:30p Hoffoss
237 * Changed code to list hud messages in scrollback from top down.
239 * 50 11/25/97 10:01a Jasen
240 * Remoced excess buttons from MessageLog screen.
242 * 49 11/24/97 10:03p Jasen
243 * Dang... had to make an entirely new revision of the last button. :)
245 * 48 11/24/97 9:44p Jasen
246 * Changed button name and coords to new exit button.
248 * 47 11/20/97 12:02p Lawrance
249 * change Error to nprintf at warning level
251 * 46 11/17/97 6:37p Lawrance
252 * new gauges: extended target view, new lock triangles, support ship view
254 * 45 11/14/97 2:46p Lawrance
255 * decrease width of HUD message line to 435, so it doesn overlap with
258 * 44 11/13/97 10:16p Hoffoss
259 * Added icons to mission log scrollback.
261 * 43 11/13/97 4:05p Hoffoss
262 * Added hiding code for mission log entries.
264 * 42 11/12/97 6:00p Hoffoss
265 * Added training messages to hud scrollback log.
267 * 41 11/11/97 11:16a Hoffoss
268 * Changed hud scrollback to color entire lines.
270 * 40 11/06/97 5:42p Hoffoss
271 * Added support for fixed size timstamp rendering.
273 * 39 11/05/97 7:11p Hoffoss
274 * Made changed to the hud message system. Hud messages can now have
275 * sources so they can be color coded.
277 * 38 11/04/97 4:56p Jasen
278 * Updated coordinates for buttons
280 * 37 11/03/97 10:12p Hoffoss
281 * Finished up work on the hud message/mission log scrollback screen.
283 * 36 11/03/97 5:38p Dave
284 * Cleaned up more multiplayer sequencing. Added OBJ_OBSERVER module/type.
285 * Restructured HUD_config structs/flags.
287 * 35 10/25/97 4:02p Lawrance
288 * took out unused hud_message struct members
290 * 34 10/02/97 9:53p Hoffoss
291 * Added event evaluation analysis debug screen so we can determine the
292 * state of events and their sexp trees to track down logic problems and
295 * 33 9/17/97 5:12p John
296 * Restructured collision routines. Probably broke a lot of stuff.
298 * 32 9/08/97 12:01p Lawrance
299 * when re-using HUD scrollback entries, ensure memory gets free'ed
302 * 31 8/31/97 6:38p Lawrance
303 * pass in frametime to do_frame loop
305 * 30 8/22/97 10:03a Lawrance
306 * fix exception that occurred when hud scrollback was selected from the
309 * 29 6/23/97 12:03p Lawrance
310 * move split_str() to Parselo
312 * 28 6/17/97 12:25p Lawrance
313 * HUD message lines are split into multiple lines when they exceed
316 * 27 6/12/97 10:23a John
317 * added new colors to freespace. made most menus display the background
318 * bitmap rather than dull black screen.
320 * 26 6/11/97 1:12p John
321 * Started fixing all the text colors in the game.
323 * 25 4/22/97 3:14p Lawrance
324 * only free HUD scrollback messages if they exist
326 * 24 4/15/97 1:26p Lawrance
327 * using a static array of nodes to store hud scrollback messages, storage
328 * for text is dynamic
330 * 23 4/14/97 9:55a Mike
331 * Fixed HUD message system.
332 * Better game sequencing.
334 * 22 1/28/97 5:33p Lawrance
335 * saving number of msg window lines in save game and player file
337 * 21 1/28/97 4:59p Lawrance
338 * allowing number of lines on hud message bar to be configured
340 * 20 1/24/97 9:47a Lawrance
341 * made number of message lines in HUD message area confiurable
343 * 19 1/22/97 10:56a Lawrance
344 * added check for NULL after malloc()
346 * 18 1/07/97 5:36p Lawrance
347 * Enabled save/restore for old/present/pending hud messages
349 * 17 12/10/96 12:28p Lawrance
350 * adding new offscreen target indicator
352 * 16 12/08/96 1:54a Lawrance
353 * integrating hud configuration
355 * 15 11/29/96 6:12p Lawrance
356 * took out duplicate include of timer.h
358 * 14 11/29/96 11:17a Lawrance
359 * added comments, put check in for zero-length HUD messages in the
362 * 13 11/28/96 6:27p Lawrance
363 * added some additional comments
365 * 12 11/27/96 3:20p Lawrance
366 * added scroll-back message code
368 * 11 11/22/96 1:00p Lawrance
369 * fixed bug when a key held down and created tons of messages
371 * 10 11/22/96 12:35p Lawrance
373 * 9 11/20/96 11:51a Lawrance
374 * trying out losing the HUD message shaded area
376 * 8 11/19/96 4:46p Lawrance
377 * fixed problem when too many messages were to be displayed at once
379 * 7 11/19/96 3:55p Lawrance
380 * modifed HUD message details (scroll speed, fade time etc)
382 * 6 11/19/96 10:16a Lawrance
383 * changing to new use of color scheme
385 * 5 11/17/96 5:28p Lawrance
386 * using HUD color globals instead of hard-coded numbers
388 * 4 11/15/96 11:46a Lawrance
389 * tweaked size of HUD message bar to prevent clipping of g's etc on the
392 * 3 11/15/96 11:39a Lawrance
393 * got HUD messages scrolling
395 * 2 11/15/96 12:11a Lawrance
396 * HUD message bar working
406 #include "hudmessage.h"
407 #include "hudtarget.h"
408 #include "freespace.h"
409 #include "gamesequence.h"
417 #include "linklist.h"
418 #include "missionlog.h"
420 #include "missionscreencommon.h"
425 #include "missiongoals.h"
426 #include "alphacolors.h"
428 #include "audiostr.h"
430 /* replaced with those static ints that follow
432 #define LIST_X2 108 // second column x start position
434 #define LIST_W 558 // total width including both columns
435 #define LIST_W2 (LIST_W + LIST_X - LIST_X2) // width of second column
437 #define LIST_H_O 275 // applies only to objectives mode
440 // 1st column, width includes both columns
441 static int Hud_mission_log_list_coords[GR_NUM_RESOLUTIONS][4] = {
443 46,60,558,269 // GR_640
446 74,96,558,297 // GR_1024
450 // 2nd column, width is just of second column
451 static int Hud_mission_log_list2_coords[GR_NUM_RESOLUTIONS][4] = {
453 108, 60, 496, 297 // GR_640
456 136, 96, 496, 436 // GR_1024
460 static int Hud_mission_log_list_objective_x_coord[GR_NUM_RESOLUTIONS] = {
465 static int Hud_mission_log_time_coords[GR_NUM_RESOLUTIONS][2] = {
474 static int Hud_mission_log_time2_coords[GR_NUM_RESOLUTIONS][2] = {
484 #define SCROLLBACK_MODE_MSGS_LOG 0
485 #define SCROLLBACK_MODE_EVENT_LOG 1
486 #define SCROLLBACK_MODE_OBJECTIVES 2
488 #define NUM_BUTTONS 6
490 #define SCROLL_UP_BUTTON 0
491 #define SCROLL_DOWN_BUTTON 1
492 #define SHOW_MSGS_BUTTON 2
493 #define SHOW_EVENTS_BUTTON 3
494 #define SHOW_OBJS_BUTTON 4
495 #define ACCEPT_BUTTON 5
497 #define HUD_MESSAGE_TOTAL_LIFE 14000 // total time a HUD message is alive (in milliseconds)
499 #define HUD_MSG_LENGTH_MAX 2048
500 //#define HUD_MSG_MAX_PIXEL_W 439 // maximum number of pixels wide message display area is
501 //#define HUD_MSG_MAX_PIXEL_W 619 // maximum number of pixels wide message display area is
503 static int Hud_mission_log_status_coords[GR_NUM_RESOLUTIONS][2] = {
512 struct scrollback_buttons {
517 UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
519 scrollback_buttons(char *name, int x1, int y1, int x2, int y2, int h) : filename(name), x(x1), y(y1), xt(x2), yt(y2), hotspot(h) {}
524 int MSG_WINDOW_X_START = 5;
525 int MSG_WINDOW_Y_START = 5;
526 int MSG_WINDOW_WIDTH; // initialed in hud_init_msg_window()
527 int MSG_WINDOW_HEIGHT;
528 int MSG_WINDOW_FONT_HEIGHT;
529 int ACTIVE_BUFFER_LINES = 4; // number of HUD messages that can be shown at one time + 1
530 int OLD_ACTIVE_BUFFER_LINES;
532 int Hud_list_start; // points to the next msg to be printed in the queue
533 int Hud_list_end; // points to the last msg in the queue
537 int Scroll_in_progress=0;
539 HUD_message_data HUD_pending[SCROLL_BUFFER_LINES];
540 Hud_display_info HUD_active_msgs_list[MAX_ACTIVE_BUFFER_LINES];
542 int HUD_msg_inited = FALSE;
544 // There is a maximum number of lines that will be stored in the message scrollback. Oldest
545 // messages are deleted to make way for newest messages.
546 #define MAX_MSG_SCROLLBACK_LINES 100
547 line_node Msg_scrollback_lines[MAX_MSG_SCROLLBACK_LINES];
549 line_node Msg_scrollback_free_list;
550 line_node Msg_scrollback_used_list;
554 typedef struct HUD_ft {
555 int end_time; // Timestamp at which this message will go away.
556 char text[MAX_HUD_LINE_LEN]; // Text to display.
557 int color; // 0rgb color, 8 bit fields.
560 HUD_ft HUD_fixed_text[MAX_HUD_FT];
562 static int Num_obj_lines;
563 static int Scroll_offset;
564 static int Scroll_max;
565 static int Scrollback_mode = SCROLLBACK_MODE_OBJECTIVES;
566 // static int Status_bitmap;
567 static int Background_bitmap;
568 static UI_WINDOW Ui_window;
570 static char* Hud_mission_log_fname[GR_NUM_RESOLUTIONS] = {
571 "MissionLog", // GR_640
572 "2_MissionLog" // GR_1024
575 static char* Hud_mission_log_status_fname[GR_NUM_RESOLUTIONS] = {
576 "MLStatus", // GR_640
577 "MLStatus" // GR_1024
580 static char* Hud_mission_log_mask_fname[GR_NUM_RESOLUTIONS] = {
581 "MissionLog-m", // GR_640
582 "2_MissionLog-m" // GR_1024
585 static scrollback_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
588 scrollback_buttons("LB_00", 1, 67, -1, -1, 0),
589 scrollback_buttons("LB_01", 1, 307, -1, -1, 1),
590 scrollback_buttons("LB_02", 111, 376, 108, 413, 2),
591 scrollback_buttons("LB_03", 209, 376, 205, 413, 3),
592 scrollback_buttons("LB_04", 12, 376, 7, 413, 4),
593 scrollback_buttons("CB_05a", 571, 425, 564, 413, 5)
598 scrollback_buttons("2_LB_00", 1, 108, -1, -1, 0),
599 scrollback_buttons("2_LB_01", 1, 492, -1, -1, 1),
600 scrollback_buttons("2_LB_02", 177, 602, 173, 661, 2),
601 scrollback_buttons("2_LB_03", 335, 602, 335, 661, 3),
602 scrollback_buttons("2_LB_04", 20, 602, 11, 661, 4),
603 scrollback_buttons("2_CB_05a",914, 681, 946, 661, 5)
609 // ----------------------------------------------------------------------
610 // HUD_init_fixed_text()
612 void HUD_init_fixed_text()
616 for (i=0; i<MAX_HUD_FT; i++)
617 HUD_fixed_text[i].end_time = timestamp(0);
620 // ----------------------------------------------------------------------
621 // hud_init_msg_window()
623 // Called from HUD_init(), which is called from game_level_init()
625 void hud_init_msg_window()
629 MSG_WINDOW_WIDTH = gr_screen.clip_width - 20;
634 for (i=0; i<SCROLL_BUFFER_LINES; i++)
635 HUD_pending[i].text[0] = HUD_pending[i].text[MAX_HUD_LINE_LEN - 1] = 0;
637 for ( i=0; i < MAX_ACTIVE_BUFFER_LINES; i++ ) {
638 HUD_active_msgs_list[i].total_life = 1;
643 // determine the height of the msg window, which depends on the font height
645 h = gr_get_font_height();
647 //ACTIVE_BUFFER_LINES = Players[Player_num].HUD_config.num_msg_window_lines;
648 // ACTIVE_BUFFER_LINES = HUD_config.num_msg_window_lines;
649 ACTIVE_BUFFER_LINES = 4;
651 MSG_WINDOW_FONT_HEIGHT = h;
652 MSG_WINDOW_HEIGHT = MSG_WINDOW_FONT_HEIGHT * (ACTIVE_BUFFER_LINES-1);
654 // starting a mission, free the scroll-back buffers, but only if we've been
655 // through this function once already
656 if ( HUD_msg_inited == TRUE ) {
657 hud_free_scrollback_list();
660 list_init( &Msg_scrollback_free_list );
661 list_init( &Msg_scrollback_used_list );
663 // first slot is reserved for dummy node
664 for (i=1; i < MAX_MSG_SCROLLBACK_LINES; i++) {
665 Msg_scrollback_lines[i].text = NULL;
666 list_append(&Msg_scrollback_free_list, &Msg_scrollback_lines[i]);
671 Scroll_in_progress=0;
673 OLD_ACTIVE_BUFFER_LINES = ACTIVE_BUFFER_LINES;
675 HUD_init_fixed_text();
676 HUD_msg_inited = TRUE;
679 // ---------------------------------------------------------------------------------------
680 // hud_show_msg_window() will display the active HUD messages on the HUD. It will scroll
681 // the messages up when a new message arrives.
683 void hud_show_msg_window()
687 hud_set_default_color();
690 HUD_set_clip(MSG_WINDOW_X_START,MSG_WINDOW_Y_START, MSG_WINDOW_WIDTH, MSG_WINDOW_HEIGHT+2);
692 if ( OLD_ACTIVE_BUFFER_LINES != ACTIVE_BUFFER_LINES ) {
693 // the size of the message window has changed, the best thing to do is to put all
694 // the blank out the current hud messages. There is no need to add them to the
695 // scrollback buffer, since they are already there!
697 for ( i=0; i < ACTIVE_BUFFER_LINES; i++ ) {
698 if ( !timestamp_elapsed(HUD_active_msgs_list[i].total_life) ) {
699 HUD_active_msgs_list[i].total_life = 1;
705 OLD_ACTIVE_BUFFER_LINES = ACTIVE_BUFFER_LINES;
707 // check if there is a message to display on the HUD, and if there is room to display it
708 if ( Hud_list_start != Hud_list_end && !Scroll_needed) {
712 // if the pointer exceeds the array size, wrap around to element 1. element 0 is not used.
713 if (Hud_list_start >= SCROLL_BUFFER_LINES)
716 HUD_active_msgs_list[Active_index].msg = HUD_pending[Hud_list_start];
717 HUD_active_msgs_list[Active_index].total_life = timestamp(HUD_MESSAGE_TOTAL_LIFE);
719 for (i=Active_index+1; i < Active_index+ACTIVE_BUFFER_LINES; i++) {
720 index = i % ACTIVE_BUFFER_LINES;
722 // determine if there are any existing messages, if so need to scroll them up
724 if ( !timestamp_elapsed(HUD_active_msgs_list[index].total_life) ) {
725 HUD_active_msgs_list[index].target_y -= MSG_WINDOW_FONT_HEIGHT;
732 HUD_active_msgs_list[Active_index].y = (ACTIVE_BUFFER_LINES-1)*MSG_WINDOW_FONT_HEIGHT;
733 HUD_active_msgs_list[Active_index].target_y = HUD_active_msgs_list[Active_index].y - MSG_WINDOW_FONT_HEIGHT;
736 HUD_active_msgs_list[Active_index].y = (ACTIVE_BUFFER_LINES-2)*MSG_WINDOW_FONT_HEIGHT;
737 HUD_active_msgs_list[Active_index].target_y = HUD_active_msgs_list[Active_index].y;
741 if (Active_index >= ACTIVE_BUFFER_LINES) Active_index = 0;
743 if (Hud_list_end == Hud_list_start) { // just printed the last msg
744 Hud_list_start = Hud_list_end = 0;
748 Scroll_in_progress=0;
751 for ( i=0; i < ACTIVE_BUFFER_LINES; i++ ) {
753 if ( !timestamp_elapsed(HUD_active_msgs_list[i].total_life) ) {
755 if (HUD_active_msgs_list[i].y > HUD_active_msgs_list[i].target_y) {
757 if (timestamp_elapsed(Scroll_time_id) ){
758 HUD_active_msgs_list[i].y -= SCROLL_STEP_SIZE;
759 if (HUD_active_msgs_list[i].y < HUD_active_msgs_list[i].target_y)
760 HUD_active_msgs_list[i].y = HUD_active_msgs_list[i].target_y;
762 Scroll_in_progress=1;
767 if ( hud_gauge_active(HUD_MESSAGE_LINES) ) {
768 if ( !(Player->flags & PLAYER_FLAGS_MSG_MODE) ) {
769 // set the appropriate color
770 if(HUD_active_msgs_list[i].msg.source){
771 hud_set_gauge_color(HUD_MESSAGE_LINES, HUD_C_BRIGHT);
773 hud_set_gauge_color(HUD_MESSAGE_LINES);
776 // print the message out
777 gr_printf(MSG_WINDOW_X_START + HUD_active_msgs_list[i].msg.x - 2, HUD_active_msgs_list[i].y, "%s", HUD_active_msgs_list[i].msg.text);
784 if (Scroll_in_progress)
785 Scroll_time_id = timestamp(SCROLL_TIME);
790 void hud_show_fixed_text()
794 hp = &HUD_fixed_text[0];
796 if (!timestamp_elapsed(hp->end_time)) {
797 //gr_set_color((hp->color >> 16) & 0xff, (hp->color >> 8) & 0xff, hp->color & 0xff);
798 gr_printf(0x8000, MSG_WINDOW_Y_START + MSG_WINDOW_HEIGHT + 8, hp->text);
802 // Similar to HUD printf, but shows only one message at a time, at a fixed location.
803 void HUD_fixed_printf(float duration, char * format, ...)
806 char tmp[HUD_MSG_LENGTH_MAX];
809 // make sure we only print these messages if we're in the correct state
810 if((Game_mode & GM_MULTIPLAYER) && (Netgame.game_state != NETGAME_STATE_IN_MISSION)){
811 nprintf(("Network","HUD_fixed_printf bailing because not in multiplayer game play state\n"));
815 va_start(args, format);
816 vsprintf(tmp, format, args);
819 msg_length = strlen(tmp);
820 Assert(msg_length < HUD_MSG_LENGTH_MAX); // If greater than this, probably crashed anyway.
823 nprintf(("Warning", "HUD_fixed_printf ==> attempt to print a 0 length string in msg window\n"));
826 } else if (msg_length > MAX_HUD_LINE_LEN - 1){
827 nprintf(("Warning", "HUD_fixed_printf ==> Following string truncated to %d chars: %s\n",MAX_HUD_LINE_LEN,tmp));
830 if (duration == 0.0f){
831 HUD_fixed_text[0].end_time = timestamp(-1);
833 HUD_fixed_text[0].end_time = timestamp((int) (1000.0f * duration));
836 strncpy(HUD_fixed_text[0].text, tmp, MAX_HUD_LINE_LEN - 1);
837 HUD_fixed_text[0].color = 0xff0000;
840 // Clear all pending text.
841 void HUD_fixed_printf_reset()
843 HUD_init_fixed_text();
847 // --------------------------------------------------------------------------------------
850 // Print a single line of text to the HUD. We know that the text will fit on the screen,
851 // since that was taken care of in HUD_printf();
853 void HUD_printf_line(char *text, int source, int time = 0, int x = 0)
855 Assert(text != NULL);
857 // if the pointer exceeds the array size, wrap around to element 1. element 0 is not used.
859 if (Hud_list_end >= SCROLL_BUFFER_LINES)
862 if (Hud_list_end == Hud_list_start) {
863 nprintf(("Warning", "HUD ==> Exceeded msg scroll buffer, discarding message %s\n", text));
865 if (Hud_list_end == 0)
866 Hud_list_end = SCROLL_BUFFER_LINES - 1;
870 if ( strlen(text) > MAX_HUD_LINE_LEN - 1 ){
871 nprintf(("Warning", "HUD_printf_line() ==> Following string truncated to %d chars: %s\n", MAX_HUD_LINE_LEN, text));
874 strncpy(HUD_pending[Hud_list_end].text, text, MAX_HUD_LINE_LEN - 1);
875 HUD_pending[Hud_list_end].text[MAX_HUD_LINE_LEN - 1] = 0;
876 HUD_pending[Hud_list_end].source = source;
877 HUD_pending[Hud_list_end].time = time;
878 HUD_pending[Hud_list_end].x = x;
881 // converts a TEAM_* define to a HUD_SOURCE_* define
882 int HUD_get_team_source(int team)
886 return HUD_SOURCE_FRIENDLY;
889 return HUD_SOURCE_HOSTILE;
892 return HUD_SOURCE_NEUTRAL;
895 return HUD_SOURCE_UNKNOWN;
898 return HUD_SOURCE_TRAITOR;
901 nprintf(("warning", "Unknown TEAM_* define used! (%d)", team));
905 void HUD_printf(char *format, ...)
908 char tmp[HUD_MSG_LENGTH_MAX];
911 // make sure we only print these messages if we're in the correct state
912 if((Game_mode & GM_MULTIPLAYER) && (Net_player->state != NETPLAYER_STATE_IN_MISSION)){
913 nprintf(("Network","HUD_printf bailing because not in multiplayer game play state\n"));
917 va_start(args, format);
918 vsprintf(tmp, format, args);
922 Assert(len < HUD_MSG_LENGTH_MAX); // If greater than this, probably crashed anyway.
923 hud_sourced_print(HUD_SOURCE_COMPUTER, tmp);
926 void HUD_ship_sent_printf(int sh, char *format, ...)
929 char tmp[HUD_MSG_LENGTH_MAX];
932 sprintf(tmp, NOX("%s: "), Ships[sh].ship_name);
934 Assert(len < HUD_MSG_LENGTH_MAX);
936 va_start(args, format);
937 vsprintf(tmp + len, format, args);
941 Assert(len < HUD_MSG_LENGTH_MAX); // If greater than this, probably crashed anyway.
942 hud_sourced_print(HUD_get_team_source(Ships[sh].team), tmp);
945 // --------------------------------------------------------------------------------------
946 // HUD_sourced_printf()
948 // HUD_sourced_printf() has the same parameters as printf(), but displays the text as a scrolling
949 // message on the HUD. Text is split into multiple lines if width exceeds msg display area
950 // width. 'source' is used to indicate who send the message, and is used to color code text.
952 void HUD_sourced_printf(int source, char *format, ...)
955 char tmp[HUD_MSG_LENGTH_MAX];
957 // make sure we only print these messages if we're in the correct state
958 if((Game_mode & GM_MULTIPLAYER) && (Net_player->state != NETPLAYER_STATE_IN_MISSION)){
959 nprintf(("Network","HUD_sourced_printf bailing because not in multiplayer game play state\n"));
963 va_start(args, format);
964 vsprintf(tmp, format, args);
966 Assert(strlen(tmp) < HUD_MSG_LENGTH_MAX); // If greater than this, probably crashed anyway.
967 hud_sourced_print(source, tmp);
970 void hud_sourced_print(int source, char *msg)
973 //char *src_str, *msg_str;
974 int sw, t, x, offset = 0;
975 //int fudge = (gr_screen.res == GR_640) ? 15 : 50; // prevents string from running off screen
977 if ( !strlen(msg) ) {
978 nprintf(("Warning", "HUD ==> attempt to print a 0 length string in msg window\n"));
982 // add message to the scrollback log first
983 hud_add_msg_to_scrollback(msg, source, timestamp());
985 ptr = strstr(msg, NOX(": ")) + 2;
987 gr_get_string_size(&sw, NULL, msg, ptr - msg); // get width of the speaker field
988 //if (sw < MSG_WINDOW_WIDTH - 20)
995 while ((ptr = split_str_once(str, MSG_WINDOW_WIDTH - x - 7)) != NULL) { // the 7 is a fudge hack
996 HUD_printf_line(str, source, t, x);
1002 HUD_printf_line(str, source, t, x);
1005 int hud_query_scrollback_size()
1007 int count = 0, y_add = 0;
1008 int font_height = gr_get_font_height();
1011 if (EMPTY(&Msg_scrollback_used_list) || !HUD_msg_inited)
1014 ptr = GET_FIRST(&Msg_scrollback_used_list);
1015 while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
1016 if (ptr->source != HUD_SOURCE_HIDDEN) {
1018 count += font_height + ptr->y;
1021 ptr = GET_NEXT(ptr);
1028 // add text directly to the hud scrollback log, without displaying on the hud
1029 void HUD_add_to_scrollback(char *text, int source)
1031 if (!strlen(text)) {
1032 nprintf(("Warning", "HUD ==> attempt to print a 0 length string in msg window\n"));
1036 hud_add_msg_to_scrollback(text, source, timestamp());
1039 // hud_add_msg_to_scrollback() adds the new_msg to the scroll-back message list. If there
1040 // are no more free slots, the first slot is released to make room for the new message.
1042 void hud_add_line_to_scrollback(char *text, int source, int t, int x, int y, int underline_width)
1044 line_node *new_line;
1046 Assert(HUD_msg_inited);
1047 if (!text || !strlen(text))
1050 if ( EMPTY(&Msg_scrollback_free_list) ) {
1051 new_line = GET_FIRST(&Msg_scrollback_used_list);
1052 list_remove(&Msg_scrollback_used_list, new_line);
1053 free(new_line->text);
1056 new_line = GET_FIRST(&Msg_scrollback_free_list);
1057 list_remove(&Msg_scrollback_free_list, new_line);
1062 new_line->underline_width = underline_width;
1064 new_line->source = source;
1065 new_line->text = (char *) malloc( strlen(text) + 1 );
1066 strcpy(new_line->text, text);
1067 list_append(&Msg_scrollback_used_list, new_line);
1070 void hud_add_msg_to_scrollback(char *text, int source, int t)
1072 char buf[HUD_MSG_LENGTH_MAX], *ptr, *str;
1073 int msg_len, w, max_width, x, offset = 0;
1075 max_width = Hud_mission_log_list2_coords[gr_screen.res][2];
1076 msg_len = strlen(text);
1081 Assert(msg_len < HUD_MSG_LENGTH_MAX);
1083 ptr = strstr(buf, NOX(": "));
1085 gr_get_string_size(&w, NULL, buf, ptr - buf);
1089 // gr_get_string_size(&w, NULL, buf, ptr - buf + 2);
1090 // if (w < max_width - 20)
1096 while ((ptr = split_str_once(str, max_width - x)) != NULL) {
1097 hud_add_line_to_scrollback(str, source, t, x, 1, w);
1103 hud_add_line_to_scrollback(str, source, t, x, 3, w);
1106 // hud_free_scrollback_list() will free the memory that was allocated to store the messages
1107 // for the scroll-back list
1109 void hud_free_scrollback_list()
1113 // check if the list has been inited yet. If not, return with doing nothing.
1114 if ( Msg_scrollback_used_list.next == NULL || Msg_scrollback_used_list.prev == NULL )
1117 A = GET_FIRST(&Msg_scrollback_used_list);
1118 while( A !=END_OF_LIST(&Msg_scrollback_used_list) ) {
1119 if ( A->text != NULL ) {
1128 // how many lines to skip
1129 int hud_get_scroll_max_pos()
1131 int max = 0, font_height = gr_get_font_height();
1133 if (Scrollback_mode == SCROLLBACK_MODE_MSGS_LOG) {
1136 // number of pixels in excess of what can be displayed
1137 int excess = Scroll_max - Hud_mission_log_list_coords[gr_screen.res][3];
1139 if (EMPTY(&Msg_scrollback_used_list) || !HUD_msg_inited) {
1143 ptr = GET_FIRST(&Msg_scrollback_used_list);
1144 while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
1145 if (ptr->source != HUD_SOURCE_HIDDEN) {
1148 excess -= font_height;
1157 // spacing between lines
1162 ptr = GET_NEXT(ptr);
1167 max = (Scroll_max - Hud_mission_log_list_coords[gr_screen.res][3]) / font_height;
1176 void hud_scroll_reset()
1178 if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) {
1182 Scroll_offset = hud_get_scroll_max_pos();
1186 void hud_scroll_list(int dir)
1189 if (Scroll_offset) {
1191 gamesnd_play_iface(SND_SCROLL);
1194 gamesnd_play_iface(SND_GENERAL_FAIL);
1197 if (Scroll_offset < hud_get_scroll_max_pos()) {
1199 gamesnd_play_iface(SND_SCROLL);
1202 gamesnd_play_iface(SND_GENERAL_FAIL);
1206 void hud_goto_pos(int delta)
1208 int pos=0, font_height = gr_get_font_height();
1210 if (Scrollback_mode == SCROLLBACK_MODE_MSGS_LOG) {
1211 int count = 0, y = 0;
1214 if (EMPTY(&Msg_scrollback_used_list) || !HUD_msg_inited)
1217 ptr = GET_FIRST(&Msg_scrollback_used_list);
1218 while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
1219 if (ptr->source != HUD_SOURCE_HIDDEN) {
1220 if (count == Scroll_offset) {
1225 y += font_height + ptr->y;
1229 ptr = GET_NEXT(ptr);
1232 Scroll_offset = count = y = 0;
1233 ptr = GET_FIRST(&Msg_scrollback_used_list);
1234 while (ptr != END_OF_LIST(&Msg_scrollback_used_list)) {
1235 if (ptr->source != HUD_SOURCE_HIDDEN) {
1236 if (y <= pos + delta)
1237 Scroll_offset = count;
1239 y += font_height + ptr->y;
1243 ptr = GET_NEXT(ptr);
1247 pos = Scroll_offset * font_height;
1249 Scroll_offset = pos / font_height;
1253 void hud_page_scroll_list(int dir)
1255 int max = hud_get_scroll_max_pos();
1258 if (Scroll_offset) {
1259 hud_goto_pos(-Hud_mission_log_list_coords[gr_screen.res][3]);
1260 if (Scroll_offset < 0)
1263 gamesnd_play_iface(SND_SCROLL);
1266 gamesnd_play_iface(SND_GENERAL_FAIL);
1269 if (Scroll_offset < max) {
1270 hud_goto_pos(Hud_mission_log_list_coords[gr_screen.res][3]);
1271 if (Scroll_offset > max)
1272 Scroll_offset = max;
1274 gamesnd_play_iface(SND_SCROLL);
1277 gamesnd_play_iface(SND_GENERAL_FAIL);
1281 void hud_scrollback_button_pressed(int n)
1284 case SCROLL_UP_BUTTON:
1288 case SCROLL_DOWN_BUTTON:
1292 case SHOW_MSGS_BUTTON:
1293 Scrollback_mode = SCROLLBACK_MODE_MSGS_LOG;
1294 Scroll_max = hud_query_scrollback_size();
1298 case SHOW_EVENTS_BUTTON:
1299 Scrollback_mode = SCROLLBACK_MODE_EVENT_LOG;
1300 Scroll_max = Num_log_lines * gr_get_font_height();
1304 case SHOW_OBJS_BUTTON:
1305 Scrollback_mode = SCROLLBACK_MODE_OBJECTIVES;
1306 Scroll_max = Num_obj_lines * gr_get_font_height();
1311 hud_scrollback_exit();
1316 void hud_scrollback_init()
1319 scrollback_buttons *b;
1321 // pause all game sounds
1322 beam_pause_sounds();
1323 audiostream_pause_all();
1325 common_set_interface_palette("BriefingPalette"); // set the interface palette
1326 Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
1327 Ui_window.set_mask_bmap(Hud_mission_log_mask_fname[gr_screen.res]);
1329 for (i=0; i<NUM_BUTTONS; i++) {
1330 b = &Buttons[gr_screen.res][i];
1332 b->button.create(&Ui_window, "", b->x, b->y, 60, 30, (i < 2), 1);
1333 // set up callback for when a mouse first goes over a button
1334 b->button.set_highlight_action(common_play_highlight_sound);
1335 b->button.set_bmaps(b->filename);
1336 b->button.link_hotspot(b->hotspot);
1340 Ui_window.add_XSTR("Continue", 1069, Buttons[gr_screen.res][ACCEPT_BUTTON].xt, Buttons[gr_screen.res][ACCEPT_BUTTON].yt, &Buttons[gr_screen.res][ACCEPT_BUTTON].button, UI_XSTR_COLOR_PINK);
1341 Ui_window.add_XSTR("Events", 1070, Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].xt, Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].yt, &Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].button, UI_XSTR_COLOR_GREEN);
1342 Ui_window.add_XSTR("Objectives", 1071, Buttons[gr_screen.res][SHOW_OBJS_BUTTON].xt, Buttons[gr_screen.res][SHOW_OBJS_BUTTON].yt, &Buttons[gr_screen.res][SHOW_OBJS_BUTTON].button, UI_XSTR_COLOR_GREEN);
1343 Ui_window.add_XSTR("Messages", 1072, Buttons[gr_screen.res][SHOW_MSGS_BUTTON].xt, Buttons[gr_screen.res][SHOW_MSGS_BUTTON].yt, &Buttons[gr_screen.res][SHOW_MSGS_BUTTON].button, UI_XSTR_COLOR_GREEN);
1345 // set up hotkeys for buttons so we draw the correct animation frame when a key is pressed
1346 Buttons[gr_screen.res][SCROLL_UP_BUTTON].button.set_hotkey(KEY_UP);
1347 Buttons[gr_screen.res][SCROLL_DOWN_BUTTON].button.set_hotkey(KEY_DOWN);
1349 Background_bitmap = bm_load(Hud_mission_log_fname[gr_screen.res]);
1350 // Status_bitmap = bm_load(Hud_mission_log_status_fname[gr_screen.res]);
1352 message_log_init_scrollback(Hud_mission_log_list_coords[gr_screen.res][2]);
1353 if (Scrollback_mode == SCROLLBACK_MODE_EVENT_LOG)
1354 Scroll_max = Num_log_lines * gr_get_font_height();
1355 else if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES)
1356 Scroll_max = Num_obj_lines * gr_get_font_height();
1358 Scroll_max = hud_query_scrollback_size();
1360 Num_obj_lines = ML_objectives_init(Hud_mission_log_list_coords[gr_screen.res][0], Hud_mission_log_list_coords[gr_screen.res][1], Hud_mission_log_list_coords[gr_screen.res][2], Hud_mission_log_list_objective_x_coord[gr_screen.res]);
1364 void hud_scrollback_close()
1366 ML_objectives_close();
1367 message_log_shutdown_scrollback();
1368 if (Background_bitmap >= 0)
1369 bm_unload(Background_bitmap);
1370 //if (Status_bitmap >= 0)
1371 // bm_unload(Status_bitmap);
1373 Ui_window.destroy();
1374 common_free_interface_palette(); // restore game palette
1377 // unpause all game sounds
1378 beam_unpause_sounds();
1379 audiostream_unpause_all();
1383 void hud_scrollback_do_frame(float frametime)
1386 int font_height = gr_get_font_height();
1388 k = Ui_window.process();
1392 if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) {
1393 Scrollback_mode = SCROLLBACK_MODE_MSGS_LOG;
1394 Scroll_max = hud_query_scrollback_size();
1397 } else if (Scrollback_mode == SCROLLBACK_MODE_MSGS_LOG) {
1398 Scrollback_mode = SCROLLBACK_MODE_EVENT_LOG;
1399 Scroll_max = Num_log_lines * gr_get_font_height();
1403 Scrollback_mode = SCROLLBACK_MODE_OBJECTIVES;
1404 Scroll_max = Num_obj_lines * gr_get_font_height();
1411 case KEY_SHIFTED | KEY_TAB:
1412 if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) {
1413 Scrollback_mode = SCROLLBACK_MODE_EVENT_LOG;
1414 Scroll_max = Num_log_lines * gr_get_font_height();
1417 } else if (Scrollback_mode == SCROLLBACK_MODE_MSGS_LOG) {
1418 Scrollback_mode = SCROLLBACK_MODE_OBJECTIVES;
1419 Scroll_max = Num_obj_lines * gr_get_font_height();
1423 Scrollback_mode = SCROLLBACK_MODE_MSGS_LOG;
1424 Scroll_max = hud_query_scrollback_size();
1431 hud_page_scroll_list(1);
1435 hud_page_scroll_list(0);
1439 case KEY_CTRLED | KEY_ENTER:
1441 hud_scrollback_exit();
1444 case KEY_F1: // show help overlay
1447 case KEY_F2: // goto options screen
1448 gameseq_post_event(GS_EVENT_OPTIONS_MENU);
1452 for (i=0; i<NUM_BUTTONS; i++){
1453 if (Buttons[gr_screen.res][i].button.pressed()){
1454 hud_scrollback_button_pressed(i);
1458 GR_MAYBE_CLEAR_RES(Background_bitmap);
1459 if (Background_bitmap >= 0) {
1460 gr_set_bitmap(Background_bitmap);
1465 if ((Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) && (Status_bitmap >= 0)) {
1466 gr_set_bitmap(Status_bitmap);
1467 gr_bitmap(Hud_mission_log_status_coords[gr_screen.res][0], Hud_mission_log_status_coords[gr_screen.res][1]);
1471 // draw the objectives key at the bottom of the ingame objectives screen
1472 if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) {
1473 ML_render_objectives_key();
1478 if (Scrollback_mode == SCROLLBACK_MODE_EVENT_LOG) {
1479 Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].button.draw_forced(2);
1480 mission_log_scrollback(Scroll_offset, Hud_mission_log_list_coords[gr_screen.res][0], Hud_mission_log_list_coords[gr_screen.res][1], Hud_mission_log_list_coords[gr_screen.res][2], Hud_mission_log_list_coords[gr_screen.res][3]);
1482 } else if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) {
1483 Buttons[gr_screen.res][SHOW_OBJS_BUTTON].button.draw_forced(2);
1484 ML_objectives_do_frame(Scroll_offset);
1487 line_node *node_ptr;
1489 Buttons[gr_screen.res][SHOW_MSGS_BUTTON].button.draw_forced(2);
1490 // y = ((LIST_H / font_height) - 1) * font_height;
1492 if ( !EMPTY(&Msg_scrollback_used_list) && HUD_msg_inited ) {
1493 node_ptr = GET_FIRST(&Msg_scrollback_used_list);
1495 while ( node_ptr != END_OF_LIST(&Msg_scrollback_used_list) ) {
1496 if ((node_ptr->source == HUD_SOURCE_HIDDEN) || (i++ < Scroll_offset)) {
1497 node_ptr = GET_NEXT(node_ptr);
1500 switch (node_ptr->source) {
1501 case HUD_SOURCE_FRIENDLY:
1505 case HUD_SOURCE_HOSTILE:
1509 case HUD_SOURCE_NEUTRAL:
1513 case HUD_SOURCE_UNKNOWN:
1517 case HUD_SOURCE_TRAINING:
1518 gr_set_color_fast(&Color_bright_blue);
1521 case HUD_SOURCE_TERRAN_CMD:
1522 gr_set_color_fast(&Color_bright_white);
1525 case HUD_SOURCE_IMPORTANT:
1526 case HUD_SOURCE_FAILED:
1527 case HUD_SOURCE_SATISFIED:
1528 gr_set_color_fast(&Color_bright_white);
1532 gr_set_color_fast(&Color_text_normal);
1537 gr_print_timestamp(Hud_mission_log_list_coords[gr_screen.res][0], Hud_mission_log_list_coords[gr_screen.res][1] + y, node_ptr->time);
1539 x = Hud_mission_log_list2_coords[gr_screen.res][0] + node_ptr->x;
1540 gr_printf(x, Hud_mission_log_list_coords[gr_screen.res][1] + y, "%s", node_ptr->text);
1541 if (node_ptr->underline_width)
1542 gr_line(x, Hud_mission_log_list_coords[gr_screen.res][1] + y + font_height - 1, x + node_ptr->underline_width, Hud_mission_log_list_coords[gr_screen.res][1] + y + font_height - 1);
1544 if ((node_ptr->source == HUD_SOURCE_FAILED) || (node_ptr->source == HUD_SOURCE_SATISFIED)) {
1546 if (node_ptr->source == HUD_SOURCE_FAILED)
1547 gr_set_color_fast(&Color_bright_red);
1549 gr_set_color_fast(&Color_bright_green);
1551 i = Hud_mission_log_list_coords[gr_screen.res][1] + y + font_height / 2 - 1;
1552 gr_circle(Hud_mission_log_list2_coords[gr_screen.res][0] - 6, i, 5);
1554 gr_set_color_fast(&Color_bright);
1555 gr_line(Hud_mission_log_list2_coords[gr_screen.res][0] - 10, i, Hud_mission_log_list2_coords[gr_screen.res][0] - 8, i);
1556 gr_line(Hud_mission_log_list2_coords[gr_screen.res][0] - 6, i - 4, Hud_mission_log_list2_coords[gr_screen.res][0] - 6, i - 2);
1557 gr_line(Hud_mission_log_list2_coords[gr_screen.res][0] - 4, i, Hud_mission_log_list2_coords[gr_screen.res][0] - 2, i);
1558 gr_line(Hud_mission_log_list2_coords[gr_screen.res][0] - 6, i + 2, Hud_mission_log_list2_coords[gr_screen.res][0] - 6, i + 4);
1561 y += font_height + node_ptr->y;
1562 node_ptr = GET_NEXT(node_ptr);
1563 if (y + font_height > Hud_mission_log_list_coords[gr_screen.res][3])
1570 gr_set_color_fast(&Color_text_heading);
1571 gr_print_timestamp(Hud_mission_log_time_coords[gr_screen.res][0], Hud_mission_log_time_coords[gr_screen.res][1] - font_height, (int) (f2fl(Missiontime) * 1000));
1572 gr_string(Hud_mission_log_time2_coords[gr_screen.res][0], Hud_mission_log_time_coords[gr_screen.res][1] - font_height, XSTR( "Current time", 289));
1576 void hud_scrollback_exit()
1578 gameseq_post_event(GS_EVENT_PREVIOUS_STATE);