// force the chatbox to go into big mode (if its in small mode) - will not work if in multi paused chatbox mode void chatbox_force_big() { int new_mode_flags; // don't do anything unless we're currently in "small" mode if(!(Chatbox_mode_flags & CHATBOX_FLAG_SMALL)){ return; } new_mode_flags = Chatbox_mode_flags; // switch to the appropriate mode new_mode_flags &= ~(CHATBOX_FLAG_SMALL | CHATBOX_FLAG_BIG); new_mode_flags |= CHATBOX_FLAG_BIG; Chatbox_bitmap = Chatbox_big_bitmap; // flip the up/down arrow Chatbox_buttons[gr_screen.res][CHATBOX_TOGGLE_SIZE].button.set_bmaps(Chatbox_buttons[gr_screen.res][CHATBOX_TOGGLE_SIZE+1].filename); // call this to set everything up correctly chatbox_set_mode(new_mode_flags); // change the location of the input box Chat_inputbox.update_dimensions(Chatbox_inputbox_x, Chatbox_textenter_y, Chatbox_inputbox_w,15); Chat_inputbox.set_focus(); // adjust what line we start displaying from based upon the new size of the window chatbox_toggle_size_adjust_lines(); }
int player_select_create_new_pilot() { int idx; // make sure we haven't reached the max if (Player_select_num_pilots >= MAX_PILOTS) { gamesnd_play_iface(SND_GENERAL_FAIL); return 0; } int play_scroll_sound = 1; if ( play_scroll_sound ) { gamesnd_play_iface(SND_SCROLL); } idx = Player_select_num_pilots; // move all the pilots in the list up while (idx--) { strcpy(Pilots[idx + 1], Pilots[idx]); } // by default, set the default netgame protocol to be VMT Multi_options_g.protocol = NET_TCP; // select the beginning of the list Player_select_pilot = 0; Player_select_num_pilots++; Pilots[Player_select_pilot][0] = 0; Player_select_list_start= 0; // set us to be in input mode player_select_set_input_mode(1); // set the input box to have focus Player_select_input_box.set_focus(); Player_select_input_box.set_text(""); Player_select_input_box.update_dimensions(Choose_list_coords[gr_screen.res][0], Choose_list_coords[gr_screen.res][1], Choose_list_coords[gr_screen.res][2], gr_get_font_height()); return 1; }
// creates a new pilot file void pilot_manage_create_new_pilot()//UI_INPUTBOX *Inputbox) { // check if too many pilots if (Num_pilots >= MAX_PILOTS) { gamesnd_play_iface(SND_GENERAL_FAIL); return; } // play sound for pilot creation gamesnd_play_iface(SND_SCROLL); // only write pilot file if there is an active pilot if (strlen(Player->callsign)) { write_pilot_file(); } // move other pilot names and ranks down to make room for the new one int idx = Num_pilots; Assert(Num_pilots >= 0); while (idx--) { strcpy(Pilots[idx + 1], Pilots[idx]); Pilot_ranks[idx + 1] = Pilot_ranks[idx]; } Selected_line = 0; Num_pilots++; Pilots[Selected_line][0] = 0; Pilot_ranks[Selected_line] = 0; List_scroll_offset = 0; // set mode to accept pilot name text pilot_manage_set_callsign_enter_mode(true); // set focus to input box Inputbox.set_focus(); // set initial pilot name to "" Inputbox.set_text(""); // reset size of input box to only 1 line Inputbox.update_dimensions(Pilot_manage_list_coords[gr_screen.res][PM_X_COORD], Pilot_manage_list_coords[gr_screen.res][PM_Y_COORD], Pilot_manage_list_coords[gr_screen.res][PM_W_COORD], gr_get_font_height()); }