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.4 2003/05/25 02:30:42 taylor
21 * Revision 1.3 2002/06/09 04:41:17 relnev
22 * added copyright header
24 * Revision 1.2 2002/05/07 03:16:44 theoddone33
25 * The Great Newline Fix
27 * Revision 1.1.1.1 2002/05/03 03:28:09 root
31 * 8 9/08/99 2:38p Jefff
32 * sound pausing going to menu from game
34 * 7 9/01/99 2:56p Jefff
35 * a few control key description changes
37 * 6 7/29/99 4:43p Jefff
38 * updated for fs2 -- fixed buttons, added "press esc" text, hi-res
41 * 5 7/15/99 9:20a Andsager
42 * FS2_DEMO initial checkin
44 * 4 1/30/99 5:08p Dave
45 * More new hi-res stuff.Support for nice D3D textures.
47 * 3 10/13/98 9:28a Dave
48 * Started neatening up freespace.h. Many variables renamed and
49 * reorganized. Added AlphaColors.[h,cpp]
51 * 2 10/07/98 10:52a Dave
54 * 1 10/07/98 10:48a Dave
56 * 21 6/17/98 11:01a Lawrance
57 * ensure translated descriptions appear in the online help
59 * 20 6/09/98 10:31a Hoffoss
60 * Created index numbers for all xstr() references. Any new xstr() stuff
61 * added from here on out should be added to the end if the list. The
62 * current list count can be found in FreeSpace.cpp (search for
65 * 19 5/17/98 3:33p Lawrance
66 * Add 'target last ship to send transmission' key to online help
68 * 18 5/15/98 8:36p Lawrance
69 * Add 'target ship that last sent transmission' target key
71 * 17 5/09/98 4:52p Lawrance
72 * Implement padlock view (up/rear/left/right)
74 * 16 4/27/98 10:11a Lawrance
75 * Add in disabled beep for missing buttons
77 * 15 4/25/98 1:25p Lawrance
78 * Change screen shot key to Print Scrn
80 * 14 4/22/98 2:50p John
81 * Made PrintScreen actually be Shift+PrintScreen.
83 * 13 4/18/98 9:21p Lawrance
84 * show correct key binding for screen shots
86 * 12 4/11/98 7:59p Lawrance
87 * Allow space, tab and enter to cycle through pages
89 * 11 4/05/98 7:44p Lawrance
90 * remove obsolete 'show goals' binding
92 * 10 4/02/98 11:40a Lawrance
93 * check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
95 * 9 4/01/98 2:22p Lawrance
96 * remove hotkey references in on-line help for demo builds
98 * 8 3/31/98 4:57p Lawrance
99 * update text for taking a screen shot
101 * 7 3/30/98 1:31p Lawrance
102 * Take out debug key help
104 * 6 3/25/98 5:34p Dave
105 * First rev of multiplayer online key help.
107 * 5 3/25/98 2:16p Dave
108 * Select random default image for newly created pilots. Fixed several
109 * multi-pause messaging bugs. Begin work on online help for multiplayer
112 * 4 3/18/98 12:03p John
113 * Marked all the new strings as externalized or not.
115 * 3 3/16/98 5:53p Lawrance
116 * Fix bug that was causing joystick only bindings to mess up
118 * 2 3/09/98 9:54p Lawrance
119 * integrate new art for gameplay help
121 * 1 3/09/98 5:05p Lawrance
126 #include "contexthelp.h"
127 #include "gamesequence.h"
128 #include "freespace.h"
135 #include "controlsconfig.h"
138 #include "missionscreencommon.h"
139 #include "alphacolors.h"
141 #include "audiostr.h"
143 // text positioning constats
146 #define X_OFFSET_1 70
148 // pixel offset for description of key from where key binding starts
149 #define KEY_DESCRIPTION_OFFSET 193
151 // different gameplay help pages
152 #define GP_FIRST_SCREEN 0 // keep up to date
154 #define GP_HELP_BASIC_KEYS 0
155 #define GP_HELP_MOVEMENT_KEYS 1
156 #define GP_HELP_COMMON_TARGET_KEYS 2
157 #define GP_HELP_ADVANCED_TARGET_KEYS 3
158 #define GP_HELP_MESSAGING 4
159 #define GP_HELP_WEAPON_KEYS 5
160 #define GP_HELP_THROTTLE_AND_ETS_KEYS 6
161 #define GP_HELP_VIEW_KEYS 7
162 #define GP_HELP_MISC_KEYS 8
163 #define GP_HELP_MULTI_KEYS 9
165 #define GP_LAST_SCREEN_SINGLE 8 // keep up to date
166 #define GP_LAST_SCREEN_MULTI 9 // keep up to date
168 // set this to GP_LAST_SCREEN_SINGLE or GP_LAST_SCREEN_MULTI based upon what game mode we're in
171 #define NUM_BUTTONS 3
172 #define PREVIOUS_PAGE_BUTTON 0
173 #define NEXT_PAGE_BUTTON 1
174 #define CONTINUE_BUTTON 2
176 struct gameplay_help_buttons {
182 UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
184 gameplay_help_buttons(char *name, int x1, int y1, int h) : filename(name), x(x1), y(y1), hotspot(h) {}
187 static gameplay_help_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
191 gameplay_help_buttons("F1B_00", 71, 373, 0), // previous
192 gameplay_help_buttons("F1B_01", 121, 373, 1), // next
193 // gameplay_help_buttons("F1B_02", 447, 452, 2), // options
194 gameplay_help_buttons("F1B_03", 554, 411, 3), // continue
196 gameplay_help_buttons("F1B_00", 15, 389, 0),
197 gameplay_help_buttons("F1B_01", 60, 389, 1),
198 gameplay_help_buttons("F1B_02", 574, 431, 2)
202 gameplay_help_buttons("2_F1B_00", 24, 622, 0),
203 gameplay_help_buttons("2_F1B_01", 96, 622, 1),
204 gameplay_help_buttons("2_F1B_02", 919, 689, 2)
210 #define GAME_HELP_NUM_TEXT 0
212 #define GAME_HELP_NUM_TEXT 2
214 static UI_XSTR Game_help_text[GR_NUM_RESOLUTIONS][GAME_HELP_NUM_TEXT] = {
216 // not needed for FS1
218 { "Press ESC to return to the game", 1441, 263, 389, UI_XSTR_COLOR_GREEN, -1, NULL },
219 { "Continue", 1069, 571, 413, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
223 // not needed for FS1
225 { "Press ESC to return to the game", 1441, 421, 622, UI_XSTR_COLOR_GREEN, -1, NULL },
226 { "Continue", 1069, 928, 663, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
231 static char *Game_help_filename[GR_NUM_RESOLUTIONS] = {
236 static char *Game_help_mask_filename[GR_NUM_RESOLUTIONS] = {
241 static UI_WINDOW Ui_window;
242 static int Background_bitmap;
243 static int Gameplay_help_inited = 0;
245 static int Current_help_page;
247 // generate a line for the on-line help for a control item with specified id
248 // input: id => index for control item within Control_config[]
249 // buf => buffer with enough space to hold ouput string
250 char *gameplay_help_control_text(int id, char *buf)
252 int has_key=0, has_joy=0;
255 ci = &Control_config[id];
257 if ( ci->key_id >= 0 ) {
258 sprintf(buf, textify_scancode(ci->key_id));
262 if ( ci->joy_id >= 0 ) {
264 strcat(buf, XSTR( ", ", 129));
266 strcat(buf, Joy_button_text[ci->joy_id]);
270 if ( !has_key && !has_joy ) {
271 strcpy(buf, XSTR( "no binding", 130));
274 strcat(buf, XSTR( " - ", 131));
275 strcat(buf, ci->text);
280 void gameplay_help_blit_control_line(int x, int y, int id)
282 int has_key=0, has_joy=0;
286 ci = &Control_config[id];
290 if ( ci->key_id >= 0 ) {
291 sprintf(buf, textify_scancode(ci->key_id));
295 if ( ci->joy_id >= 0 ) {
297 strcat(buf, XSTR( ", ", 129));
299 strcat(buf, Joy_button_text[ci->joy_id]);
303 if ( !has_key && !has_joy ) {
304 strcpy(buf, XSTR( "no binding", 130));
309 // gr_string(x+KEY_DESCRIPTION_OFFSET,y,ci->text);
310 gr_string(x+KEY_DESCRIPTION_OFFSET, y, XSTR(ci->text, CONTROL_CONFIG_XSTR + id));
313 void gameplay_help_blit_control_line_raw(int x, int y, char *control_text, char *control_description)
315 gr_string(x,y,control_text);
316 gr_string(x+KEY_DESCRIPTION_OFFSET,y,control_description);
319 // game_play_help_set_title() will display the title for the help screen and
320 // set the font for the rest of the screen
321 void gameplay_help_set_title(char *title)
326 gr_set_color_fast(&Color_bright);
327 gr_printf(0x8000,sy,title);
328 sprintf(buf, XSTR( "Page %d of %d", 132), Current_help_page+1, Gp_last_screen+1);
329 gr_printf(0x8000,sy+gr_get_font_height()+2,buf);
330 gr_set_color_fast(&Color_normal);
333 // called once when the gameplay help state is entered
334 void gameplay_help_init()
337 gameplay_help_buttons *b;
339 if ( Gameplay_help_inited ) {
343 common_set_interface_palette("InterfacePalette"); // set the interface palette
344 Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
345 Ui_window.set_mask_bmap(Game_help_mask_filename[gr_screen.res]);
347 for (i=0; i<NUM_BUTTONS; i++) {
348 b = &Buttons[gr_screen.res][i];
350 b->button.create(&Ui_window, "", b->x, b->y, 60, 30, 0, 1);
351 // set up callback for when a mouse first goes over a button
352 b->button.set_highlight_action(common_play_highlight_sound);
353 b->button.set_bmaps(b->filename);
354 b->button.link_hotspot(b->hotspot);
358 for (i=0; i<GAME_HELP_NUM_TEXT; i++)
360 Ui_window.add_XSTR(&Game_help_text[gr_screen.res][i]);
363 // set the proper last screen # based upon game mode
364 if(Game_mode & GM_MULTIPLAYER){
365 Gp_last_screen = GP_LAST_SCREEN_MULTI;
367 Gp_last_screen = GP_LAST_SCREEN_SINGLE;
370 // setup hotkeys so lights flash when keys are pressed
371 Buttons[gr_screen.res][CONTINUE_BUTTON].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
372 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.set_hotkey(KEY_LEFT);
373 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.set_hotkey(KEY_RIGHT);
375 Background_bitmap = bm_load(Game_help_filename[gr_screen.res]);
377 Current_help_page = GP_HELP_BASIC_KEYS;
378 Gameplay_help_inited = 1;
381 // called when moving to the previous help page
382 void gameplay_help_goto_prev_screen()
385 if (Current_help_page < GP_FIRST_SCREEN) {
386 Current_help_page = Gp_last_screen;
388 gamesnd_play_iface(SND_SWITCH_SCREENS);
392 // called when proceeding to the next help page
393 void gameplay_help_goto_next_screen()
396 if (Current_help_page > Gp_last_screen) {
397 Current_help_page = GP_FIRST_SCREEN;
399 gamesnd_play_iface(SND_SWITCH_SCREENS);
402 // called when the screen is exited
403 void gameplay_help_leave()
405 // unpause all game sounds
406 beam_unpause_sounds();
407 audiostream_unpause_all();
409 gameseq_post_event(GS_EVENT_PREVIOUS_STATE);
413 // deal with a keypress on the gameplay help screen
414 void gameplay_help_process_key(int k)
418 gameplay_help_leave();
424 //gameplay_help_goto_next_screen();
425 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.press_button();
428 case KEY_SHIFTED | KEY_TAB:
429 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.press_button();
430 // gameplay_help_goto_prev_screen();
439 // deal with buttons being pressed on the gameplay help screen
440 void gameplay_help_button_pressed(int n)
444 case PREVIOUS_PAGE_BUTTON:
445 gameplay_help_goto_prev_screen();
448 case NEXT_PAGE_BUTTON:
449 gameplay_help_goto_next_screen();
452 case CONTINUE_BUTTON:
453 gameplay_help_leave();
454 gamesnd_play_iface(SND_COMMIT_PRESSED);
463 // Draw the help text onto the screen
464 void gameplay_help_draw_text()
466 int x_offset, y_offset, separation;
468 separation = gr_get_font_height() + 3;
470 switch ( Current_help_page ) {
472 case GP_HELP_BASIC_KEYS:
473 gameplay_help_set_title(XSTR( "Basic Keys", 133));
477 y_offset += separation;
478 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
480 y_offset += separation;
481 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
483 y_offset += separation;
484 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
486 y_offset += separation;
487 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
489 y_offset += separation;
490 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
492 y_offset += separation;
493 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
495 y_offset += separation;
496 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
498 y_offset += separation;
499 y_offset += separation;
501 gr_set_color_fast(&Color_bright);
502 gr_printf(0x8000,y_offset,XSTR( "Function Keys", 134));
503 gr_set_color_fast(&Color_normal);
505 y_offset += separation;
506 y_offset += separation;
508 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F1", 135), XSTR( "context-sensitive help", 136));
510 y_offset += separation;
511 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F2", 137), XSTR( "options screen (available anywhere in game)", 138));
513 #if !(defined(FS2_DEMO) || defined(FS1_DEMO))
514 y_offset += separation;
515 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F3", 139), XSTR( "hotkey assignment", 140));
518 y_offset += separation;
519 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F4", 141), XSTR( "HUD message scroll-back", 142));
521 #if !(defined(FS2_DEMO) || defined(FS1_DEMO))
522 y_offset += separation;
523 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F5...F12", 143), XSTR( "hotkeys", 144));
526 y_offset += separation;
527 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Shift-Esc", 145), XSTR( "quit FreeSpace 2 immediately", 146));
531 case GP_HELP_MOVEMENT_KEYS:
532 gameplay_help_set_title(XSTR( "Movement Keys", 147));
536 gameplay_help_blit_control_line(x_offset, y_offset,FORWARD_THRUST);
538 y_offset += separation;
539 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
541 y_offset += separation;
542 gameplay_help_blit_control_line(x_offset, y_offset,ONE_THIRD_THROTTLE);
544 y_offset += separation;
545 gameplay_help_blit_control_line(x_offset, y_offset,TWO_THIRDS_THROTTLE);
547 y_offset += separation;
548 gameplay_help_blit_control_line(x_offset, y_offset,MINUS_5_PERCENT_THROTTLE);
550 y_offset += separation;
551 gameplay_help_blit_control_line(x_offset, y_offset,PLUS_5_PERCENT_THROTTLE);
553 y_offset += separation;
554 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
556 y_offset += separation;
557 gameplay_help_blit_control_line(x_offset, y_offset,AFTERBURNER);
559 y_offset += separation;
560 gameplay_help_blit_control_line(x_offset, y_offset,REVERSE_THRUST);
562 y_offset += separation;
563 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_FORWARD);
565 y_offset += separation;
566 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_BACK);
568 y_offset += separation;
569 gameplay_help_blit_control_line(x_offset, y_offset,YAW_LEFT);
571 y_offset += separation;
572 gameplay_help_blit_control_line(x_offset, y_offset,YAW_RIGHT);
574 y_offset += separation;
575 gameplay_help_blit_control_line(x_offset, y_offset,BANK_LEFT);
577 y_offset += separation;
578 gameplay_help_blit_control_line(x_offset, y_offset,BANK_RIGHT);
580 y_offset += separation;
581 gameplay_help_blit_control_line(x_offset, y_offset,BANK_WHEN_PRESSED);
584 case GP_HELP_COMMON_TARGET_KEYS:
585 gameplay_help_set_title(XSTR( "Basic Targeting Keys", 148));
589 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
591 y_offset += separation;
592 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
594 y_offset += separation;
595 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
597 y_offset += separation;
598 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SHIP_IN_RETICLE);
600 y_offset += separation;
601 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_HOSTILE);
603 y_offset += separation;
604 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_HOSTILE);
606 y_offset += separation;
607 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_FRIENDLY);
609 y_offset += separation;
610 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_FRIENDLY);
612 y_offset += separation;
613 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_SUBOBJECT);
615 y_offset += separation;
616 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_SUBOBJECT);
618 y_offset += separation;
619 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SUBOBJECT_IN_RETICLE);
621 y_offset += separation;
622 gameplay_help_blit_control_line(x_offset, y_offset,MATCH_TARGET_SPEED);
624 y_offset += separation;
625 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_MATCH_TARGET_SPEED);
628 case GP_HELP_ADVANCED_TARGET_KEYS:
629 gameplay_help_set_title(XSTR( "Advanced Targeting Keys", 149));
633 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_SELF);
635 y_offset += separation;
636 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_TARGET);
638 y_offset += separation;
639 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_LAST_TRANMISSION_SENDER);
641 y_offset += separation;
642 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_TARGETS_TARGET);
644 y_offset += separation;
645 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_ESCORT_SHIP);
647 y_offset += separation;
648 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_REPAIR_SHIP);
650 y_offset += separation;
651 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_UNINSPECTED_CARGO);
653 y_offset += separation;
654 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_UNINSPECTED_CARGO);
656 y_offset += separation;
657 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEWEST_SHIP);
659 y_offset += separation;
660 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_BOMB);
662 y_offset += separation;
663 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_BOMB);
665 y_offset += separation;
666 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SHIP);
668 y_offset += separation;
669 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_LIVE_TURRET);
671 y_offset += separation;
672 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_LIVE_TURRET);
674 y_offset += separation;
675 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SUBSYSTEM);
677 #if !(defined(FS2_DEMO) || defined(FS1_DEMO))
679 y_offset += separation;
680 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "Select target assigned to that hotkey", 150));
682 y_offset += separation;
683 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Shift-F5...F12", 151), XSTR( "Add/remove target from that hotkey", 152));
685 y_offset += separation;
686 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Alt-Shift-F5...F12", 153), XSTR( "Clear that hotkey", 154));
692 case GP_HELP_MESSAGING:
693 gameplay_help_set_title(XSTR( "Messaging Keys", 155));
697 gameplay_help_blit_control_line(x_offset, y_offset,SQUADMSG_MENU);
699 y_offset += separation;
700 gameplay_help_blit_control_line(x_offset, y_offset,REARM_MESSAGE);
702 y_offset += separation;
703 gameplay_help_blit_control_line(x_offset, y_offset,ATTACK_MESSAGE);
705 y_offset += separation;
706 gameplay_help_blit_control_line(x_offset, y_offset,DISARM_MESSAGE);
708 y_offset += separation;
709 gameplay_help_blit_control_line(x_offset, y_offset,DISABLE_MESSAGE);
711 y_offset += separation;
712 gameplay_help_blit_control_line(x_offset, y_offset,CAPTURE_MESSAGE);
714 y_offset += separation;
715 gameplay_help_blit_control_line(x_offset, y_offset,ENGAGE_MESSAGE);
717 y_offset += separation;
718 gameplay_help_blit_control_line(x_offset, y_offset,FORM_MESSAGE);
720 y_offset += separation;
721 gameplay_help_blit_control_line(x_offset, y_offset,IGNORE_MESSAGE);
723 y_offset += separation;
724 gameplay_help_blit_control_line(x_offset, y_offset,PROTECT_MESSAGE);
726 y_offset += separation;
727 gameplay_help_blit_control_line(x_offset, y_offset,COVER_MESSAGE);
729 y_offset += separation;
730 gameplay_help_blit_control_line(x_offset, y_offset,WARP_MESSAGE);
732 #if !(defined(FS2_DEMO) || defined(FS1_DEMO))
733 y_offset += separation;
734 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "send specified order to these target(s)", 156));
738 case GP_HELP_WEAPON_KEYS:
739 gameplay_help_set_title(XSTR( "Weapon Keys", 157));
743 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
745 y_offset += separation;
746 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_SECONDARY);
748 y_offset += separation;
749 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NEXT_PRIMARY);
751 y_offset += separation;
752 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_PREV_PRIMARY);
754 y_offset += separation;
755 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_SECONDARY);
757 y_offset += separation;
758 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NUM_MISSLES);
760 y_offset += separation;
761 gameplay_help_blit_control_line(x_offset, y_offset,LAUNCH_COUNTERMEASURE);
764 case GP_HELP_THROTTLE_AND_ETS_KEYS:
765 gameplay_help_set_title(XSTR( "Energy Management Keys", 158));
769 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_EQUALIZE);
771 y_offset += separation;
772 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_TOP);
774 y_offset += separation;
775 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_BOTTOM);
777 y_offset += separation;
778 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_LEFT);
780 y_offset += separation;
781 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_RIGHT);
783 y_offset += separation;
784 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_WEAPON);
786 y_offset += separation;
787 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_WEAPON);
789 y_offset += separation;
790 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_SHIELD);
792 y_offset += separation;
793 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_SHIELD);
795 y_offset += separation;
796 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_ENGINE);
798 y_offset += separation;
799 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_ENGINE);
801 y_offset += separation;
802 gameplay_help_blit_control_line(x_offset, y_offset,ETS_EQUALIZE);
804 y_offset += separation;
805 gameplay_help_blit_control_line(x_offset, y_offset,XFER_LASER);
807 y_offset += separation;
808 gameplay_help_blit_control_line(x_offset, y_offset,XFER_SHIELD);
812 case GP_HELP_MISC_KEYS:
813 gameplay_help_set_title(XSTR( "Miscellaneous Keys", 159));
819 y_offset += separation;
820 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
822 y_offset += separation;
823 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "ESC", 160), XSTR( "invoke abort mission popup", 161));
827 y_offset += separation;
828 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SPEED_UP);
830 y_offset += separation;
831 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SLOW_DOWN);
835 y_offset += separation;
836 gameplay_help_blit_control_line(x_offset, y_offset,RADAR_RANGE_CYCLE);
840 y_offset += separation;
841 gameplay_help_blit_control_line(x_offset, y_offset,ADD_REMOVE_ESCORT);
843 y_offset += separation;
844 gameplay_help_blit_control_line(x_offset, y_offset,ESCORT_CLEAR);
846 // Pause, Print Screenshot
847 y_offset += separation;
848 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Pause", 162), XSTR( "pause game", 163));
850 y_offset += separation;
851 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Print Scrn", 164), XSTR( "take screen shot", 165));
855 case GP_HELP_VIEW_KEYS:
856 gameplay_help_set_title(XSTR( "View Keys", 166));
860 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_UP);
862 y_offset += separation;
863 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_DOWN);
865 y_offset += separation;
866 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_LEFT);
868 y_offset += separation;
869 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_RIGHT);
871 y_offset += separation;
872 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CHASE);
874 y_offset += separation;
875 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL);
877 y_offset += separation;
878 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK);
880 y_offset += separation;
881 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_SLEW);
883 y_offset += separation;
884 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_INCREASE);
886 y_offset += separation;
887 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_DECREASE);
889 y_offset += separation;
890 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CENTER);
892 y_offset += separation;
893 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_OTHER_SHIP);
896 case GP_HELP_MULTI_KEYS:
897 gameplay_help_set_title(XSTR( "Multiplayer Keys", 167));
902 gr_set_color_fast(&Color_bright);
903 gr_printf(0x8000,y_offset,XSTR( "Ingame messaging keys (tap for text, hold for voice)", 168));
904 gr_set_color_fast(&Color_normal);
906 y_offset += separation;
908 y_offset += separation;
909 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_ALL);
911 y_offset += separation;
912 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_FRIENDLY);
914 y_offset += separation;
915 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_HOSTILE);
917 y_offset += separation;
918 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_TARGET);
925 // gameplay_help_do_frame() is the function that displays help when acutally playing the game
926 void gameplay_help_do_frame(float frametime)
930 // ensure the gameplay help interface has been initialized
931 if (!Gameplay_help_inited) {
936 // make sure game sounds are paused
938 audiostream_pause_all();
940 k = Ui_window.process() & ~KEY_DEBUGGED;
941 gameplay_help_process_key(k);
943 for (i=0; i<NUM_BUTTONS; i++){
944 if (Buttons[gr_screen.res][i].button.pressed()){
945 gameplay_help_button_pressed(i);
949 GR_MAYBE_CLEAR_RES(Background_bitmap);
950 if (Background_bitmap >= 0) {
951 gr_set_bitmap(Background_bitmap);
957 gameplay_help_draw_text();
962 // called once when leaving the gameplay help state
963 void gameplay_help_close()
965 if ( Gameplay_help_inited ) {
966 if (Background_bitmap >= 0) {
967 bm_unload(Background_bitmap);
971 common_free_interface_palette(); // restore game palette
975 Gameplay_help_inited = 0;