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/MissionUI/MissionShipChoice.h $
15 * Header file to support functions that allow player ship selection for the mission
18 * Revision 1.2 2002/06/09 04:41:14 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 3 7/15/99 6:36p Jamesa
26 * Moved default ship name into the ships.tbl
28 * 2 10/07/98 10:53a Dave
31 * 1 10/07/98 10:50a Dave
33 * 21 3/05/98 5:03p Dave
34 * More work on team vs. team support for multiplayer. Need to fix bugs in
37 * 20 2/24/98 6:21p Lawrance
38 * Integrate new reset button into loadout screens
40 * 19 2/18/98 3:56p Dave
41 * Several bugs fixed for mp team select screen. Put in standalone packet
42 * routing for team select.
44 * 18 2/17/98 6:07p Dave
45 * Tore out old multiplayer team select screen, installed new one.
47 * 17 1/15/98 4:11p Lawrance
48 * Add call to check if slot is player occupied.
50 * 16 1/09/98 6:06p Dave
51 * Put in network sound support for multiplayer ship/weapon select
52 * screens. Made clients exit game correctly through warp effect. Fixed
53 * main hall menu help overlay bug.
55 * 15 12/29/97 4:21p Lawrance
56 * Flash buttons on briefing/ship select/weapons loadout when enough time
57 * has elapsed without activity.
59 * 14 12/24/97 1:19p Lawrance
60 * fix some bugs with the multiplayer ship/weapons loadout
62 * 13 12/23/97 5:25p Allender
63 * more fixes to multiplayer ship selection. Fixed strange reentrant
64 * problem with cf_callback when loading freespace data
66 * 12 12/22/97 6:18p Lawrance
67 * Get save/restore of player loadout working with new code
69 * 11 12/22/97 1:40a Lawrance
70 * Re-write ship select/weapons loadout to be multiplayer friendly
72 * 10 12/19/97 1:23p Dave
73 * Put in multiplayer groundwork for new weapon/ship select screens.
75 * 9 12/18/97 8:59p Dave
76 * Finished putting in basic support for weapon select and ship select in
79 * 8 12/18/97 10:24a Lawrance
80 * Fix problem with ships having no weapons due to bogus weapons pools.
82 * 7 12/08/97 9:37p Lawrance
83 * fix up auto-restore of player ship selection and weapons
85 * 6 12/03/97 1:22p Lawrance
86 * implement saving/restoring of ship selection and weapons loadout
88 * 5 12/02/97 10:51p Lawrance
89 * implement save/restore of ship selection and weapon loadouts
91 * 4 11/27/97 10:03a Lawrance
92 * supporting SF_LOCKED flag
94 * 3 10/04/97 5:56p Lawrance
95 * keep track of original ship class in ship selection
97 * 2 10/04/97 12:00a Lawrance
98 * grey out background when help overlay is activated
100 * 1 9/30/97 10:16a Lawrance
101 * move files from Mission lib to MissionUI lib
103 * 34 9/25/97 3:49p Lawrance
104 * add a disabled icon to ship icon frame list
106 * 33 9/24/97 11:43p Hoffoss
107 * Changed Parse_player to Team_data, removed the fields we don't want in
108 * it anymore, and fixed some code that had problems with that.
110 * 32 9/24/97 5:03p Dave
111 * Spliced a bunch of stuff into MissionScreenCommon.[h,cpp]
113 * 31 9/23/97 11:55p Lawrance
114 * add ss_return_name() function
116 * 30 9/19/97 4:22p Allender
117 * externed some functions that multi team selection screen will use
119 * 29 9/18/97 7:58a Lawrance
120 * fix some bugs associated with the player ship being created early on
122 * 28 9/16/97 5:15p Allender
123 * fixed link problem with Fred
125 * 27 9/07/97 10:04p Lawrance
126 * make drag/drop and selection work as Windows does with mouse-button up
129 * 26 8/30/97 12:24p Lawrance
130 * supporting animations in the weapons loadout screen, fixed some bugs
132 * 25 8/29/97 7:33p Lawrance
133 * further work on weapons loadout
135 * 24 8/24/97 5:24p Lawrance
136 * improve drawing of buttons
138 * 23 8/18/97 5:28p Lawrance
139 * integrating sounds for when mouse goes over an active control
141 * 22 8/17/97 2:41p Lawrance
142 * improving interface
144 * 21 8/15/97 8:00p Lawrance
145 * integrating new art for the briefing screens
147 * 20 8/11/97 9:47p Lawrance
148 * get multiplayer chat window hooks working
150 * 19 7/23/97 11:36a Lawrance
151 * support common buttons through the briefing/ship select/weapons
152 * loadout, be able to hide buttons when necessary
154 * 18 7/21/97 11:41a Lawrance
155 * make playback time of .ani files keyed of frametime
157 * 17 7/20/97 6:59p Lawrance
158 * changed name of some anim functions to be more consistent
160 * 16 7/14/97 3:58p Lawrance
161 * limit frametime to 33 ms for animation timing
163 * 15 6/26/97 12:12a Lawrance
164 * supporting anti-aliased bitmap animations
166 * 14 6/24/97 11:46p Lawrance
167 * supporting icon text and rotating models
169 * 13 6/12/97 11:09p Lawrance
170 * getting map and text integrated into briefing
172 * 12 6/12/97 11:28a Lawrance
173 * separating FRED dependant code
175 * 11 6/12/97 2:48a Lawrance
176 * integrating briefing into ship select / weapon loadout screen
178 * 10 5/23/97 2:01p Lawrance
179 * added update_player_weapons()
181 * 9 5/20/97 2:44p Allender
182 * move player ship creation into player_level_init which is done before
183 * most other things when a level loads
185 * 8 3/28/97 12:09p Lawrance
186 * change create_default_player_ship() to allow the default to be the last
187 * ship the player has flown
189 * 7 3/20/97 3:01p Lawrance
190 * made scroll buttons repeat action when held down, don't do button
191 * actions until down and release
193 * 6 3/07/97 8:14p Lawrance
194 * added code to drag and drop to wing formations
196 * 5 2/26/97 10:05a Lawrance
197 * move ship_create() to end of loop when commit pressed, so don't skip on
200 * 4 2/25/97 11:11a Lawrance
201 * ship selection and weapon loadout interfaces working at basic level
203 * 3 12/30/96 1:58a Lawrance
204 * supporting ship choice in multiplayer
206 * 2 11/19/96 1:21p Lawrance
207 * got ship selection working inside out
213 #ifndef __MISSIONSHIPCHOICE_H__
214 #define __MISSIONSHIPCHOICE_H__
216 #include "missionscreencommon.h"
217 #include "missionparse.h"
219 ///////////////////////////////////////////////////////
220 // Ships selection hot spots
221 ///////////////////////////////////////////////////////
222 #define SHIP_SELECT_SHIP_SCROLL_UP 8
223 #define SHIP_SELECT_SHIP_SCROLL_DOWN 9
225 #define SHIP_SELECT_ICON_0 10
226 #define SHIP_SELECT_ICON_1 11
227 #define SHIP_SELECT_ICON_2 12
228 #define SHIP_SELECT_ICON_3 13
230 #define WING_0_SHIP_0 14
231 #define WING_0_SHIP_1 15
232 #define WING_0_SHIP_2 16
233 #define WING_0_SHIP_3 17
234 #define WING_1_SHIP_0 18
235 #define WING_1_SHIP_1 19
236 #define WING_1_SHIP_2 20
237 #define WING_1_SHIP_3 21
238 #define WING_2_SHIP_0 22
239 #define WING_2_SHIP_1 23
240 #define WING_2_SHIP_2 24
241 #define WING_2_SHIP_3 25
243 #define SHIP_SELECT_RESET 39
245 #define NUM_SHIP_SELECT_REGIONS (NUM_COMMON_REGIONS + 19)
247 extern int Ship_select_open; // This game-wide global flag is set to 1 to indicate that the ship
248 // select screen has been opened and memory allocated. This flag
249 // is needed so we can know if ship_select_close() needs to called if
250 // restoring a game from the Options screen invoked from ship select
252 extern int Commit_pressed; // flag to indicate that the commit button was pressed
253 // use a flag, so the ship_create() can be done at the end of the loop
255 extern char default_player_ship[255];
256 extern int Select_default_ship;
258 void draw_wing_block(int wb_num, int hot_slot, int selected_slot, int class_select);
259 void ship_select_init();
260 void ship_select_do(float frametime);
261 void ship_select_close();
262 void ship_select_common_init();
263 void ship_stop_animation();
264 int ss_get_ship_class(int ship_entry_index);
265 int ss_get_selected_ship();
267 void ss_blit_ship_icon(int x,int y,int ship_class,int bmap_num);
269 // called from weapon select
270 int ss_return_ship(int wing_block, int wing_slot, int *ship_index, p_object **ppobjp);
271 void ss_return_name(int wing_block, int wing_slot, char *name);
272 int ss_return_original_ship_class(int slot_num);
273 int ss_return_saindex(int slot_num);
274 int ss_disabled_slot(int slot_num);
275 int ss_wing_slot_is_console_player(int index);
277 // lock/unlock any necessary slots for multiplayer
278 void ss_recalc_multiplayer_slots();
280 int create_default_player_ship( int use_last_flown = 1 );
281 void update_player_ship(int si_index);
283 void ss_synch_interface();
285 // set the necessary pointers
286 void ss_set_team_pointers(int team);
288 // called by multiplayer team select to set the slot based flags
289 void ss_make_slot_empty(int slot_index);
290 void ss_make_slot_full(int slot_index);
292 int ss_dump_to_list(int from_slot, int to_list, int *sound);
293 int ss_swap_slot_slot(int from_slot, int to_slot, int *sound);
294 int ss_grab_from_list(int from_list, int to_slot, int *sound);
295 int ss_swap_list_slot(int from_list, int to_slot, int *sound);
297 void ss_apply(int mode, int from_slot,int from_index,int to_slot,int to_index,int player_index = -1);
298 void ss_drop(int from_slot,int from_index,int to_slot,int to_index,int player_index = -1);
300 #endif /* __MISSIONSHIPCHOICE_H__ */