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/GameHelp/GameplayHelp.cpp $
15 * Module for displaying in-game help
18 * Revision 1.3 2002/06/09 04:41:17 relnev
19 * added copyright header
21 * Revision 1.2 2002/05/07 03:16:44 theoddone33
22 * The Great Newline Fix
24 * Revision 1.1.1.1 2002/05/03 03:28:09 root
28 * 8 9/08/99 2:38p Jefff
29 * sound pausing going to menu from game
31 * 7 9/01/99 2:56p Jefff
32 * a few control key description changes
34 * 6 7/29/99 4:43p Jefff
35 * updated for fs2 -- fixed buttons, added "press esc" text, hi-res
38 * 5 7/15/99 9:20a Andsager
39 * FS2_DEMO initial checkin
41 * 4 1/30/99 5:08p Dave
42 * More new hi-res stuff.Support for nice D3D textures.
44 * 3 10/13/98 9:28a Dave
45 * Started neatening up freespace.h. Many variables renamed and
46 * reorganized. Added AlphaColors.[h,cpp]
48 * 2 10/07/98 10:52a Dave
51 * 1 10/07/98 10:48a Dave
53 * 21 6/17/98 11:01a Lawrance
54 * ensure translated descriptions appear in the online help
56 * 20 6/09/98 10:31a Hoffoss
57 * Created index numbers for all xstr() references. Any new xstr() stuff
58 * added from here on out should be added to the end if the list. The
59 * current list count can be found in FreeSpace.cpp (search for
62 * 19 5/17/98 3:33p Lawrance
63 * Add 'target last ship to send transmission' key to online help
65 * 18 5/15/98 8:36p Lawrance
66 * Add 'target ship that last sent transmission' target key
68 * 17 5/09/98 4:52p Lawrance
69 * Implement padlock view (up/rear/left/right)
71 * 16 4/27/98 10:11a Lawrance
72 * Add in disabled beep for missing buttons
74 * 15 4/25/98 1:25p Lawrance
75 * Change screen shot key to Print Scrn
77 * 14 4/22/98 2:50p John
78 * Made PrintScreen actually be Shift+PrintScreen.
80 * 13 4/18/98 9:21p Lawrance
81 * show correct key binding for screen shots
83 * 12 4/11/98 7:59p Lawrance
84 * Allow space, tab and enter to cycle through pages
86 * 11 4/05/98 7:44p Lawrance
87 * remove obsolete 'show goals' binding
89 * 10 4/02/98 11:40a Lawrance
90 * check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
92 * 9 4/01/98 2:22p Lawrance
93 * remove hotkey references in on-line help for demo builds
95 * 8 3/31/98 4:57p Lawrance
96 * update text for taking a screen shot
98 * 7 3/30/98 1:31p Lawrance
99 * Take out debug key help
101 * 6 3/25/98 5:34p Dave
102 * First rev of multiplayer online key help.
104 * 5 3/25/98 2:16p Dave
105 * Select random default image for newly created pilots. Fixed several
106 * multi-pause messaging bugs. Begin work on online help for multiplayer
109 * 4 3/18/98 12:03p John
110 * Marked all the new strings as externalized or not.
112 * 3 3/16/98 5:53p Lawrance
113 * Fix bug that was causing joystick only bindings to mess up
115 * 2 3/09/98 9:54p Lawrance
116 * integrate new art for gameplay help
118 * 1 3/09/98 5:05p Lawrance
123 #include "contexthelp.h"
124 #include "gamesequence.h"
125 #include "freespace.h"
132 #include "controlsconfig.h"
135 #include "missionscreencommon.h"
136 #include "alphacolors.h"
138 #include "audiostr.h"
140 // text positioning constats
143 #define X_OFFSET_1 70
145 // pixel offset for description of key from where key binding starts
146 #define KEY_DESCRIPTION_OFFSET 193
148 // different gameplay help pages
149 #define GP_FIRST_SCREEN 0 // keep up to date
151 #define GP_HELP_BASIC_KEYS 0
152 #define GP_HELP_MOVEMENT_KEYS 1
153 #define GP_HELP_COMMON_TARGET_KEYS 2
154 #define GP_HELP_ADVANCED_TARGET_KEYS 3
155 #define GP_HELP_MESSAGING 4
156 #define GP_HELP_WEAPON_KEYS 5
157 #define GP_HELP_THROTTLE_AND_ETS_KEYS 6
158 #define GP_HELP_VIEW_KEYS 7
159 #define GP_HELP_MISC_KEYS 8
160 #define GP_HELP_MULTI_KEYS 9
162 #define GP_LAST_SCREEN_SINGLE 8 // keep up to date
163 #define GP_LAST_SCREEN_MULTI 9 // keep up to date
165 // set this to GP_LAST_SCREEN_SINGLE or GP_LAST_SCREEN_MULTI based upon what game mode we're in
168 #define NUM_BUTTONS 3
169 #define PREVIOUS_PAGE_BUTTON 0
170 #define NEXT_PAGE_BUTTON 1
171 #define CONTINUE_BUTTON 2
173 struct gameplay_help_buttons {
179 UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
181 gameplay_help_buttons(char *name, int x1, int y1, int h) : filename(name), x(x1), y(y1), hotspot(h) {}
184 static gameplay_help_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
187 gameplay_help_buttons("F1B_00", 15, 389, 0),
188 gameplay_help_buttons("F1B_01", 60, 389, 1),
189 gameplay_help_buttons("F1B_02", 574, 431, 2)
192 gameplay_help_buttons("2_F1B_00", 24, 622, 0),
193 gameplay_help_buttons("2_F1B_01", 96, 622, 1),
194 gameplay_help_buttons("2_F1B_02", 919, 689, 2)
199 #define GAME_HELP_NUM_TEXT 2
200 static UI_XSTR Game_help_text[GR_NUM_RESOLUTIONS][GAME_HELP_NUM_TEXT] = {
202 { "Press ESC to return to the game", 1441, 263, 389, UI_XSTR_COLOR_GREEN, -1, NULL },
203 { "Continue", 1069, 571, 413, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
206 { "Press ESC to return to the game", 1441, 421, 622, UI_XSTR_COLOR_GREEN, -1, NULL },
207 { "Continue", 1069, 928, 663, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
211 static char *Game_help_filename[GR_NUM_RESOLUTIONS] = {
216 static char *Game_help_mask_filename[GR_NUM_RESOLUTIONS] = {
221 static UI_WINDOW Ui_window;
222 static int Background_bitmap;
223 static int Gameplay_help_inited = 0;
225 static int Current_help_page;
227 // generate a line for the on-line help for a control item with specified id
228 // input: id => index for control item within Control_config[]
229 // buf => buffer with enough space to hold ouput string
230 char *gameplay_help_control_text(int id, char *buf)
232 int has_key=0, has_joy=0;
235 ci = &Control_config[id];
237 if ( ci->key_id >= 0 ) {
238 sprintf(buf, textify_scancode(ci->key_id));
242 if ( ci->joy_id >= 0 ) {
244 strcat(buf, XSTR( ", ", 129));
246 strcat(buf, Joy_button_text[ci->joy_id]);
250 if ( !has_key && !has_joy ) {
251 strcpy(buf, XSTR( "no binding", 130));
254 strcat(buf, XSTR( " - ", 131));
255 strcat(buf, ci->text);
260 void gameplay_help_blit_control_line(int x, int y, int id)
262 int has_key=0, has_joy=0;
266 ci = &Control_config[id];
270 if ( ci->key_id >= 0 ) {
271 sprintf(buf, textify_scancode(ci->key_id));
275 if ( ci->joy_id >= 0 ) {
277 strcat(buf, XSTR( ", ", 129));
279 strcat(buf, Joy_button_text[ci->joy_id]);
283 if ( !has_key && !has_joy ) {
284 strcpy(buf, XSTR( "no binding", 130));
289 // gr_string(x+KEY_DESCRIPTION_OFFSET,y,ci->text);
290 gr_string(x+KEY_DESCRIPTION_OFFSET, y, XSTR(ci->text, CONTROL_CONFIG_XSTR + id));
293 void gameplay_help_blit_control_line_raw(int x, int y, char *control_text, char *control_description)
295 gr_string(x,y,control_text);
296 gr_string(x+KEY_DESCRIPTION_OFFSET,y,control_description);
299 // game_play_help_set_title() will display the title for the help screen and
300 // set the font for the rest of the screen
301 void gameplay_help_set_title(char *title)
306 gr_set_color_fast(&Color_bright);
307 gr_printf(0x8000,sy,title);
308 sprintf(buf, XSTR( "Page %d of %d", 132), Current_help_page+1, Gp_last_screen+1);
309 gr_printf(0x8000,sy+gr_get_font_height()+2,buf);
310 gr_set_color_fast(&Color_normal);
313 // called once when the gameplay help state is entered
314 void gameplay_help_init()
317 gameplay_help_buttons *b;
319 if ( Gameplay_help_inited ) {
323 common_set_interface_palette("InterfacePalette"); // set the interface palette
324 Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
325 Ui_window.set_mask_bmap(Game_help_mask_filename[gr_screen.res]);
327 for (i=0; i<NUM_BUTTONS; i++) {
328 b = &Buttons[gr_screen.res][i];
330 b->button.create(&Ui_window, "", b->x, b->y, 60, 30, 0, 1);
331 // set up callback for when a mouse first goes over a button
332 b->button.set_highlight_action(common_play_highlight_sound);
333 b->button.set_bmaps(b->filename);
334 b->button.link_hotspot(b->hotspot);
338 for (i=0; i<GAME_HELP_NUM_TEXT; i++)
340 Ui_window.add_XSTR(&Game_help_text[gr_screen.res][i]);
343 // set the proper last screen # based upon game mode
344 if(Game_mode & GM_MULTIPLAYER){
345 Gp_last_screen = GP_LAST_SCREEN_MULTI;
347 Gp_last_screen = GP_LAST_SCREEN_SINGLE;
350 // setup hotkeys so lights flash when keys are pressed
351 Buttons[gr_screen.res][CONTINUE_BUTTON].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
352 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.set_hotkey(KEY_LEFT);
353 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.set_hotkey(KEY_RIGHT);
355 Background_bitmap = bm_load(Game_help_filename[gr_screen.res]);
357 Current_help_page = GP_HELP_BASIC_KEYS;
358 Gameplay_help_inited = 1;
361 // called when moving to the previous help page
362 void gameplay_help_goto_prev_screen()
365 if (Current_help_page < GP_FIRST_SCREEN) {
366 Current_help_page = Gp_last_screen;
368 gamesnd_play_iface(SND_SWITCH_SCREENS);
372 // called when proceeding to the next help page
373 void gameplay_help_goto_next_screen()
376 if (Current_help_page > Gp_last_screen) {
377 Current_help_page = GP_FIRST_SCREEN;
379 gamesnd_play_iface(SND_SWITCH_SCREENS);
382 // called when the screen is exited
383 void gameplay_help_leave()
385 // unpause all game sounds
386 beam_unpause_sounds();
387 audiostream_unpause_all();
389 gameseq_post_event(GS_EVENT_PREVIOUS_STATE);
393 // deal with a keypress on the gameplay help screen
394 void gameplay_help_process_key(int k)
398 gameplay_help_leave();
404 //gameplay_help_goto_next_screen();
405 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.press_button();
408 case KEY_SHIFTED | KEY_TAB:
409 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.press_button();
410 // gameplay_help_goto_prev_screen();
419 // deal with buttons being pressed on the gameplay help screen
420 void gameplay_help_button_pressed(int n)
424 case PREVIOUS_PAGE_BUTTON:
425 gameplay_help_goto_prev_screen();
428 case NEXT_PAGE_BUTTON:
429 gameplay_help_goto_next_screen();
432 case CONTINUE_BUTTON:
433 gameplay_help_leave();
434 gamesnd_play_iface(SND_COMMIT_PRESSED);
443 // Draw the help text onto the screen
444 void gameplay_help_draw_text()
446 int x_offset, y_offset, separation;
448 separation = gr_get_font_height() + 3;
450 switch ( Current_help_page ) {
452 case GP_HELP_BASIC_KEYS:
453 gameplay_help_set_title(XSTR( "Basic Keys", 133));
457 y_offset += separation;
458 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
460 y_offset += separation;
461 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
463 y_offset += separation;
464 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
466 y_offset += separation;
467 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
469 y_offset += separation;
470 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
472 y_offset += separation;
473 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
475 y_offset += separation;
476 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
478 y_offset += separation;
479 y_offset += separation;
481 gr_set_color_fast(&Color_bright);
482 gr_printf(0x8000,y_offset,XSTR( "Function Keys", 134));
483 gr_set_color_fast(&Color_normal);
485 y_offset += separation;
486 y_offset += separation;
488 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F1", 135), XSTR( "context-sensitive help", 136));
490 y_offset += separation;
491 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F2", 137), XSTR( "options screen (available anywhere in game)", 138));
494 y_offset += separation;
495 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F3", 139), XSTR( "hotkey assignment", 140));
498 y_offset += separation;
499 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F4", 141), XSTR( "HUD message scroll-back", 142));
502 y_offset += separation;
503 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F5...F12", 143), XSTR( "hotkeys", 144));
506 y_offset += separation;
507 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Shift-Esc", 145), XSTR( "quit FreeSpace 2 immediately", 146));
511 case GP_HELP_MOVEMENT_KEYS:
512 gameplay_help_set_title(XSTR( "Movement Keys", 147));
516 gameplay_help_blit_control_line(x_offset, y_offset,FORWARD_THRUST);
518 y_offset += separation;
519 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
521 y_offset += separation;
522 gameplay_help_blit_control_line(x_offset, y_offset,ONE_THIRD_THROTTLE);
524 y_offset += separation;
525 gameplay_help_blit_control_line(x_offset, y_offset,TWO_THIRDS_THROTTLE);
527 y_offset += separation;
528 gameplay_help_blit_control_line(x_offset, y_offset,MINUS_5_PERCENT_THROTTLE);
530 y_offset += separation;
531 gameplay_help_blit_control_line(x_offset, y_offset,PLUS_5_PERCENT_THROTTLE);
533 y_offset += separation;
534 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
536 y_offset += separation;
537 gameplay_help_blit_control_line(x_offset, y_offset,AFTERBURNER);
539 y_offset += separation;
540 gameplay_help_blit_control_line(x_offset, y_offset,REVERSE_THRUST);
542 y_offset += separation;
543 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_FORWARD);
545 y_offset += separation;
546 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_BACK);
548 y_offset += separation;
549 gameplay_help_blit_control_line(x_offset, y_offset,YAW_LEFT);
551 y_offset += separation;
552 gameplay_help_blit_control_line(x_offset, y_offset,YAW_RIGHT);
554 y_offset += separation;
555 gameplay_help_blit_control_line(x_offset, y_offset,BANK_LEFT);
557 y_offset += separation;
558 gameplay_help_blit_control_line(x_offset, y_offset,BANK_RIGHT);
560 y_offset += separation;
561 gameplay_help_blit_control_line(x_offset, y_offset,BANK_WHEN_PRESSED);
564 case GP_HELP_COMMON_TARGET_KEYS:
565 gameplay_help_set_title(XSTR( "Basic Targeting Keys", 148));
569 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
571 y_offset += separation;
572 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
574 y_offset += separation;
575 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
577 y_offset += separation;
578 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SHIP_IN_RETICLE);
580 y_offset += separation;
581 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_HOSTILE);
583 y_offset += separation;
584 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_HOSTILE);
586 y_offset += separation;
587 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_FRIENDLY);
589 y_offset += separation;
590 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_FRIENDLY);
592 y_offset += separation;
593 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_SUBOBJECT);
595 y_offset += separation;
596 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_SUBOBJECT);
598 y_offset += separation;
599 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SUBOBJECT_IN_RETICLE);
601 y_offset += separation;
602 gameplay_help_blit_control_line(x_offset, y_offset,MATCH_TARGET_SPEED);
604 y_offset += separation;
605 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_MATCH_TARGET_SPEED);
608 case GP_HELP_ADVANCED_TARGET_KEYS:
609 gameplay_help_set_title(XSTR( "Advanced Targeting Keys", 149));
613 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_SELF);
615 y_offset += separation;
616 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_TARGET);
618 y_offset += separation;
619 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_LAST_TRANMISSION_SENDER);
621 y_offset += separation;
622 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_TARGETS_TARGET);
624 y_offset += separation;
625 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_ESCORT_SHIP);
627 y_offset += separation;
628 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_REPAIR_SHIP);
630 y_offset += separation;
631 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_UNINSPECTED_CARGO);
633 y_offset += separation;
634 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_UNINSPECTED_CARGO);
636 y_offset += separation;
637 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEWEST_SHIP);
639 y_offset += separation;
640 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_BOMB);
642 y_offset += separation;
643 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_BOMB);
645 y_offset += separation;
646 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SHIP);
648 y_offset += separation;
649 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_LIVE_TURRET);
651 y_offset += separation;
652 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_LIVE_TURRET);
654 y_offset += separation;
655 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SUBSYSTEM);
659 y_offset += separation;
660 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "Select target assigned to that hotkey", 150));
662 y_offset += separation;
663 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Shift-F5...F12", 151), XSTR( "Add/remove target from that hotkey", 152));
665 y_offset += separation;
666 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Alt-Shift-F5...F12", 153), XSTR( "Clear that hotkey", 154));
672 case GP_HELP_MESSAGING:
673 gameplay_help_set_title(XSTR( "Messaging Keys", 155));
677 gameplay_help_blit_control_line(x_offset, y_offset,SQUADMSG_MENU);
679 y_offset += separation;
680 gameplay_help_blit_control_line(x_offset, y_offset,REARM_MESSAGE);
682 y_offset += separation;
683 gameplay_help_blit_control_line(x_offset, y_offset,ATTACK_MESSAGE);
685 y_offset += separation;
686 gameplay_help_blit_control_line(x_offset, y_offset,DISARM_MESSAGE);
688 y_offset += separation;
689 gameplay_help_blit_control_line(x_offset, y_offset,DISABLE_MESSAGE);
691 y_offset += separation;
692 gameplay_help_blit_control_line(x_offset, y_offset,CAPTURE_MESSAGE);
694 y_offset += separation;
695 gameplay_help_blit_control_line(x_offset, y_offset,ENGAGE_MESSAGE);
697 y_offset += separation;
698 gameplay_help_blit_control_line(x_offset, y_offset,FORM_MESSAGE);
700 y_offset += separation;
701 gameplay_help_blit_control_line(x_offset, y_offset,IGNORE_MESSAGE);
703 y_offset += separation;
704 gameplay_help_blit_control_line(x_offset, y_offset,PROTECT_MESSAGE);
706 y_offset += separation;
707 gameplay_help_blit_control_line(x_offset, y_offset,COVER_MESSAGE);
709 y_offset += separation;
710 gameplay_help_blit_control_line(x_offset, y_offset,WARP_MESSAGE);
713 y_offset += separation;
714 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "send specified order to these target(s)", 156));
718 case GP_HELP_WEAPON_KEYS:
719 gameplay_help_set_title(XSTR( "Weapon Keys", 157));
723 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
725 y_offset += separation;
726 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_SECONDARY);
728 y_offset += separation;
729 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NEXT_PRIMARY);
731 y_offset += separation;
732 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_PREV_PRIMARY);
734 y_offset += separation;
735 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_SECONDARY);
737 y_offset += separation;
738 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NUM_MISSLES);
740 y_offset += separation;
741 gameplay_help_blit_control_line(x_offset, y_offset,LAUNCH_COUNTERMEASURE);
744 case GP_HELP_THROTTLE_AND_ETS_KEYS:
745 gameplay_help_set_title(XSTR( "Energy Management Keys", 158));
749 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_EQUALIZE);
751 y_offset += separation;
752 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_TOP);
754 y_offset += separation;
755 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_BOTTOM);
757 y_offset += separation;
758 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_LEFT);
760 y_offset += separation;
761 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_RIGHT);
763 y_offset += separation;
764 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_WEAPON);
766 y_offset += separation;
767 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_WEAPON);
769 y_offset += separation;
770 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_SHIELD);
772 y_offset += separation;
773 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_SHIELD);
775 y_offset += separation;
776 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_ENGINE);
778 y_offset += separation;
779 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_ENGINE);
781 y_offset += separation;
782 gameplay_help_blit_control_line(x_offset, y_offset,ETS_EQUALIZE);
784 y_offset += separation;
785 gameplay_help_blit_control_line(x_offset, y_offset,XFER_LASER);
787 y_offset += separation;
788 gameplay_help_blit_control_line(x_offset, y_offset,XFER_SHIELD);
792 case GP_HELP_MISC_KEYS:
793 gameplay_help_set_title(XSTR( "Miscellaneous Keys", 159));
799 y_offset += separation;
800 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
802 y_offset += separation;
803 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "ESC", 160), XSTR( "invoke abort mission popup", 161));
807 y_offset += separation;
808 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SPEED_UP);
810 y_offset += separation;
811 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SLOW_DOWN);
815 y_offset += separation;
816 gameplay_help_blit_control_line(x_offset, y_offset,RADAR_RANGE_CYCLE);
820 y_offset += separation;
821 gameplay_help_blit_control_line(x_offset, y_offset,ADD_REMOVE_ESCORT);
823 y_offset += separation;
824 gameplay_help_blit_control_line(x_offset, y_offset,ESCORT_CLEAR);
826 // Pause, Print Screenshot
827 y_offset += separation;
828 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Pause", 162), XSTR( "pause game", 163));
830 y_offset += separation;
831 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Print Scrn", 164), XSTR( "take screen shot", 165));
835 case GP_HELP_VIEW_KEYS:
836 gameplay_help_set_title(XSTR( "View Keys", 166));
840 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_UP);
842 y_offset += separation;
843 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_DOWN);
845 y_offset += separation;
846 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_LEFT);
848 y_offset += separation;
849 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_RIGHT);
851 y_offset += separation;
852 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CHASE);
854 y_offset += separation;
855 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL);
857 y_offset += separation;
858 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK);
860 y_offset += separation;
861 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_SLEW);
863 y_offset += separation;
864 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_INCREASE);
866 y_offset += separation;
867 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_DECREASE);
869 y_offset += separation;
870 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CENTER);
872 y_offset += separation;
873 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_OTHER_SHIP);
876 case GP_HELP_MULTI_KEYS:
877 gameplay_help_set_title(XSTR( "Multiplayer Keys", 167));
882 gr_set_color_fast(&Color_bright);
883 gr_printf(0x8000,y_offset,XSTR( "Ingame messaging keys (tap for text, hold for voice)", 168));
884 gr_set_color_fast(&Color_normal);
886 y_offset += separation;
888 y_offset += separation;
889 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_ALL);
891 y_offset += separation;
892 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_FRIENDLY);
894 y_offset += separation;
895 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_HOSTILE);
897 y_offset += separation;
898 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_TARGET);
905 // gameplay_help_do_frame() is the function that displays help when acutally playing the game
906 void gameplay_help_do_frame(float frametime)
910 // ensure the gameplay help interface has been initialized
911 if (!Gameplay_help_inited) {
916 // make sure game sounds are paused
918 audiostream_pause_all();
920 k = Ui_window.process() & ~KEY_DEBUGGED;
921 gameplay_help_process_key(k);
923 for (i=0; i<NUM_BUTTONS; i++){
924 if (Buttons[gr_screen.res][i].button.pressed()){
925 gameplay_help_button_pressed(i);
929 GR_MAYBE_CLEAR_RES(Background_bitmap);
930 if (Background_bitmap >= 0) {
931 gr_set_bitmap(Background_bitmap);
937 gameplay_help_draw_text();
942 // called once when leaving the gameplay help state
943 void gameplay_help_close()
945 if ( Gameplay_help_inited ) {
946 if (Background_bitmap >= 0) {
947 bm_unload(Background_bitmap);
951 common_free_interface_palette(); // restore game palette
955 Gameplay_help_inited = 0;