void hotkey_button_pressed(int n) { switch (n) { case SCROLL_UP_BUTTON: hotkey_scroll_screen_up(); break; case SCROLL_DOWN_BUTTON: hotkey_scroll_screen_down(); break; case ADD_HOTKEY_BUTTON: add_hotkey(Cur_hotkey); gamesnd_play_iface(SND_USER_SELECT); break; case REMOVE_HOTKEY_BUTTON: remove_hotkey(); gamesnd_play_iface(SND_USER_SELECT); break; case ACCEPT_BUTTON: save_hotkeys(); // fall through to CANCEL_BUTTON case CANCEL_BUTTON: mission_hotkey_exit(); gamesnd_play_iface(SND_USER_SELECT); break; case HELP_BUTTON: launch_context_help(); gamesnd_play_iface(SND_HELP_PRESSED); break; case OPTIONS_BUTTON: gameseq_post_event(GS_EVENT_OPTIONS_MENU); gamesnd_play_iface(SND_USER_SELECT); break; case CLEAR_BUTTON: clear_hotkeys(); gamesnd_play_iface(SND_USER_SELECT); break; case RESET_BUTTON: reset_hotkeys(); gamesnd_play_iface(SND_USER_SELECT); break; } }
void barracks_button_pressed(int n) { switch (n) { case B_PILOT_SCROLL_UP_BUTTON: barracks_scroll_callsign_up(); break; case B_PILOT_SCROLL_DOWN_BUTTON: barracks_scroll_callsign_down(); break; case B_STATS_SCROLL_UP_BUTTON: barracks_scroll_stats_up(); break; case B_STATS_SCROLL_DOWN_BUTTON: barracks_scroll_stats_down(); break; case B_PIC_PREV_PILOT_BUTTON: barracks_prev_pic(); break; case B_PIC_NEXT_PILOT_BUTTON: barracks_next_pic(); break; case B_SQUAD_PREV_BUTTON: barracks_prev_squad_pic(); break; case B_SQUAD_NEXT_BUTTON: barracks_next_squad_pic(); break; case B_PILOT_SET_ACTIVE_BUTTON: if (barracks_new_pilot_selected()){ gamesnd_play_iface(SND_GENERAL_FAIL); // if it's just the missing campaign file that failed for us then don't give the second popup if (Campaign_file_missing) { break; } } else { gamesnd_play_iface(SND_SCROLL); if (Campaign_file_missing) { popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "The currently active campaign cannot be found. Please select another...", 1600)); gameseq_post_event(GS_EVENT_CAMPAIGN_ROOM); } } break; case B_ACCEPT_BUTTON: if (Num_pilots && !barracks_pilot_accepted()) { gamesnd_play_iface(SND_COMMIT_PRESSED); if (Campaign_file_missing) { popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "The currently active campaign cannot be found. Please select another...", 1600)); gameseq_post_event(GS_EVENT_CAMPAIGN_ROOM); } else { gameseq_post_event(GS_EVENT_MAIN_MENU); } } else { gamesnd_play_iface(SND_GENERAL_FAIL); // if it's just the missing campaign file that failed for us then don't give the second popup if (Campaign_file_missing) { break; } } break; case B_PILOT_CLONE_BUTTON: if (Num_pilots < 1) { gamesnd_play_error_beep(); break; } Clone_flag = 1; barracks_create_new_pilot(); break; case B_PILOT_CONVERT_BUTTON: { /* New Pilot code no longer needs a conversion function. */ popup(PF_TITLE_BIG | PF_TITLE_BLUE | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Disabled!\n\n\nMulti and Single Player Pilot files are now identical.\n\n" "Conversion between the two is no longer necessary.", 1601)); /* // no actual conversion with new pilot code if (Player_sel_mode == PLAYER_SELECT_MODE_SINGLE) { barracks_init_player_stuff(PLAYER_SELECT_MODE_MULTI); } else { // make sure we don't carry over the multi flag if (Cur_pilot->flags & PLAYER_FLAGS_IS_MULTI) { Cur_pilot->flags &= ~PLAYER_FLAGS_IS_MULTI; } barracks_init_player_stuff(PLAYER_SELECT_MODE_SINGLE); } gamesnd_play_iface(SND_USER_SELECT); */ break; } case B_PILOT_CREATE_BUTTON: Clone_flag = 0; barracks_create_new_pilot(); break; case B_HELP_BUTTON: launch_context_help(); gamesnd_play_iface(SND_HELP_PRESSED); break; case B_OPTION_BUTTON: gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_OPTIONS_MENU); break; case B_STATS_MEDAL_BUTTON: gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_VIEW_MEDALS); break; case B_PILOT_DELETE_BUTTON: barracks_delete_pilot(); break; case B_PILOT_SINGLE_MODE_BUTTON: if (Player_sel_mode != PLAYER_SELECT_MODE_SINGLE) { gamesnd_play_iface(SND_USER_SELECT); // make sure we don't carry over the multi flag if (Cur_pilot->flags & PLAYER_FLAGS_IS_MULTI) { Cur_pilot->flags &= ~PLAYER_FLAGS_IS_MULTI; } Pilot.save_player(Cur_pilot); barracks_init_player_stuff(PLAYER_SELECT_MODE_SINGLE); } break; case B_PILOT_MULTI_MODE_BUTTON: if ( Networking_disabled ) { game_feature_disabled_popup(); break; } if (Player_sel_mode != PLAYER_SELECT_MODE_MULTI) { gamesnd_play_iface(SND_USER_SELECT); Cur_pilot->flags |= PLAYER_FLAGS_IS_MULTI; Pilot.save_player(Cur_pilot); barracks_init_player_stuff(PLAYER_SELECT_MODE_MULTI); } break; } }
int techroom_button_pressed(int num) { switch (num) { case SHIPS_DATA_TAB: case WEAPONS_DATA_TAB: case INTEL_DATA_TAB: fsspeech_stop(); techroom_change_tab(num); break; case SIMULATOR_TAB: fsspeech_stop(); gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_SIMULATOR_ROOM); return 1; case CUTSCENES_TAB: fsspeech_stop(); gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_GOTO_VIEW_CUTSCENES_SCREEN); return 1; case CREDITS_TAB: fsspeech_stop(); gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_CREDITS); return 1; case PREV_ENTRY_BUTTON: tech_prev_entry(); break; case NEXT_ENTRY_BUTTON: tech_next_entry(); break; case SCROLL_LIST_UP: tech_scroll_list_up(); Tech_slider.forceUp(); break; case SCROLL_LIST_DOWN: tech_scroll_list_down(); Tech_slider.forceDown(); break; case SCROLL_INFO_UP: tech_scroll_info_up(); break; case SCROLL_INFO_DOWN: tech_scroll_info_down(); break; case HELP_BUTTON: launch_context_help(); gamesnd_play_iface(SND_HELP_PRESSED); break; case OPTIONS_BUTTON: gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_OPTIONS_MENU); break; case EXIT_BUTTON: fsspeech_stop(); gamesnd_play_iface(SND_COMMIT_PRESSED); gameseq_post_event(GS_EVENT_MAIN_MENU); break; } return 0; }
void cmd_brief_button_pressed(int n) { switch (n) { case CMD_BRIEF_BUTTON_HELP: launch_context_help(); gamesnd_play_iface(SND_HELP_PRESSED); break; case CMD_BRIEF_BUTTON_OPTIONS: gamesnd_play_iface(SND_SWITCH_SCREENS); gameseq_post_event(GS_EVENT_OPTIONS_MENU); break; case CMD_BRIEF_BUTTON_FIRST_STAGE: if (common_num_cutscenes_valid(MOVIE_PRE_CMD_BRIEF)) { audiostream_stop(Cmd_brief_last_voice); common_maybe_play_cutscene(MOVIE_PRE_CMD_BRIEF, true, SCORE_BRIEFING); cmd_brief_new_stage(0); } else if (Cur_stage) { cmd_brief_new_stage(0); gamesnd_play_iface(SND_BRIEF_STAGE_CHG); } else { gamesnd_play_iface(SND_GENERAL_FAIL); } break; case CMD_BRIEF_BUTTON_PREV_STAGE: if (!Cur_stage && common_num_cutscenes_valid(MOVIE_PRE_CMD_BRIEF)) { audiostream_stop(Cmd_brief_last_voice); common_maybe_play_cutscene(MOVIE_PRE_CMD_BRIEF, true, SCORE_BRIEFING); cmd_brief_new_stage(0); } else if (Cur_stage) { cmd_brief_new_stage(Cur_stage - 1); gamesnd_play_iface(SND_BRIEF_STAGE_CHG); } else { gamesnd_play_iface(SND_GENERAL_FAIL); } break; case CMD_BRIEF_BUTTON_NEXT_STAGE: if (Cur_stage < Cur_cmd_brief->num_stages - 1) { cmd_brief_new_stage(Cur_stage + 1); gamesnd_play_iface(SND_BRIEF_STAGE_CHG); } else { gamesnd_play_iface(SND_GENERAL_FAIL); } break; case CMD_BRIEF_BUTTON_LAST_STAGE: if (Cur_stage < Cur_cmd_brief->num_stages - 1) { cmd_brief_new_stage(Cur_cmd_brief->num_stages - 1); gamesnd_play_iface(SND_BRIEF_STAGE_CHG); } else { gamesnd_play_iface(SND_GENERAL_FAIL); } break; case CMD_BRIEF_BUTTON_ACCEPT: cmd_brief_exit(); gamesnd_play_iface(SND_COMMIT_PRESSED); break; case CMD_BRIEF_BUTTON_PAUSE: gamesnd_play_iface(SND_USER_SELECT); fsspeech_pause(Player->auto_advance != 0); Player->auto_advance ^= 1; break; case CMD_BRIEF_BUTTON_SCROLL_UP: Top_cmd_brief_text_line--; if ( Top_cmd_brief_text_line < 0 ) { Top_cmd_brief_text_line = 0; gamesnd_play_iface(SND_GENERAL_FAIL); } else { gamesnd_play_iface(SND_SCROLL); } break; case CMD_BRIEF_BUTTON_SCROLL_DOWN: Top_cmd_brief_text_line++; if ( (Num_brief_text_lines[0] - Top_cmd_brief_text_line) < Max_cmdbrief_Lines) { Top_cmd_brief_text_line--; gamesnd_play_iface(SND_GENERAL_FAIL); } else { gamesnd_play_iface(SND_SCROLL); } break; } }