51 #define MULTI_TS_PALETTE "InterfacePalette"
64 #define MULTI_TS_X_COORD 0
65 #define MULTI_TS_Y_COORD 1
66 #define MULTI_TS_W_COORD 2
67 #define MULTI_TS_H_COORD 3
69 #define MULTI_TS_NUM_BUTTONS 7
70 #define MULTI_TS_BRIEFING 0 // go to the briefing
71 #define MULTI_TS_SHIP_SELECT 1 // this screen
72 #define MULTI_TS_WEAPON_SELECT 2 // go to the weapon select screen
73 #define MULTI_TS_SHIPS_UP 3 // scroll the ships list up
74 #define MULTI_TS_SHIPS_DOWN 4 // scroll the ships list down
75 #define MULTI_TS_COMMIT 5 // commit
76 #define MULTI_TS_LOCK 6 // lock (free) ship/weapon select
102 #define MULTI_TS_NUM_LOCKED_BITMAPS 3
120 #define TSWING_0_SHIP_0 10
121 #define TSWING_0_SHIP_1 12
122 #define TSWING_0_SHIP_2 14
123 #define TSWING_0_SHIP_3 16
124 #define TSWING_1_SHIP_0 18
125 #define TSWING_1_SHIP_1 20
126 #define TSWING_1_SHIP_2 22
127 #define TSWING_1_SHIP_3 24
128 #define TSWING_2_SHIP_0 26
129 #define TSWING_2_SHIP_1 28
130 #define TSWING_2_SHIP_2 30
131 #define TSWING_2_SHIP_3 32
133 #define TSWING_0_NAME_0 11
134 #define TSWING_0_NAME_1 13
135 #define TSWING_0_NAME_2 15
136 #define TSWING_0_NAME_3 17
137 #define TSWING_1_NAME_0 19
138 #define TSWING_1_NAME_1 21
139 #define TSWING_1_NAME_2 23
140 #define TSWING_1_NAME_3 25
141 #define TSWING_2_NAME_0 27
142 #define TSWING_2_NAME_1 29
143 #define TSWING_2_NAME_2 31
144 #define TSWING_2_NAME_3 33
146 #define TSWING_LIST_0 5
147 #define TSWING_LIST_1 6
148 #define TSWING_LIST_2 7
149 #define TSWING_LIST_3 8
151 #define MULTI_TS_SLOT_LIST 0
152 #define MULTI_TS_PLAYER_LIST 1
153 #define MULTI_TS_AVAIL_LIST 2
156 #define MULTI_TS_NUM_SNAZZY_REGIONS 28
167 #define MULTI_TS_NUM_SHIP_SLOTS_TEAM 4 // # of ship slots in team v team
168 #define MULTI_TS_FLAG_NONE -2 // never has any ships
169 #define MULTI_TS_FLAG_EMPTY -1 // currently empty
274 #define MULTI_TS_AVAIL_MAX_DISPLAY 4
297 #define MULTI_TS_SHIP_INFO_MAX_LINE_LEN 150
298 #define MULTI_TS_SHIP_INFO_MAX_LINES 10
299 #define MULTI_TS_SHIP_INFO_MAX_TEXT (MULTI_TS_SHIP_INFO_MAX_LINE_LEN * MULTI_TS_SHIP_INFO_MAX_LINES)
344 #define TS_GRAB_FROM_LIST 0
345 #define TS_SWAP_LIST_SLOT 1
346 #define TS_SWAP_SLOT_SLOT 2
347 #define TS_DUMP_TO_LIST 3
348 #define TS_SWAP_PLAYER_PLAYER 4
349 #define TS_MOVE_PLAYER 5
352 #define TS_CODE_LOCK_TEAM 0 // the specified team's slots are locked
353 #define TS_CODE_PLAYER_UPDATE 1 // a player slot update for the specified team
356 #define MULTI_TS_FLAG_NONE -2 // slot is _always_ empty
357 #define MULTI_TS_FLAG_EMPTY -1 // flag is temporarily empty
434 int multi_ts_can_perform(
int from_type,
int from_index,
int to_type,
int to_index,
int ship_class,
int player_index = -1);
437 int multi_ts_get_dnd_type(
int from_type,
int from_index,
int to_type,
int to_index,
int player_index = -1);
571 k = Multi_ts_window.
process(k);
609 Multi_ts_window.
draw();
699 if(player_index == -1){
769 if(player_index == -1){
790 for(idx = 0; idx < static_cast<int>(
Ship_info.size()); idx++) {
819 int idx,team_index,slot_index,found,player_count,shipnum;
839 memset(name_lookup,0,100);
876 Assert((team_index != -1) && (slot_index != -1));
917 if(player_count <= 0){
969 if(Multi_ts_team[idx].multi_ts_flag[s_idx] >= 0){
984 Assert(Multi_ts_team[idx].multi_ts_objnum[s_idx] >= 0);
995 Multi_ts_num_deleted++;
1010 if((Multi_ts_team[idx].multi_ts_player[s_idx] != NULL) && !
MULTI_CONNECTED((*Multi_ts_team[idx].multi_ts_player[s_idx]))){
1011 Assert(Multi_ts_team[idx].multi_ts_objnum[s_idx] != -1);
1293 int display_count,ship_count,
idx;
1299 for(idx = 0; idx < static_cast<int>(
Ship_info.size()); idx++) {
1482 int y_start, line_height;
1514 y_start += line_height;
1523 y_start += line_height;
1532 y_start += line_height;
1540 y_start += line_height;
1549 y_start += line_height;
1558 y_start += line_height;
1567 y_start += line_height;
1576 y_start += line_height;
1585 y_start += line_height;
1593 y_start += line_height;
1613 strcpy_s(text,
XSTR(
"Ships/Weapons Are Now Free",750));
1651 int idx,s_idx,team_index,slot_index;
1667 if((slot_index != -1) && (team_index != -1)){
1678 int wing_number, wing_idx;
1681 if (strlen(shipname) < (strlen (wingname) + 2) ) {
1687 wing_number = atoi(shipname+strlen(wingname));
1689 if (wing_number > 0 && wing_number <=
Wings[wing_idx].wave_count) {
1712 *slot_index = (ship_name[strlen(ship_name)-1] -
'1');
1721 int wing_index,
ship;
1726 ship = (ship_name[strlen(ship_name)-1] -
'1');
1737 if(mantis2757switch)
1738 Assert((*team_index != -1) && (*slot_index != -1));
1771 if((Multi_ts_team[idx].multi_ts_objnum[s_idx] != -1) && (
Wss_slots_teams[idx][s_idx].ship_class == -1)){
1773 }
else if((Multi_ts_team[idx].multi_ts_objnum[s_idx] != -1) && (
Wss_slots_teams[idx][s_idx].ship_class != -1)){
1783 if((Multi_ts_team[0].multi_ts_objnum[idx] != -1) && (
Wss_slots[idx].ship_class == -1)){
1785 }
else if((Multi_ts_team[0].multi_ts_objnum[idx] != -1) && (
Wss_slots[idx].ship_class != -1)){
1817 int snazzy_region,snazzy_action;
1818 int region_type,region_index,region_empty;
1819 int mouse_x,mouse_y,ship_class;
1831 if(snazzy_region != -1){
1833 Assert(region_type != -1);
1836 switch(region_type){
1841 if(ship_class == -1){
1844 region_empty = (
Ss_pool[ship_class] > 0) ? 0 : 1;
1849 if(region_index >= 0 ) {
1858 if(region_index >= 0 ) {
1866 switch(region_type){
1889 switch(region_type){
1924 switch(region_type){
1945 if(region_index >= 0 ) {
1991 if(player_index == -1){
2001 if((from_index == -1) || (to_index == -1)){
2147 if(player_index == -1){
2196 void multi_ts_apply(
int from_type,
int from_index,
int to_type,
int to_index,
int ship_class,
int player_index)
2206 if(player_index == -1){
2218 nprintf((
"Network",
"Apply swap slot slot %d %d\n",from_index,to_index));
2222 nprintf((
"Network",
"Apply dump to list %d %d\n",from_index,to_index));
2226 nprintf((
"Network",
"Apply swap list slot %d %d\n",from_index,to_index));
2230 nprintf((
"Network",
"Apply grab from list %d %d\n",from_index,to_index));
2234 nprintf((
"Network",
"Apply swap player player %d %d\n",from_index,to_index));
2238 nprintf((
"Network",
"Apply move player %d %d\n",from_index,to_index));
2260 if((player_index == -1) && (sound != -1)){
2279 void multi_ts_drop(
int from_type,
int from_index,
int to_type,
int to_index,
int ship_class,
int player_index)
2285 multi_ts_apply(from_type,from_index,to_type,to_index,ship_class,player_index);
2287 nprintf((
"Network",
"Could not apply operation!\n"));
2302 if(player_index == -1){
2359 if(player_index == -1){
2412 int ship_count,class_index;
2416 while((ship_count >= 0) && (class_index < static_cast<int>(
Ship_info.size()))){
2421 if(ship_count >= 0){
2437 int offset_x,offset_y,callsign_w;
2488 if(player_index == -1){
2589 char ship_desc[1000];
2626 memset(ship_desc,0,1000);
2628 token = strtok(ship_desc,
"\n");
2631 while(token != NULL){
2632 token = strtok(NULL,
"\n");
2706 int primary_ok,secondary_ok;
2751 if(primary_ok && secondary_ok){
2815 s_sound = (short)sound;
2847 if(Multi_ts_team[team].multi_ts_player[idx] == NULL){
2856 ADD_SHORT(Multi_ts_team[team].multi_ts_player[idx]->player_id);
2899 ubyte stop,
val,slot_num,ship_class;
2908 Assert(player_index != -1);
2957 while(stop != 0xff){
2975 if(player_index == -1){
2976 nprintf((
"Network",
"Couldn't find player for pslot update!\n"));
void ship_wing_cleanup(int shipnum, wing *wingp)
int multi_ts_can_perform(int from_type, int from_index, int to_type, int to_index, int ship_class, int player_index=-1)
#define MULTI_TS_SHIP_INFO_MAX_LINE_LEN
void set_highlight_action(void(*_user_function)(void))
int multi_ts_avail_bmap_num(int slot_index)
void multi_ts_lock_pressed()
char Starting_wing_names[MAX_STARTING_WINGS][NAME_LENGTH]
void multi_ts_avail_scroll_down()
void wing_bash_ship_name(char *ship_name, const char *wing_name, int index)
#define MY_NET_PLAYER_NUM
int Multi_ts_status_bar_mode
void obj_set_flags(object *obj, uint new_flags)
int chatbox_create(int mode_flags)
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
#define MULTI_TS_BRIEFING
UI_WINDOW Multi_ts_window
void multi_ts_check_errors()
int Multi_ts_carried_flag
int multi_ts_slot_index(int region)
net_player * multi_ts_player[MULTI_TS_NUM_SHIP_SLOTS]
ui_button_info Multi_ts_buttons[GR_NUM_RESOLUTIONS][MULTI_TS_NUM_BUTTONS]
#define TS_SWAP_PLAYER_PLAYER
weapon_info Weapon_info[MAX_WEAPON_TYPES]
#define MOUSE_LEFT_BUTTON
void multi_ts_blit_ship_info()
#define MULTI_TS_SHIP_SELECT
bool multi_ts_validate_ship(char *shipname, char *wingname)
#define PACKET_SET_SIZE()
void multi_ts_create_wings()
int ss_grab_from_list(int from_list, int to_slot, int *sound)
#define TS_CODE_LOCK_TEAM
drop a ship icon on a wing slot
void multi_reset_timestamps()
int Multi_ts_select_index
int snazzy_menu_do(ubyte *data, int mask_w, int mask_h, int num_regions, MENU_REGION *regions, int *action, int poll_key, int *key)
void ss_blit_ship_icon(int x, int y, int ship_class, int bmap_num)
void ship_add_exited_ship(ship *sp, int reason)
char Player_start_shipname[NAME_LENGTH]
#define MULTI_STANDALONE(np)
int gameseq_get_state(void)
void multi_ts_get_team_and_slot(char *ship_name, int *team_index, int *slot_index, bool mantis2757switch)
#define GR_NUM_RESOLUTIONS
void multi_ts_get_shipname(char *ship_name, int team, int slot_index)
#define NETINFO_FLAG_OBSERVER
void multi_io_send_to_all_reliable(ubyte *data, int length, net_player *ignore)
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
general failure sound for any event
void multi_ts_init_objnums()
int multi_ts_avail_index(int region)
void multi_ts_blit_wing_callsigns()
struct vec3d::@225::@227 xyz
void multi_io_send_reliable(net_player *pl, ubyte *data, int len)
int find_player_id(short player_id)
int multi_ts_can_grab_player(int slot_index, int player_index=-1)
void multi_ts_init_graphics()
void multi_ts_init_flags()
#define SEF_PLAYER_DELETED
int multi_ts_slot_bmap_num(int slot_index)
#define END_OF_LIST(head)
int Ss_pool_teams[MAX_TVT_TEAMS][MAX_SHIP_CLASSES]
#define GR_MAYBE_CLEAR_RES(bmap)
void multi_common_set_palette()
int multi_ts_objnum[MULTI_TS_NUM_SHIP_SLOTS]
void wl_reset_selected_slot()
int multi_ts_region_type(int region)
void multi_ts_blit_carried_icon()
char * Multi_ts_bitmap_fname[GR_NUM_RESOLUTIONS]
int multi_ts_flag[MULTI_TS_NUM_SHIP_SLOTS]
void gr_set_color_fast(color *dst)
color Color_text_active_hi
#define MAX_SHIPS_PER_WING
void obj_merge_created_list(void)
int Multi_ts_ship_info_line_count
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
int Multi_ts_select_ship_class
void multi_ts_common_init()
void multi_ts_assign_players_all()
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
#define MULTI_TS_AVAIL_LIST
#define MULTI_TS_AVAIL_MAX_DISPLAY
void snazzy_menu_add_region(MENU_REGION *region, const char *text, int mask, int key, int click_sound)
char callsign[CALLSIGN_LEN+1]
void multi_ts_button_pressed(int n)
int mouse_get_pos_unscaled(int *xpos, int *ypos)
char name_lookup[MAX_PXO_TEXT_LEN]
int wep_count[MAX_SHIP_WEAPONS]
#define TS_GRAB_FROM_LIST
struct ts_team_data ts_team_data
#define ON_BRIEFING_SELECT
void draw_forced(int frame_num)
int multi_ts_ok_to_commit()
int Multi_ts_snazzy_regions
void multi_ts_apply(int from_type, int from_index, int to_type, int to_index, int ship_class, int player_index)
#define MULTI_TS_SHIP_INFO_MAX_TEXT
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void set_mask_bmap(char *fname)
void multi_ts_avail_scroll_up()
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
void multi_ts_set_status_bar_mode(int m)
char ship_select_background[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN]
#define NET_PLAYER_INDEX(np)
p_object * mission_parse_get_arrival_ship(const char *name)
Returns the parse object on the ship arrival list associated with the given name. ...
#define TS_CODE_PLAYER_UPDATE
#define NETINFO_FLAG_AM_MASTER
int Multi_ts_locked_bitmaps[MULTI_TS_NUM_LOCKED_BITMAPS]
void process_pslot_update_packet(ubyte *data, header *hinfo)
multi_server_options options
void multi_ts_check_buttons()
char Multi_ts_ship_info_lines[MULTI_TS_SHIP_INFO_MAX_LINES][MULTI_TS_SHIP_INFO_MAX_LINE_LEN]
char Multi_ts_ship_info_text[MULTI_TS_SHIP_INFO_MAX_TEXT]
#define MULTI_TS_SLOT_LIST
#define MULTI_TS_NUM_LOCKED_BITMAPS
int multi_ts_disabled_slot(int slot_num, int player_index)
ai_profile_t * ai_profile
ts_team_data Multi_ts_team[MULTI_TS_MAX_TVT_TEAMS]
#define strnicmp(s1, s2, n)
#define MAX_STARTING_WINGS
int multi_ts_get_dnd_type(int from_type, int from_index, int to_type, int to_index, int player_index=-1)
#define ICON_FRAME_DISABLED_HIGH
void multi_ts_commit_pressed()
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
int wl_update_ship_weapons(int objnum, wss_unit *slot)
#define AIPF_MULTI_ALLOW_EMPTY_SECONDARIES
#define MULTI_OBSERVER(np)
#define MSO_FLAG_SS_LEADERS
char * Multi_ts_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
#define NETINFO_FLAG_TEAM_CAPTAIN
int split_str(const char *src, int max_pixel_w, int *n_chars, const char **p_str, int max_lines, char ignore_char)
void ss_make_slot_full(int slot_index)
void send_wss_update_packet(int team_num, ubyte *wss_data, int size)
int Multi_ts_hotspot_index
int multi_ts_swap_player_player(int from_index, int to_index, int *sound, int player_index=-1)
#define OF_COULD_BE_PLAYER
void common_set_team_pointers(int team)
#define NETINFO_FLAG_GAME_HOST
#define ICON_FRAME_DISABLED
void multi_ts_blit_avail_ships()
void multi_ts_init_snazzy()
ubyte * Multi_ts_mask_data
GLint GLint GLint GLint GLint x
object Objects[MAX_OBJECTS]
#define MULTI_TS_NUM_SHIP_SLOTS_TEAM
const char * XSTR(const char *str, int index)
void multi_assign_player_ship(int net_player_num, object *objp, int ship_class)
user_click (mouse selects a control)
void multi_ts_init_players()
int ss_swap_slot_slot(int from_slot, int to_slot, int *sound)
bool end_string_at_first_hash_symbol(char *src)
#define MULTI_TS_WEAPON_SELECT
void multi_ts_drop(int from_type, int from_index, int to_type, int to_index, int ship_class, int player_index)
#define GM_STANDALONE_SERVER
#define MULTI_END_NOTIFY_NONE
int ss_swap_list_slot(int from_list, int to_slot, int *sound)
#define MULTI_TS_MAX_TVT_TEAMS
#define TS_SWAP_LIST_SLOT
int Multi_ts_deleted_objnums[MULTI_TS_MAX_TVT_TEAMS *MULTI_TS_NUM_SHIP_SLOTS]
#define ICON_FRAME_SELECTED
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
int multi_quit_game(int prompt, int notify_code, int err_code, int wsa_error)
int Multi_ts_carried_ship_class
#define MULTI_PERM_OBSERVER(np)
int multi_ts_get_avail_ship_class(int index)
int Multi_ts_carried_from_index
MENU_REGION Multi_ts_region[MULTI_TS_NUM_SNAZZY_REGIONS]
char alt_name[NAME_LENGTH]
void obj_delete(int objnum)
#define MULTI_TS_SHIPS_DOWN
void link_hotspot(int num)
ubyte * get_mask_data(int *w_md, int *h_md)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
int wep[MAX_SHIP_WEAPONS]
#define TS_SWAP_SLOT_SLOT
#define UI_XSTR_COLOR_PINK
#define MULTI_TS_SHIP_INFO_MAX_LINES
#define MULTI_TS_SHIPS_UP
#define MULTI_CONNECTED(np)
void send_pslot_update_packet(int team, int code, int sound)
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
int gr_force_fit_string(char *str, int max_str, int max_width)
#define MULTI_TS_NUM_SHIP_SLOTS
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
#define MULTI_END_ERROR_SHIP_ASSIGN
int store_wss_data(ubyte *block, int max_size, int sound, int player_index)
#define ICON_FRAME_PLAYER
SCP_vector< ship_info > Ship_info
void common_play_highlight_sound()
GLenum GLsizei GLenum GLenum const GLvoid * data
char TVT_wing_names[MAX_TVT_WINGS][NAME_LENGTH]
void multi_common_voice_display_status()
int ss_dump_to_list(int from_slot, int to_list, int *sound)
int multi_ts_player_index(int region)
int chatbox_process(int key_in)
char * maneuverability_str
void multi_ts_maybe_host_only_popup()
#define NETPLAYER_STATE_SHIP_SELECT
wss_unit Wss_slots_teams[MAX_TVT_TEAMS][MAX_WSS_SLOTS]
void drop_leading_white_space(char *str)
void change_ship_type(int n, int ship_type, int by_sexp)
#define MULTI_TS_FLAG_EMPTY
void multi_ts_blit_status_bar()
int Multi_ts_clicked_flag
void gr_bitmap(int _x, int _y, int resize_mode)
void multi_ts_handle_player_drop()
void ss_make_slot_empty(int slot_index)
#define UI_XSTR_COLOR_GREEN
void multi_ts_select_ship()
void multi_ts_handle_mouse()
int mission_ui_background_load(const char *custom_background, const char *single_background, const char *multi_background)
void multi_ts_blit_wings()
#define MULTI_TS_NUM_BUTTONS
char * Multi_ts_bmap_names[GR_NUM_RESOLUTIONS][3]
int bm_unload(int handle, int clear_render_targets, bool nodebug)
Unloads a bitmap's data, but not the bitmap info.
#define AIPF_MULTI_ALLOW_EMPTY_PRIMARIES
int ship_name_lookup(const char *name, int inc_players)
void gamesnd_play_iface(int n)
int multi_ts_disabled_high_slot(int slot_index, int player_index)
struct ui_button_info ui_button_info
int Multi_ts_carried_from_type
void multi_ts_sync_interface()
void send_wss_request_packet(short player_id, int from_slot, int from_index, int to_slot, int to_index, int wl_ship_slot, int ship_class, int mode, net_player *p)
int multi_ts_get_team(char *ship_name)
#define MULTI_TS_NUM_SNAZZY_REGIONS
void ss_recalc_multiplayer_slots()
int process(int key_in=-1, int process_mouse=1)
net_player Net_players[MAX_PLAYERS]
void gameseq_post_event(int event)
drop a ship icon back to the list
int wing_lookup(const char *name)
#define MULTI_TS_FLAG_NONE
char ship_name[NAME_LENGTH]
int multi_ts_move_player(int from_index, int to_index, int *sound, int player_index=-1)
#define ICON_FRAME_NORMAL
#define MULTI_TS_PLAYER_LIST
int Multi_ts_hotspot_type