2 * $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
7 * Module for displaying in-game help
10 * Revision 1.2 2002/05/07 03:16:44 theoddone33
11 * The Great Newline Fix
13 * Revision 1.1.1.1 2002/05/03 03:28:09 root
17 * 8 9/08/99 2:38p Jefff
18 * sound pausing going to menu from game
20 * 7 9/01/99 2:56p Jefff
21 * a few control key description changes
23 * 6 7/29/99 4:43p Jefff
24 * updated for fs2 -- fixed buttons, added "press esc" text, hi-res
27 * 5 7/15/99 9:20a Andsager
28 * FS2_DEMO initial checkin
30 * 4 1/30/99 5:08p Dave
31 * More new hi-res stuff.Support for nice D3D textures.
33 * 3 10/13/98 9:28a Dave
34 * Started neatening up freespace.h. Many variables renamed and
35 * reorganized. Added AlphaColors.[h,cpp]
37 * 2 10/07/98 10:52a Dave
40 * 1 10/07/98 10:48a Dave
42 * 21 6/17/98 11:01a Lawrance
43 * ensure translated descriptions appear in the online help
45 * 20 6/09/98 10:31a Hoffoss
46 * Created index numbers for all xstr() references. Any new xstr() stuff
47 * added from here on out should be added to the end if the list. The
48 * current list count can be found in FreeSpace.cpp (search for
51 * 19 5/17/98 3:33p Lawrance
52 * Add 'target last ship to send transmission' key to online help
54 * 18 5/15/98 8:36p Lawrance
55 * Add 'target ship that last sent transmission' target key
57 * 17 5/09/98 4:52p Lawrance
58 * Implement padlock view (up/rear/left/right)
60 * 16 4/27/98 10:11a Lawrance
61 * Add in disabled beep for missing buttons
63 * 15 4/25/98 1:25p Lawrance
64 * Change screen shot key to Print Scrn
66 * 14 4/22/98 2:50p John
67 * Made PrintScreen actually be Shift+PrintScreen.
69 * 13 4/18/98 9:21p Lawrance
70 * show correct key binding for screen shots
72 * 12 4/11/98 7:59p Lawrance
73 * Allow space, tab and enter to cycle through pages
75 * 11 4/05/98 7:44p Lawrance
76 * remove obsolete 'show goals' binding
78 * 10 4/02/98 11:40a Lawrance
79 * check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
81 * 9 4/01/98 2:22p Lawrance
82 * remove hotkey references in on-line help for demo builds
84 * 8 3/31/98 4:57p Lawrance
85 * update text for taking a screen shot
87 * 7 3/30/98 1:31p Lawrance
88 * Take out debug key help
90 * 6 3/25/98 5:34p Dave
91 * First rev of multiplayer online key help.
93 * 5 3/25/98 2:16p Dave
94 * Select random default image for newly created pilots. Fixed several
95 * multi-pause messaging bugs. Begin work on online help for multiplayer
98 * 4 3/18/98 12:03p John
99 * Marked all the new strings as externalized or not.
101 * 3 3/16/98 5:53p Lawrance
102 * Fix bug that was causing joystick only bindings to mess up
104 * 2 3/09/98 9:54p Lawrance
105 * integrate new art for gameplay help
107 * 1 3/09/98 5:05p Lawrance
112 #include "contexthelp.h"
113 #include "gamesequence.h"
114 #include "freespace.h"
121 #include "controlsconfig.h"
124 #include "missionscreencommon.h"
125 #include "alphacolors.h"
127 #include "audiostr.h"
129 // text positioning constats
132 #define X_OFFSET_1 70
134 // pixel offset for description of key from where key binding starts
135 #define KEY_DESCRIPTION_OFFSET 193
137 // different gameplay help pages
138 #define GP_FIRST_SCREEN 0 // keep up to date
140 #define GP_HELP_BASIC_KEYS 0
141 #define GP_HELP_MOVEMENT_KEYS 1
142 #define GP_HELP_COMMON_TARGET_KEYS 2
143 #define GP_HELP_ADVANCED_TARGET_KEYS 3
144 #define GP_HELP_MESSAGING 4
145 #define GP_HELP_WEAPON_KEYS 5
146 #define GP_HELP_THROTTLE_AND_ETS_KEYS 6
147 #define GP_HELP_VIEW_KEYS 7
148 #define GP_HELP_MISC_KEYS 8
149 #define GP_HELP_MULTI_KEYS 9
151 #define GP_LAST_SCREEN_SINGLE 8 // keep up to date
152 #define GP_LAST_SCREEN_MULTI 9 // keep up to date
154 // set this to GP_LAST_SCREEN_SINGLE or GP_LAST_SCREEN_MULTI based upon what game mode we're in
157 #define NUM_BUTTONS 3
158 #define PREVIOUS_PAGE_BUTTON 0
159 #define NEXT_PAGE_BUTTON 1
160 #define CONTINUE_BUTTON 2
162 struct gameplay_help_buttons {
168 UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
170 gameplay_help_buttons(char *name, int x1, int y1, int h) : filename(name), x(x1), y(y1), hotspot(h) {}
173 static gameplay_help_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
176 gameplay_help_buttons("F1B_00", 15, 389, 0),
177 gameplay_help_buttons("F1B_01", 60, 389, 1),
178 gameplay_help_buttons("F1B_02", 574, 431, 2)
181 gameplay_help_buttons("2_F1B_00", 24, 622, 0),
182 gameplay_help_buttons("2_F1B_01", 96, 622, 1),
183 gameplay_help_buttons("2_F1B_02", 919, 689, 2)
188 #define GAME_HELP_NUM_TEXT 2
189 static UI_XSTR Game_help_text[GR_NUM_RESOLUTIONS][GAME_HELP_NUM_TEXT] = {
191 { "Press ESC to return to the game", 1441, 263, 389, UI_XSTR_COLOR_GREEN, -1, NULL },
192 { "Continue", 1069, 571, 413, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
195 { "Press ESC to return to the game", 1441, 421, 622, UI_XSTR_COLOR_GREEN, -1, NULL },
196 { "Continue", 1069, 928, 663, UI_XSTR_COLOR_GREEN, -1, &Buttons[gr_screen.res][CONTINUE_BUTTON].button }
200 static char *Game_help_filename[GR_NUM_RESOLUTIONS] = {
205 static char *Game_help_mask_filename[GR_NUM_RESOLUTIONS] = {
210 static UI_WINDOW Ui_window;
211 static int Background_bitmap;
212 static int Gameplay_help_inited = 0;
214 static int Current_help_page;
216 // generate a line for the on-line help for a control item with specified id
217 // input: id => index for control item within Control_config[]
218 // buf => buffer with enough space to hold ouput string
219 char *gameplay_help_control_text(int id, char *buf)
221 int has_key=0, has_joy=0;
224 ci = &Control_config[id];
226 if ( ci->key_id >= 0 ) {
227 sprintf(buf, textify_scancode(ci->key_id));
231 if ( ci->joy_id >= 0 ) {
233 strcat(buf, XSTR( ", ", 129));
235 strcat(buf, Joy_button_text[ci->joy_id]);
239 if ( !has_key && !has_joy ) {
240 strcpy(buf, XSTR( "no binding", 130));
243 strcat(buf, XSTR( " - ", 131));
244 strcat(buf, ci->text);
249 void gameplay_help_blit_control_line(int x, int y, int id)
251 int has_key=0, has_joy=0;
255 ci = &Control_config[id];
259 if ( ci->key_id >= 0 ) {
260 sprintf(buf, textify_scancode(ci->key_id));
264 if ( ci->joy_id >= 0 ) {
266 strcat(buf, XSTR( ", ", 129));
268 strcat(buf, Joy_button_text[ci->joy_id]);
272 if ( !has_key && !has_joy ) {
273 strcpy(buf, XSTR( "no binding", 130));
278 // gr_string(x+KEY_DESCRIPTION_OFFSET,y,ci->text);
279 gr_string(x+KEY_DESCRIPTION_OFFSET, y, XSTR(ci->text, CONTROL_CONFIG_XSTR + id));
282 void gameplay_help_blit_control_line_raw(int x, int y, char *control_text, char *control_description)
284 gr_string(x,y,control_text);
285 gr_string(x+KEY_DESCRIPTION_OFFSET,y,control_description);
288 // game_play_help_set_title() will display the title for the help screen and
289 // set the font for the rest of the screen
290 void gameplay_help_set_title(char *title)
295 gr_set_color_fast(&Color_bright);
296 gr_printf(0x8000,sy,title);
297 sprintf(buf, XSTR( "Page %d of %d", 132), Current_help_page+1, Gp_last_screen+1);
298 gr_printf(0x8000,sy+gr_get_font_height()+2,buf);
299 gr_set_color_fast(&Color_normal);
302 // called once when the gameplay help state is entered
303 void gameplay_help_init()
306 gameplay_help_buttons *b;
308 if ( Gameplay_help_inited ) {
312 common_set_interface_palette("InterfacePalette"); // set the interface palette
313 Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
314 Ui_window.set_mask_bmap(Game_help_mask_filename[gr_screen.res]);
316 for (i=0; i<NUM_BUTTONS; i++) {
317 b = &Buttons[gr_screen.res][i];
319 b->button.create(&Ui_window, "", b->x, b->y, 60, 30, 0, 1);
320 // set up callback for when a mouse first goes over a button
321 b->button.set_highlight_action(common_play_highlight_sound);
322 b->button.set_bmaps(b->filename);
323 b->button.link_hotspot(b->hotspot);
327 for (i=0; i<GAME_HELP_NUM_TEXT; i++)
329 Ui_window.add_XSTR(&Game_help_text[gr_screen.res][i]);
332 // set the proper last screen # based upon game mode
333 if(Game_mode & GM_MULTIPLAYER){
334 Gp_last_screen = GP_LAST_SCREEN_MULTI;
336 Gp_last_screen = GP_LAST_SCREEN_SINGLE;
339 // setup hotkeys so lights flash when keys are pressed
340 Buttons[gr_screen.res][CONTINUE_BUTTON].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
341 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.set_hotkey(KEY_LEFT);
342 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.set_hotkey(KEY_RIGHT);
344 Background_bitmap = bm_load(Game_help_filename[gr_screen.res]);
346 Current_help_page = GP_HELP_BASIC_KEYS;
347 Gameplay_help_inited = 1;
350 // called when moving to the previous help page
351 void gameplay_help_goto_prev_screen()
354 if (Current_help_page < GP_FIRST_SCREEN) {
355 Current_help_page = Gp_last_screen;
357 gamesnd_play_iface(SND_SWITCH_SCREENS);
361 // called when proceeding to the next help page
362 void gameplay_help_goto_next_screen()
365 if (Current_help_page > Gp_last_screen) {
366 Current_help_page = GP_FIRST_SCREEN;
368 gamesnd_play_iface(SND_SWITCH_SCREENS);
371 // called when the screen is exited
372 void gameplay_help_leave()
374 // unpause all game sounds
375 beam_unpause_sounds();
376 audiostream_unpause_all();
378 gameseq_post_event(GS_EVENT_PREVIOUS_STATE);
382 // deal with a keypress on the gameplay help screen
383 void gameplay_help_process_key(int k)
387 gameplay_help_leave();
393 //gameplay_help_goto_next_screen();
394 Buttons[gr_screen.res][NEXT_PAGE_BUTTON].button.press_button();
397 case KEY_SHIFTED | KEY_TAB:
398 Buttons[gr_screen.res][PREVIOUS_PAGE_BUTTON].button.press_button();
399 // gameplay_help_goto_prev_screen();
408 // deal with buttons being pressed on the gameplay help screen
409 void gameplay_help_button_pressed(int n)
413 case PREVIOUS_PAGE_BUTTON:
414 gameplay_help_goto_prev_screen();
417 case NEXT_PAGE_BUTTON:
418 gameplay_help_goto_next_screen();
421 case CONTINUE_BUTTON:
422 gameplay_help_leave();
423 gamesnd_play_iface(SND_COMMIT_PRESSED);
432 // Draw the help text onto the screen
433 void gameplay_help_draw_text()
435 int x_offset, y_offset, separation;
437 separation = gr_get_font_height() + 3;
439 switch ( Current_help_page ) {
441 case GP_HELP_BASIC_KEYS:
442 gameplay_help_set_title(XSTR( "Basic Keys", 133));
446 y_offset += separation;
447 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
449 y_offset += separation;
450 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
452 y_offset += separation;
453 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
455 y_offset += separation;
456 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
458 y_offset += separation;
459 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
461 y_offset += separation;
462 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
464 y_offset += separation;
465 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
467 y_offset += separation;
468 y_offset += separation;
470 gr_set_color_fast(&Color_bright);
471 gr_printf(0x8000,y_offset,XSTR( "Function Keys", 134));
472 gr_set_color_fast(&Color_normal);
474 y_offset += separation;
475 y_offset += separation;
477 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F1", 135), XSTR( "context-sensitive help", 136));
479 y_offset += separation;
480 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F2", 137), XSTR( "options screen (available anywhere in game)", 138));
483 y_offset += separation;
484 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F3", 139), XSTR( "hotkey assignment", 140));
487 y_offset += separation;
488 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F4", 141), XSTR( "HUD message scroll-back", 142));
491 y_offset += separation;
492 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "F5...F12", 143), XSTR( "hotkeys", 144));
495 y_offset += separation;
496 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Shift-Esc", 145), XSTR( "quit FreeSpace 2 immediately", 146));
500 case GP_HELP_MOVEMENT_KEYS:
501 gameplay_help_set_title(XSTR( "Movement Keys", 147));
505 gameplay_help_blit_control_line(x_offset, y_offset,FORWARD_THRUST);
507 y_offset += separation;
508 gameplay_help_blit_control_line(x_offset, y_offset,MAX_THROTTLE);
510 y_offset += separation;
511 gameplay_help_blit_control_line(x_offset, y_offset,ONE_THIRD_THROTTLE);
513 y_offset += separation;
514 gameplay_help_blit_control_line(x_offset, y_offset,TWO_THIRDS_THROTTLE);
516 y_offset += separation;
517 gameplay_help_blit_control_line(x_offset, y_offset,MINUS_5_PERCENT_THROTTLE);
519 y_offset += separation;
520 gameplay_help_blit_control_line(x_offset, y_offset,PLUS_5_PERCENT_THROTTLE);
522 y_offset += separation;
523 gameplay_help_blit_control_line(x_offset, y_offset,ZERO_THROTTLE);
525 y_offset += separation;
526 gameplay_help_blit_control_line(x_offset, y_offset,AFTERBURNER);
528 y_offset += separation;
529 gameplay_help_blit_control_line(x_offset, y_offset,REVERSE_THRUST);
531 y_offset += separation;
532 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_FORWARD);
534 y_offset += separation;
535 gameplay_help_blit_control_line(x_offset, y_offset,PITCH_BACK);
537 y_offset += separation;
538 gameplay_help_blit_control_line(x_offset, y_offset,YAW_LEFT);
540 y_offset += separation;
541 gameplay_help_blit_control_line(x_offset, y_offset,YAW_RIGHT);
543 y_offset += separation;
544 gameplay_help_blit_control_line(x_offset, y_offset,BANK_LEFT);
546 y_offset += separation;
547 gameplay_help_blit_control_line(x_offset, y_offset,BANK_RIGHT);
549 y_offset += separation;
550 gameplay_help_blit_control_line(x_offset, y_offset,BANK_WHEN_PRESSED);
553 case GP_HELP_COMMON_TARGET_KEYS:
554 gameplay_help_set_title(XSTR( "Basic Targeting Keys", 148));
558 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT);
560 y_offset += separation;
561 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV);
563 y_offset += separation;
564 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_TARGETING);
566 y_offset += separation;
567 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SHIP_IN_RETICLE);
569 y_offset += separation;
570 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_HOSTILE);
572 y_offset += separation;
573 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_HOSTILE);
575 y_offset += separation;
576 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_CLOSEST_FRIENDLY);
578 y_offset += separation;
579 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_CLOSEST_FRIENDLY);
581 y_offset += separation;
582 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_SUBOBJECT);
584 y_offset += separation;
585 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_SUBOBJECT);
587 y_offset += separation;
588 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_SUBOBJECT_IN_RETICLE);
590 y_offset += separation;
591 gameplay_help_blit_control_line(x_offset, y_offset,MATCH_TARGET_SPEED);
593 y_offset += separation;
594 gameplay_help_blit_control_line(x_offset, y_offset,TOGGLE_AUTO_MATCH_TARGET_SPEED);
597 case GP_HELP_ADVANCED_TARGET_KEYS:
598 gameplay_help_set_title(XSTR( "Advanced Targeting Keys", 149));
602 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_SELF);
604 y_offset += separation;
605 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_SHIP_ATTACKING_TARGET);
607 y_offset += separation;
608 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_LAST_TRANMISSION_SENDER);
610 y_offset += separation;
611 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_TARGETS_TARGET);
613 y_offset += separation;
614 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_ESCORT_SHIP);
616 y_offset += separation;
617 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_CLOSEST_REPAIR_SHIP);
619 y_offset += separation;
620 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_UNINSPECTED_CARGO);
622 y_offset += separation;
623 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_UNINSPECTED_CARGO);
625 y_offset += separation;
626 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEWEST_SHIP);
628 y_offset += separation;
629 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_BOMB);
631 y_offset += separation;
632 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_BOMB);
634 y_offset += separation;
635 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SHIP);
637 y_offset += separation;
638 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_NEXT_LIVE_TURRET);
640 y_offset += separation;
641 gameplay_help_blit_control_line(x_offset, y_offset,TARGET_PREV_LIVE_TURRET);
643 y_offset += separation;
644 gameplay_help_blit_control_line(x_offset, y_offset,STOP_TARGETING_SUBSYSTEM);
648 y_offset += separation;
649 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "Select target assigned to that hotkey", 150));
651 y_offset += separation;
652 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Shift-F5...F12", 151), XSTR( "Add/remove target from that hotkey", 152));
654 y_offset += separation;
655 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "Alt-Shift-F5...F12", 153), XSTR( "Clear that hotkey", 154));
661 case GP_HELP_MESSAGING:
662 gameplay_help_set_title(XSTR( "Messaging Keys", 155));
666 gameplay_help_blit_control_line(x_offset, y_offset,SQUADMSG_MENU);
668 y_offset += separation;
669 gameplay_help_blit_control_line(x_offset, y_offset,REARM_MESSAGE);
671 y_offset += separation;
672 gameplay_help_blit_control_line(x_offset, y_offset,ATTACK_MESSAGE);
674 y_offset += separation;
675 gameplay_help_blit_control_line(x_offset, y_offset,DISARM_MESSAGE);
677 y_offset += separation;
678 gameplay_help_blit_control_line(x_offset, y_offset,DISABLE_MESSAGE);
680 y_offset += separation;
681 gameplay_help_blit_control_line(x_offset, y_offset,CAPTURE_MESSAGE);
683 y_offset += separation;
684 gameplay_help_blit_control_line(x_offset, y_offset,ENGAGE_MESSAGE);
686 y_offset += separation;
687 gameplay_help_blit_control_line(x_offset, y_offset,FORM_MESSAGE);
689 y_offset += separation;
690 gameplay_help_blit_control_line(x_offset, y_offset,IGNORE_MESSAGE);
692 y_offset += separation;
693 gameplay_help_blit_control_line(x_offset, y_offset,PROTECT_MESSAGE);
695 y_offset += separation;
696 gameplay_help_blit_control_line(x_offset, y_offset,COVER_MESSAGE);
698 y_offset += separation;
699 gameplay_help_blit_control_line(x_offset, y_offset,WARP_MESSAGE);
702 y_offset += separation;
703 gameplay_help_blit_control_line_raw(x_offset, y_offset, XSTR( "F5...F12", 143), XSTR( "send specified order to these target(s)", 156));
707 case GP_HELP_WEAPON_KEYS:
708 gameplay_help_set_title(XSTR( "Weapon Keys", 157));
712 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_PRIMARY);
714 y_offset += separation;
715 gameplay_help_blit_control_line(x_offset, y_offset,FIRE_SECONDARY);
717 y_offset += separation;
718 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NEXT_PRIMARY);
720 y_offset += separation;
721 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_PREV_PRIMARY);
723 y_offset += separation;
724 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_SECONDARY);
726 y_offset += separation;
727 gameplay_help_blit_control_line(x_offset, y_offset,CYCLE_NUM_MISSLES);
729 y_offset += separation;
730 gameplay_help_blit_control_line(x_offset, y_offset,LAUNCH_COUNTERMEASURE);
733 case GP_HELP_THROTTLE_AND_ETS_KEYS:
734 gameplay_help_set_title(XSTR( "Energy Management Keys", 158));
738 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_EQUALIZE);
740 y_offset += separation;
741 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_TOP);
743 y_offset += separation;
744 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_BOTTOM);
746 y_offset += separation;
747 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_LEFT);
749 y_offset += separation;
750 gameplay_help_blit_control_line(x_offset, y_offset,SHIELD_XFER_RIGHT);
752 y_offset += separation;
753 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_WEAPON);
755 y_offset += separation;
756 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_WEAPON);
758 y_offset += separation;
759 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_SHIELD);
761 y_offset += separation;
762 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_SHIELD);
764 y_offset += separation;
765 gameplay_help_blit_control_line(x_offset, y_offset,INCREASE_ENGINE);
767 y_offset += separation;
768 gameplay_help_blit_control_line(x_offset, y_offset,DECREASE_ENGINE);
770 y_offset += separation;
771 gameplay_help_blit_control_line(x_offset, y_offset,ETS_EQUALIZE);
773 y_offset += separation;
774 gameplay_help_blit_control_line(x_offset, y_offset,XFER_LASER);
776 y_offset += separation;
777 gameplay_help_blit_control_line(x_offset, y_offset,XFER_SHIELD);
781 case GP_HELP_MISC_KEYS:
782 gameplay_help_set_title(XSTR( "Miscellaneous Keys", 159));
788 y_offset += separation;
789 gameplay_help_blit_control_line(x_offset, y_offset,END_MISSION);
791 y_offset += separation;
792 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "ESC", 160), XSTR( "invoke abort mission popup", 161));
796 y_offset += separation;
797 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SPEED_UP);
799 y_offset += separation;
800 gameplay_help_blit_control_line(x_offset, y_offset,TIME_SLOW_DOWN);
804 y_offset += separation;
805 gameplay_help_blit_control_line(x_offset, y_offset,RADAR_RANGE_CYCLE);
809 y_offset += separation;
810 gameplay_help_blit_control_line(x_offset, y_offset,ADD_REMOVE_ESCORT);
812 y_offset += separation;
813 gameplay_help_blit_control_line(x_offset, y_offset,ESCORT_CLEAR);
815 // Pause, Print Screenshot
816 y_offset += separation;
817 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Pause", 162), XSTR( "pause game", 163));
819 y_offset += separation;
820 gameplay_help_blit_control_line_raw(x_offset,y_offset, XSTR( "Print Scrn", 164), XSTR( "take screen shot", 165));
824 case GP_HELP_VIEW_KEYS:
825 gameplay_help_set_title(XSTR( "View Keys", 166));
829 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_UP);
831 y_offset += separation;
832 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_DOWN);
834 y_offset += separation;
835 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_LEFT);
837 y_offset += separation;
838 gameplay_help_blit_control_line(x_offset, y_offset,PADLOCK_RIGHT);
840 y_offset += separation;
841 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CHASE);
843 y_offset += separation;
844 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL);
846 y_offset += separation;
847 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK);
849 y_offset += separation;
850 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_SLEW);
852 y_offset += separation;
853 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_INCREASE);
855 y_offset += separation;
856 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_DIST_DECREASE);
858 y_offset += separation;
859 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_CENTER);
861 y_offset += separation;
862 gameplay_help_blit_control_line(x_offset, y_offset,VIEW_OTHER_SHIP);
865 case GP_HELP_MULTI_KEYS:
866 gameplay_help_set_title(XSTR( "Multiplayer Keys", 167));
871 gr_set_color_fast(&Color_bright);
872 gr_printf(0x8000,y_offset,XSTR( "Ingame messaging keys (tap for text, hold for voice)", 168));
873 gr_set_color_fast(&Color_normal);
875 y_offset += separation;
877 y_offset += separation;
878 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_ALL);
880 y_offset += separation;
881 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_FRIENDLY);
883 y_offset += separation;
884 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_HOSTILE);
886 y_offset += separation;
887 gameplay_help_blit_control_line(x_offset, y_offset,MULTI_MESSAGE_TARGET);
894 // gameplay_help_do_frame() is the function that displays help when acutally playing the game
895 void gameplay_help_do_frame(float frametime)
899 // ensure the gameplay help interface has been initialized
900 if (!Gameplay_help_inited) {
905 // make sure game sounds are paused
907 audiostream_pause_all();
909 k = Ui_window.process() & ~KEY_DEBUGGED;
910 gameplay_help_process_key(k);
912 for (i=0; i<NUM_BUTTONS; i++){
913 if (Buttons[gr_screen.res][i].button.pressed()){
914 gameplay_help_button_pressed(i);
918 GR_MAYBE_CLEAR_RES(Background_bitmap);
919 if (Background_bitmap >= 0) {
920 gr_set_bitmap(Background_bitmap);
926 gameplay_help_draw_text();
931 // called once when leaving the gameplay help state
932 void gameplay_help_close()
934 if ( Gameplay_help_inited ) {
935 if (Background_bitmap >= 0) {
936 bm_unload(Background_bitmap);
940 common_free_interface_palette(); // restore game palette
944 Gameplay_help_inited = 0;