]> icculus.org git repositories - taylor/freespace2.git/blob - include/missionweaponchoice.h
Initial revision
[taylor/freespace2.git] / include / missionweaponchoice.h
1 /*
2  * $Logfile: /Freespace2/code/MissionUI/MissionWeaponChoice.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file for the weapon loadout screen
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 2     10/07/98 10:53a Dave
15  * Initial checkin.
16  * 
17  * 1     10/07/98 10:50a Dave
18  * 
19  * 21    4/17/98 5:27p Dave
20  * More work on the multi options screen. Fixed many minor ui todo bugs.
21  * 
22  * 20    3/31/98 1:50p Duncan
23  * ALAN: fix bugs with selecting alternate weapons 
24  * 
25  * 19    2/28/98 7:04p Lawrance
26  * Don't show reset button in multiplayer
27  * 
28  * 18    2/24/98 6:21p Lawrance
29  * Integrate new reset button into loadout screens
30  * 
31  * 17    1/17/98 4:14p Lawrance
32  * fix mask problem with primary weapon scrolling
33  * 
34  * 16    1/17/98 1:32a Lawrance
35  * fix mask problem that was mixing up scroll up and scroll down on
36  * weapons loadout
37  * 
38  * 15    1/09/98 6:06p Dave
39  * Put in network sound support for multiplayer ship/weapon select
40  * screens. Made clients exit game correctly through warp effect. Fixed
41  * main hall menu help overlay bug.
42  * 
43  * 14    12/24/97 1:19p Lawrance
44  * fix some bugs with the multiplayer ship/weapons loadout
45  * 
46  * 13    12/23/97 5:25p Allender
47  * more fixes to multiplayer ship selection.  Fixed strange reentrant
48  * problem with cf_callback when loading freespace data
49  * 
50  * 12    12/22/97 6:18p Lawrance
51  * Get save/restore of player loadout working with new code
52  * 
53  * 11    12/22/97 1:40a Lawrance
54  * Re-write ship select/weapons loadout to be multiplayer friendly
55  * 
56  * 10    12/19/97 1:23p Dave
57  * Put in multiplayer groundwork for new weapon/ship select screens.
58  * 
59  * 9     12/18/97 8:59p Dave
60  * Finished putting in basic support for weapon select and ship select in
61  * multiplayer.
62  * 
63  * 8     12/17/97 7:42p Lawrance
64  * re-work how weapons are re-set when ships change in ship select
65  * 
66  * 7     12/17/97 4:53p Lawrance
67  * changes to support multiplayer
68  * 
69  * 6     12/17/97 2:33p Dave
70  * Finished up basic weapon select support for multiplayer.
71  * 
72  * 5     12/16/97 6:17p Dave
73  * Put in primary weapon support for multiplayer weapon select screen.
74  * 
75  * 4     12/03/97 1:22p Lawrance
76  * implement saving/restoring of ship selection and weapons loadout
77  * 
78  * 3     12/02/97 10:51p Lawrance
79  * implement save/restore of ship selection and weapon loadouts
80  * 
81  * 2     11/15/97 6:12p Lawrance
82  * don't allow Player ship to have all weapons removed
83  * 
84  * 1     9/30/97 10:16a Lawrance
85  * move files from Mission lib to MissionUI lib
86  * 
87  * 8     9/18/97 7:58a Lawrance
88  * fix some bugs associated with the player ship being created early on
89  * 
90  * 7     8/30/97 12:24p Lawrance
91  * supporting animations in the weapons loadout screen, fixed some bugs
92  * 
93  * 6     8/29/97 7:33p Lawrance
94  * further work on weapons loadout
95  * 
96  * 5     8/15/97 8:00p Lawrance
97  * integrating new art for the briefing screens
98  * 
99  * 4     7/23/97 11:36a Lawrance
100  * support common buttons through the briefing/ship select/weapons
101  * loadout, be able to hide buttons when necessary
102  * 
103  * 3     7/14/97 3:58p Lawrance
104  * limit frametime to 33 ms for animation timing
105  * 
106  * 2     2/25/97 11:11a Lawrance
107  * ship selection and weapon loadout interfaces working at basic level
108  *
109  * $NoKeywords: $
110  */
111
112
113 #ifndef __MISSION_WEAPON_CHOICE_H__
114 #define __MISSION_WEAPON_CHOICE_H__
115
116 #include "missionparse.h"
117 #include "missionscreencommon.h"
118
119 // mask regions for icons in the scrollable lists
120 #define ICON_PRIMARY_0                          28
121 #define ICON_PRIMARY_1                          29
122 #define ICON_PRIMARY_2                          30
123 #define ICON_PRIMARY_3                          31
124 #define ICON_SECONDARY_0                        10
125 #define ICON_SECONDARY_1                        11
126 #define ICON_SECONDARY_2                        12
127 #define ICON_SECONDARY_3                        13
128
129 // mask regions for icons that sit above the ship
130 #define ICON_SHIP_PRIMARY_0             32
131 #define ICON_SHIP_PRIMARY_1             33
132 #define ICON_SHIP_PRIMARY_2             34
133 #define ICON_SHIP_SECONDARY_0           35
134 #define ICON_SHIP_SECONDARY_1           36
135 #define ICON_SHIP_SECONDARY_2           37
136 #define ICON_SHIP_SECONDARY_3           38
137
138 // mask region for weapon loadout specific buttons
139 #define PRIMARY_SCROLL_UP                                       27      
140 #define PRIMARY_SCROLL_DOWN                             26
141 #define SECONDARY_SCROLL_UP                             9
142 #define SECONDARY_SCROLL_DOWN                           8
143 #define WL_RESET_BUTTON_MASK                            39
144
145 #define NUM_WEAPON_REGIONS              (NUM_COMMON_REGIONS + 32)
146
147 void weapon_select_init();
148 void weapon_select_common_init();
149 void weapon_select_do(float frametime);
150 void weapon_select_close();
151
152 void    wl_update_parse_object_weapons(p_object *pobjp, wss_unit *slot);
153 int     wl_update_ship_weapons(int objnum, wss_unit *slot);
154 void    wl_bash_ship_weapons(ship_weapon *swp, wss_unit *slot);
155
156 void wl_set_default_weapons(int index, int ship_class);
157 void wl_reset_to_defaults();
158
159 // Set selected slot to first placed ship
160 void wl_reset_selected_slot();
161
162 void wl_remove_weps_from_pool(int *wep, int *wep_count, int ship_class);
163 void wl_get_ship_class_weapons(int ship_class, int *wep, int *wep_count);
164 void wl_get_default_weapons(int ship_class, int slot_num, int *wep, int *wep_count);
165
166 void wl_synch_interface();
167 void wl_apply(int mode,int from_bank,int from_list,int to_bank,int to_list,int ship_slot,int player_index = -1);
168 void wl_drop(int from_bank,int from_list,int to_bank,int to_list, int ship_slot,int player_index = -1);
169
170 #endif /* __MISSION_WEAPON_CHOICE_H__ */
171