2 * $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
7 * Module for displaying in-game help
10 * Revision 1.1 2002/05/03 03:28:09 root
14 * 8 9/08/99 2:38p Jefff
15 * sound pausing going to menu from game
17 * 7 9/01/99 2:56p Jefff
18 * a few control key description changes
20 * 6 7/29/99 4:43p Jefff
21 * updated for fs2 -- fixed buttons, added "press esc" text, hi-res
24 * 5 7/15/99 9:20a Andsager
25 * FS2_DEMO initial checkin
27 * 4 1/30/99 5:08p Dave
28 * More new hi-res stuff.Support for nice D3D textures.
30 * 3 10/13/98 9:28a Dave
31 * Started neatening up freespace.h. Many variables renamed and
32 * reorganized. Added AlphaColors.[h,cpp]
34 * 2 10/07/98 10:52a Dave
37 * 1 10/07/98 10:48a Dave
39 * 21 6/17/98 11:01a Lawrance
40 * ensure translated descriptions appear in the online help
42 * 20 6/09/98 10:31a Hoffoss
43 * Created index numbers for all xstr() references. Any new xstr() stuff
44 * added from here on out should be added to the end if the list. The
45 * current list count can be found in FreeSpace.cpp (search for
48 * 19 5/17/98 3:33p Lawrance
49 * Add 'target last ship to send transmission' key to online help
51 * 18 5/15/98 8:36p Lawrance
52 * Add 'target ship that last sent transmission' target key
54 * 17 5/09/98 4:52p Lawrance
55 * Implement padlock view (up/rear/left/right)
57 * 16 4/27/98 10:11a Lawrance
58 * Add in disabled beep for missing buttons
60 * 15 4/25/98 1:25p Lawrance
61 * Change screen shot key to Print Scrn
63 * 14 4/22/98 2:50p John
64 * Made PrintScreen actually be Shift+PrintScreen.
66 * 13 4/18/98 9:21p Lawrance
67 * show correct key binding for screen shots
69 * 12 4/11/98 7:59p Lawrance
70 * Allow space, tab and enter to cycle through pages
72 * 11 4/05/98 7:44p Lawrance
73 * remove obsolete 'show goals' binding
75 * 10 4/02/98 11:40a Lawrance
76 * check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
78 * 9 4/01/98 2:22p Lawrance
79 * remove hotkey references in on-line help for demo builds
81 * 8 3/31/98 4:57p Lawrance
82 * update text for taking a screen shot
84 * 7 3/30/98 1:31p Lawrance
85 * Take out debug key help
87 * 6 3/25/98 5:34p Dave
88 * First rev of multiplayer online key help.
90 * 5 3/25/98 2:16p Dave
91 * Select random default image for newly created pilots. Fixed several
92 * multi-pause messaging bugs. Begin work on online help for multiplayer
95 * 4 3/18/98 12:03p John
96 * Marked all the new strings as externalized or not.
98 * 3 3/16/98 5:53p Lawrance
99 * Fix bug that was causing joystick only bindings to mess up
101 * 2 3/09/98 9:54p Lawrance
102 * integrate new art for gameplay help
104 * 1 3/09/98 5:05p Lawrance
109 #include "contexthelp.h"
110 #include "gamesequence.h"
111 #include "freespace.h"
118 #include "controlsconfig.h"
121 #include "missionscreencommon.h"
122 #include "alphacolors.h"
124 #include "audiostr.h"
126 // text positioning constats
129 #define X_OFFSET_1 70
131 // pixel offset for description of key from where key binding starts
132 #define KEY_DESCRIPTION_OFFSET 193
134 // different gameplay help pages
135 #define GP_FIRST_SCREEN 0 // keep up to date
137 #define GP_HELP_BASIC_KEYS 0
138 #define GP_HELP_MOVEMENT_KEYS 1
139 #define GP_HELP_COMMON_TARGET_KEYS 2
140 #define GP_HELP_ADVANCED_TARGET_KEYS 3
141 #define GP_HELP_MESSAGING 4
142 #define GP_HELP_WEAPON_KEYS 5
143 #define GP_HELP_THROTTLE_AND_ETS_KEYS 6
144 #define GP_HELP_VIEW_KEYS 7
145 #define GP_HELP_MISC_KEYS 8
146 #define GP_HELP_MULTI_KEYS 9
148 #define GP_LAST_SCREEN_SINGLE 8 // keep up to date
149 #define GP_LAST_SCREEN_MULTI 9 // keep up to date
151 // set this to GP_LAST_SCREEN_SINGLE or GP_LAST_SCREEN_MULTI based upon what game mode we're in
154 #define NUM_BUTTONS 3
155 #define PREVIOUS_PAGE_BUTTON 0
156 #define NEXT_PAGE_BUTTON 1
157 #define CONTINUE_BUTTON 2
159 struct gameplay_help_buttons {
165 UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
167 gameplay_help_buttons(char *name, int x1, int y1, int h) : filename(name), x(x1), y(y1), hotspot(h) {}
170 static gameplay_help_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
173 gameplay_help_buttons("F1B_00", 15, 389, 0),
174 gameplay_help_buttons("F1B_01", 60, 389, 1),
175 gameplay_help_buttons("F1B_02", 574, 431, 2)
178 gameplay_help_buttons("2_F1B_00", 24, 622, 0),
179 gameplay_help_buttons("2_F1B_01", 96, 622, 1),
180 gameplay_help_buttons("2_F1B_02", 919, 689, 2)
185 #define GAME_HELP_NUM_TEXT 2
186 static UI_XSTR Game_help_text[GR_NUM_RESOLUTIONS][GAME_HELP_NUM_TEXT] = {
188 { "Press ESC to return to the game", 1441, 263, 389, UI_XSTR_COLOR_GREEN, -1, NULL },
189 { "Continue", 1069, 571, 413, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
192 { "Press ESC to return to the game", 1441, 421, 622, UI_XSTR_COLOR_GREEN, -1, NULL },
193 { "Continue", 1069, 928, 663, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
197 static char *Game_help_filename[GR_NUM_RESOLUTIONS] = {
202 static char *Game_help_mask_filename[GR_NUM_RESOLUTIONS] = {
207 static UI_WINDOW Ui_window;
208 static int Background_bitmap;
209 static int Gameplay_help_inited = 0;
211 static int Current_help_page;
213 // generate a line for the on-line help for a control item with specified id
214 // input: id => index for control item within Control_config[]
215 // buf => buffer with enough space to hold ouput string
216 char *gameplay_help_control_text(int id, char *buf)
218 int has_key=0, has_joy=0;
221 ci = &Control_config[id];
223 if ( ci->key_id >= 0 ) {
224 sprintf(buf, textify_scancode(ci->key_id));
228 if ( ci->joy_id >= 0 ) {
230 strcat(buf, XSTR( ", ", 129));
232 strcat(buf, Joy_button_text[ci->joy_id]);
236 if ( !has_key && !has_joy ) {
237 strcpy(buf, XSTR( "no binding", 130));
240 strcat(buf, XSTR( " - ", 131));
241 strcat(buf, ci->text);
246 void gameplay_help_blit_control_line(int x, int y, int id)
248 int has_key=0, has_joy=0;
252 ci = &Control_config[id];
256 if ( ci->key_id >= 0 ) {
257 sprintf(buf, textify_scancode(ci->key_id));
261 if ( ci->joy_id >= 0 ) {
263 strcat(buf, XSTR( ", ", 129));
265 strcat(buf, Joy_button_text[ci->joy_id]);
269 if ( !has_key && !has_joy ) {
270 strcpy(buf, XSTR( "no binding", 130));
275 // gr_string(x+KEY_DESCRIPTION_OFFSET,y,ci->text);
276 gr_string(x+KEY_DESCRIPTION_OFFSET, y, XSTR(ci->text, CONTROL_CONFIG_XSTR + id));
279 void gameplay_help_blit_control_line_raw(int x, int y, char *control_text, char *control_description)
281 gr_string(x,y,control_text);
282 gr_string(x+KEY_DESCRIPTION_OFFSET,y,control_description);
285 // game_play_help_set_title() will display the title for the help screen and
286 // set the font for the rest of the screen
287 void gameplay_help_set_title(char *title)
292 gr_set_color_fast(&Color_bright);
293 gr_printf(0x8000,sy,title);
294 sprintf(buf, XSTR( "Page %d of %d", 132), Current_help_page+1, Gp_last_screen+1);
295 gr_printf(0x8000,sy+gr_get_font_height()+2,buf);
296 gr_set_color_fast(&Color_normal);
299 // called once when the gameplay help state is entered
300 void gameplay_help_init()
303 gameplay_help_buttons *b;
305 if ( Gameplay_help_inited ) {
309 common_set_interface_palette("InterfacePalette"); // set the interface palette
310 Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
311 Ui_window.set_mask_bmap(Game_help_mask_filename[gr_screen.res]);
313 for (i=0; i<NUM_BUTTONS; i++) {
314 b = &Buttons[gr_screen.res][i];
316 b->button.create(&Ui_window, "", b->x, b->y, 60, 30, 0, 1);
317 // set up callback for when a mouse first goes over a button
318 b->button.set_highlight_action(common_play_highlight_sound);
319 b->button.set_bmaps(b->filename);
320 b->button.link_hotspot(b->hotspot);
324 for (i=0; i<GAME_HELP_NUM_TEXT; i++)
326 Ui_window.add_XSTR(&Game_help_text[gr_screen.res][i]);
329 // set the proper last screen # based upon game mode
330 if(Game_mode & GM_MULTIPLAYER){
331 Gp_last_screen = GP_LAST_SCREEN_MULTI;
333 Gp_last_screen = GP_LAST_SCREEN_SINGLE;
336 // setup hotkeys so lights flash when keys are pressed
337 Buttons[gr_screen.res][CONTINUE_BUTTON].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
338 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.set_hotkey(KEY_LEFT);
339 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.set_hotkey(KEY_RIGHT);
341 Background_bitmap = bm_load(Game_help_filename[gr_screen.res]);
343 Current_help_page = GP_HELP_BASIC_KEYS;
344 Gameplay_help_inited = 1;
347 // called when moving to the previous help page
348 void gameplay_help_goto_prev_screen()
351 if (Current_help_page < GP_FIRST_SCREEN) {
352 Current_help_page = Gp_last_screen;
354 gamesnd_play_iface(SND_SWITCH_SCREENS);
358 // called when proceeding to the next help page
359 void gameplay_help_goto_next_screen()
362 if (Current_help_page > Gp_last_screen) {
363 Current_help_page = GP_FIRST_SCREEN;
365 gamesnd_play_iface(SND_SWITCH_SCREENS);
368 // called when the screen is exited
369 void gameplay_help_leave()
371 // unpause all game sounds
372 beam_unpause_sounds();
373 audiostream_unpause_all();
375 gameseq_post_event(GS_EVENT_PREVIOUS_STATE);
379 // deal with a keypress on the gameplay help screen
380 void gameplay_help_process_key(int k)
384 gameplay_help_leave();
390 //gameplay_help_goto_next_screen();
391 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.press_button();
394 case KEY_SHIFTED | KEY_TAB:
395 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.press_button();
396 // gameplay_help_goto_prev_screen();
405 // deal with buttons being pressed on the gameplay help screen
406 void gameplay_help_button_pressed(int n)
410 case PREVIOUS_PAGE_BUTTON:
411 gameplay_help_goto_prev_screen();
414 case NEXT_PAGE_BUTTON:
415 gameplay_help_goto_next_screen();
418 case CONTINUE_BUTTON:
419 gameplay_help_leave();
420 gamesnd_play_iface(SND_COMMIT_PRESSED);
429 // Draw the help text onto the screen
430 void gameplay_help_draw_text()
432 int x_offset, y_offset, separation;
434 separation = gr_get_font_height() + 3;
436 switch ( Current_help_page ) {
438 case GP_HELP_BASIC_KEYS:
439 gameplay_help_set_title(XSTR( "Basic Keys", 133));
443 y_offset += separation;
444 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
446 y_offset += separation;
447 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
449 y_offset += separation;
450 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
452 y_offset += separation;
453 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
455 y_offset += separation;
456 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
458 y_offset += separation;
459 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
461 y_offset += separation;
462 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
464 y_offset += separation;
465 y_offset += separation;
467 gr_set_color_fast(&Color_bright);
468 gr_printf(0x8000,y_offset,XSTR( "Function Keys", 134));
469 gr_set_color_fast(&Color_normal);
471 y_offset += separation;
472 y_offset += separation;
474 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F1", 135), XSTR( "context-sensitive help", 136));
476 y_offset += separation;
477 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F2", 137), XSTR( "options screen (available anywhere in game)", 138));
480 y_offset += separation;
481 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F3", 139), XSTR( "hotkey assignment", 140));
484 y_offset += separation;
485 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F4", 141), XSTR( "HUD message scroll-back", 142));
488 y_offset += separation;
489 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F5...F12", 143), XSTR( "hotkeys", 144));
492 y_offset += separation;
493 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Shift-Esc", 145), XSTR( "quit FreeSpace 2 immediately", 146));
497 case GP_HELP_MOVEMENT_KEYS:
498 gameplay_help_set_title(XSTR( "Movement Keys", 147));
502 gameplay_help_blit_control_line(x_offset, y_offset,FORWARD_THRUST);
504 y_offset += separation;
505 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
507 y_offset += separation;
508 gameplay_help_blit_control_line(x_offset, y_offset,ONE_THIRD_THROTTLE);
510 y_offset += separation;
511 gameplay_help_blit_control_line(x_offset, y_offset,TWO_THIRDS_THROTTLE);
513 y_offset += separation;
514 gameplay_help_blit_control_line(x_offset, y_offset,MINUS_5_PERCENT_THROTTLE);
516 y_offset += separation;
517 gameplay_help_blit_control_line(x_offset, y_offset,PLUS_5_PERCENT_THROTTLE);
519 y_offset += separation;
520 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
522 y_offset += separation;
523 gameplay_help_blit_control_line(x_offset, y_offset,AFTERBURNER);
525 y_offset += separation;
526 gameplay_help_blit_control_line(x_offset, y_offset,REVERSE_THRUST);
528 y_offset += separation;
529 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_FORWARD);
531 y_offset += separation;
532 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_BACK);
534 y_offset += separation;
535 gameplay_help_blit_control_line(x_offset, y_offset,YAW_LEFT);
537 y_offset += separation;
538 gameplay_help_blit_control_line(x_offset, y_offset,YAW_RIGHT);
540 y_offset += separation;
541 gameplay_help_blit_control_line(x_offset, y_offset,BANK_LEFT);
543 y_offset += separation;
544 gameplay_help_blit_control_line(x_offset, y_offset,BANK_RIGHT);
546 y_offset += separation;
547 gameplay_help_blit_control_line(x_offset, y_offset,BANK_WHEN_PRESSED);
550 case GP_HELP_COMMON_TARGET_KEYS:
551 gameplay_help_set_title(XSTR( "Basic Targeting Keys", 148));
555 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
557 y_offset += separation;
558 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
560 y_offset += separation;
561 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
563 y_offset += separation;
564 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SHIP_IN_RETICLE);
566 y_offset += separation;
567 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_HOSTILE);
569 y_offset += separation;
570 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_HOSTILE);
572 y_offset += separation;
573 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_FRIENDLY);
575 y_offset += separation;
576 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_FRIENDLY);
578 y_offset += separation;
579 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_SUBOBJECT);
581 y_offset += separation;
582 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_SUBOBJECT);
584 y_offset += separation;
585 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SUBOBJECT_IN_RETICLE);
587 y_offset += separation;
588 gameplay_help_blit_control_line(x_offset, y_offset,MATCH_TARGET_SPEED);
590 y_offset += separation;
591 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_MATCH_TARGET_SPEED);
594 case GP_HELP_ADVANCED_TARGET_KEYS:
595 gameplay_help_set_title(XSTR( "Advanced Targeting Keys", 149));
599 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_SELF);
601 y_offset += separation;
602 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_TARGET);
604 y_offset += separation;
605 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_LAST_TRANMISSION_SENDER);
607 y_offset += separation;
608 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_TARGETS_TARGET);
610 y_offset += separation;
611 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_ESCORT_SHIP);
613 y_offset += separation;
614 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_REPAIR_SHIP);
616 y_offset += separation;
617 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_UNINSPECTED_CARGO);
619 y_offset += separation;
620 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_UNINSPECTED_CARGO);
622 y_offset += separation;
623 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEWEST_SHIP);
625 y_offset += separation;
626 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_BOMB);
628 y_offset += separation;
629 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_BOMB);
631 y_offset += separation;
632 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SHIP);
634 y_offset += separation;
635 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_LIVE_TURRET);
637 y_offset += separation;
638 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_LIVE_TURRET);
640 y_offset += separation;
641 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SUBSYSTEM);
645 y_offset += separation;
646 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "Select target assigned to that hotkey", 150));
648 y_offset += separation;
649 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Shift-F5...F12", 151), XSTR( "Add/remove target from that hotkey", 152));
651 y_offset += separation;
652 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Alt-Shift-F5...F12", 153), XSTR( "Clear that hotkey", 154));
658 case GP_HELP_MESSAGING:
659 gameplay_help_set_title(XSTR( "Messaging Keys", 155));
663 gameplay_help_blit_control_line(x_offset, y_offset,SQUADMSG_MENU);
665 y_offset += separation;
666 gameplay_help_blit_control_line(x_offset, y_offset,REARM_MESSAGE);
668 y_offset += separation;
669 gameplay_help_blit_control_line(x_offset, y_offset,ATTACK_MESSAGE);
671 y_offset += separation;
672 gameplay_help_blit_control_line(x_offset, y_offset,DISARM_MESSAGE);
674 y_offset += separation;
675 gameplay_help_blit_control_line(x_offset, y_offset,DISABLE_MESSAGE);
677 y_offset += separation;
678 gameplay_help_blit_control_line(x_offset, y_offset,CAPTURE_MESSAGE);
680 y_offset += separation;
681 gameplay_help_blit_control_line(x_offset, y_offset,ENGAGE_MESSAGE);
683 y_offset += separation;
684 gameplay_help_blit_control_line(x_offset, y_offset,FORM_MESSAGE);
686 y_offset += separation;
687 gameplay_help_blit_control_line(x_offset, y_offset,IGNORE_MESSAGE);
689 y_offset += separation;
690 gameplay_help_blit_control_line(x_offset, y_offset,PROTECT_MESSAGE);
692 y_offset += separation;
693 gameplay_help_blit_control_line(x_offset, y_offset,COVER_MESSAGE);
695 y_offset += separation;
696 gameplay_help_blit_control_line(x_offset, y_offset,WARP_MESSAGE);
699 y_offset += separation;
700 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "send specified order to these target(s)", 156));
704 case GP_HELP_WEAPON_KEYS:
705 gameplay_help_set_title(XSTR( "Weapon Keys", 157));
709 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
711 y_offset += separation;
712 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_SECONDARY);
714 y_offset += separation;
715 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NEXT_PRIMARY);
717 y_offset += separation;
718 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_PREV_PRIMARY);
720 y_offset += separation;
721 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_SECONDARY);
723 y_offset += separation;
724 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NUM_MISSLES);
726 y_offset += separation;
727 gameplay_help_blit_control_line(x_offset, y_offset,LAUNCH_COUNTERMEASURE);
730 case GP_HELP_THROTTLE_AND_ETS_KEYS:
731 gameplay_help_set_title(XSTR( "Energy Management Keys", 158));
735 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_EQUALIZE);
737 y_offset += separation;
738 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_TOP);
740 y_offset += separation;
741 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_BOTTOM);
743 y_offset += separation;
744 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_LEFT);
746 y_offset += separation;
747 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_RIGHT);
749 y_offset += separation;
750 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_WEAPON);
752 y_offset += separation;
753 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_WEAPON);
755 y_offset += separation;
756 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_SHIELD);
758 y_offset += separation;
759 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_SHIELD);
761 y_offset += separation;
762 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_ENGINE);
764 y_offset += separation;
765 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_ENGINE);
767 y_offset += separation;
768 gameplay_help_blit_control_line(x_offset, y_offset,ETS_EQUALIZE);
770 y_offset += separation;
771 gameplay_help_blit_control_line(x_offset, y_offset,XFER_LASER);
773 y_offset += separation;
774 gameplay_help_blit_control_line(x_offset, y_offset,XFER_SHIELD);
778 case GP_HELP_MISC_KEYS:
779 gameplay_help_set_title(XSTR( "Miscellaneous Keys", 159));
785 y_offset += separation;
786 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
788 y_offset += separation;
789 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "ESC", 160), XSTR( "invoke abort mission popup", 161));
793 y_offset += separation;
794 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SPEED_UP);
796 y_offset += separation;
797 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SLOW_DOWN);
801 y_offset += separation;
802 gameplay_help_blit_control_line(x_offset, y_offset,RADAR_RANGE_CYCLE);
806 y_offset += separation;
807 gameplay_help_blit_control_line(x_offset, y_offset,ADD_REMOVE_ESCORT);
809 y_offset += separation;
810 gameplay_help_blit_control_line(x_offset, y_offset,ESCORT_CLEAR);
812 // Pause, Print Screenshot
813 y_offset += separation;
814 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Pause", 162), XSTR( "pause game", 163));
816 y_offset += separation;
817 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Print Scrn", 164), XSTR( "take screen shot", 165));
821 case GP_HELP_VIEW_KEYS:
822 gameplay_help_set_title(XSTR( "View Keys", 166));
826 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_UP);
828 y_offset += separation;
829 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_DOWN);
831 y_offset += separation;
832 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_LEFT);
834 y_offset += separation;
835 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_RIGHT);
837 y_offset += separation;
838 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CHASE);
840 y_offset += separation;
841 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL);
843 y_offset += separation;
844 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK);
846 y_offset += separation;
847 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_SLEW);
849 y_offset += separation;
850 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_INCREASE);
852 y_offset += separation;
853 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_DECREASE);
855 y_offset += separation;
856 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CENTER);
858 y_offset += separation;
859 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_OTHER_SHIP);
862 case GP_HELP_MULTI_KEYS:
863 gameplay_help_set_title(XSTR( "Multiplayer Keys", 167));
868 gr_set_color_fast(&Color_bright);
869 gr_printf(0x8000,y_offset,XSTR( "Ingame messaging keys (tap for text, hold for voice)", 168));
870 gr_set_color_fast(&Color_normal);
872 y_offset += separation;
874 y_offset += separation;
875 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_ALL);
877 y_offset += separation;
878 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_FRIENDLY);
880 y_offset += separation;
881 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_HOSTILE);
883 y_offset += separation;
884 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_TARGET);
891 // gameplay_help_do_frame() is the function that displays help when acutally playing the game
892 void gameplay_help_do_frame(float frametime)
896 // ensure the gameplay help interface has been initialized
897 if (!Gameplay_help_inited) {
902 // make sure game sounds are paused
904 audiostream_pause_all();
906 k = Ui_window.process() & ~KEY_DEBUGGED;
907 gameplay_help_process_key(k);
909 for (i=0; i<NUM_BUTTONS; i++){
910 if (Buttons[gr_screen.res][i].button.pressed()){
911 gameplay_help_button_pressed(i);
915 GR_MAYBE_CLEAR_RES(Background_bitmap);
916 if (Background_bitmap >= 0) {
917 gr_set_bitmap(Background_bitmap);
923 gameplay_help_draw_text();
928 // called once when leaving the gameplay help state
929 void gameplay_help_close()
931 if ( Gameplay_help_inited ) {
932 if (Background_bitmap >= 0) {
933 bm_unload(Background_bitmap);
937 common_free_interface_palette(); // restore game palette
941 Gameplay_help_inited = 0;