2 * $Logfile: /Freespace2/code/Hud/HUDsquadmsg.h $
7 * header file for squadmate messaging
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 3 3/30/99 5:40p Dave
15 * Fixed reinforcements for TvT in multiplayer.
17 * 2 10/07/98 10:53a Dave
20 * 1 10/07/98 10:49a Dave
22 * 26 9/11/98 2:05p Allender
23 * make reinforcements work correctly in multiplayer games. There still
24 * may be a team vs team issue that I haven't thought of yet :-(
26 * 25 5/19/98 12:19p Mike
29 * 24 5/13/98 5:09p Allender
30 * Make send_command functions return whether message was sent or not
32 * 23 5/04/98 8:58a Allender
33 * new key saving routine
35 * 22 4/22/98 4:59p Allender
36 * new multiplayer dead popup. big changes to the comm menu system for
37 * team vs. team. Start of debriefing stuff for team vs. team Make form
38 * on my wing work with individual ships who have high priority orders
40 * 21 4/13/98 12:51p Allender
41 * made countermeasure succeed indicator work in multiplayer. Make rearm
42 * shortcut work more appropriately.
44 * 20 2/26/98 4:21p John
45 * Changed comm_orders around so I could externalize the strings
47 * 19 2/20/98 8:34p Lawrance
48 * added hud_squadmsg_reinforcements_available(), since this information
49 * is required outside of hudsquadmsg
51 * 18 2/11/98 9:44p Allender
52 * rearm repair code fixes. hud support view shows abort status. New
53 * support ship killed message. More network stats
55 * 17 11/20/97 12:08a Allender
56 * added 'all fighters' option at top level menu. cleaned up messaging to
59 * 16 11/07/97 4:35p Dave
60 * Fixed multiplayer support ship bug. Put in player kill/assists client
63 * 15 11/03/97 10:09a Allender
64 * fixed up graying out of comm menu options
66 * 14 10/31/97 4:59p Allender
67 * remove protect_ship from list of filtered orders
69 * 13 10/31/97 4:33p Allender
70 * fix bogus repair message. gray out messages based on players target
72 * 12 9/30/97 5:07p Dave
73 * Adapted messaging to correctly work with client-server situations in
76 * 11 9/23/97 4:34p Allender
77 * made squadmessaging use main keyboard reading loop instead of separate
80 * 10 9/18/97 5:21p Hoffoss
81 * Added column breaks for message list in sexp trees, and added code for
84 * 9 7/25/97 9:52a Allender
85 * added order dialog to Fred for designer to choose which orders for ship
86 * to accept/ignore. Code in ship_create to set up variables for Fred use
87 * instead of Freespace use (for destroying ships before mission starts)
89 * 8 6/16/97 2:58p Allender
90 * added ignore my target order to player's comm menu. Fixed a couple of
91 * problem when trying to message wings
93 * 7 4/30/97 2:32p Allender
94 * add ability to message enemies as debug tool
96 * 6 4/07/97 3:50p Allender
97 * ability to assign > 1 ship to a hotkey. Enabled use of hotkeys in
100 * 5 4/05/97 3:46p Allender
101 * lots 'o messaging stuff. Make shortcut keys for squadmate messaging
102 * work. Make menus a little more dynamic
104 * 4 2/06/97 1:49p Allender
105 * more messaging stuff -- most menus printout out stuff -- nothing
106 * functional in terms of action
108 * 3 2/03/97 4:50p Allender
109 * saving/restoring of keys used for messaging mode
111 * 2 1/31/97 9:38a Allender
112 * checkpoint for sqaudmate messaging
114 * 1 1/24/97 2:18p Allender
119 #ifndef _HUD_SQUADMSG
120 #define _HUD_SQUADMSG
124 // defines for messages that can be sent from the player. Defined at bitfields so that we can enable
125 // and disable messages on a message by message basis
126 #define ATTACK_TARGET_ITEM (1<<0)
127 #define DISABLE_TARGET_ITEM (1<<1)
128 #define DISARM_TARGET_ITEM (1<<2)
129 #define PROTECT_TARGET_ITEM (1<<3)
130 #define IGNORE_TARGET_ITEM (1<<4)
131 #define FORMATION_ITEM (1<<5)
132 #define COVER_ME_ITEM (1<<6)
133 #define ENGAGE_ENEMY_ITEM (1<<7)
134 #define CAPTURE_TARGET_ITEM (1<<8)
136 // the next are for the support ship only
137 #define REARM_REPAIR_ME_ITEM (1<<9)
138 #define ABORT_REARM_REPAIR_ITEM (1<<10)
139 #define STAY_NEAR_ME_ITEM (1<<11)
140 #define STAY_NEAR_TARGET_ITEM (1<<12)
141 #define KEEP_SAFE_DIST_ITEM (1<<13)
143 // next item for all ships again -- to try to preserve relative order within the message menu
144 #define DEPART_ITEM (1<<14)
145 #define DISABLE_SUBSYSTEM_ITEM (1<<15)
147 #define MAX_SHIP_ORDERS 13 // Must sync correctly with Comm_orders array in HUDsquadmsg.cpp
149 // following defines are the set of possible commands that can be given to a ship. A mission designer
150 // might not allow some messages
152 #define FIGHTER_MESSAGES (ATTACK_TARGET_ITEM | DISABLE_TARGET_ITEM | DISARM_TARGET_ITEM | PROTECT_TARGET_ITEM | IGNORE_TARGET_ITEM | FORMATION_ITEM | COVER_ME_ITEM | ENGAGE_ENEMY_ITEM | DEPART_ITEM | DISABLE_SUBSYSTEM_ITEM)
154 #define BOMBER_MESSAGES FIGHTER_MESSAGES // bombers can do the same things as fighters
156 #define TRANSPORT_MESSAGES (ATTACK_TARGET_ITEM | CAPTURE_TARGET_ITEM | DEPART_ITEM )
157 #define FREIGHTER_MESSAGES TRANSPORT_MESSAGES // freighters can do the same things as transports
159 #define CRUISER_MESSAGES (ATTACK_TARGET_ITEM | DEPART_ITEM)
161 #define CAPITAL_MESSAGES (DEPART_ITEM) // can't order capitals to do much!!!!
163 #define SUPPORT_MESSAGES (REARM_REPAIR_ME_ITEM | ABORT_REARM_REPAIR_ITEM | STAY_NEAR_ME_ITEM | STAY_NEAR_TARGET_ITEM | KEEP_SAFE_DIST_ITEM | DEPART_ITEM )
165 // these messages require an active target. They are also the set of messages
166 // which cannot be given to a ship when the target is on the same team, or the target
168 #define ENEMY_TARGET_MESSAGES (ATTACK_TARGET_ITEM | DISABLE_TARGET_ITEM | DISARM_TARGET_ITEM | IGNORE_TARGET_ITEM | STAY_NEAR_TARGET_ITEM | CAPTURE_TARGET_ITEM | DISABLE_SUBSYSTEM_ITEM )
169 #define FRIENDLY_TARGET_MESSAGES (PROTECT_TARGET_ITEM)
171 #define TARGET_MESSAGES (ENEMY_TARGET_MESSAGES | FRIENDLY_TARGET_MESSAGES)
174 #define SQUADMSG_HISTORY_MAX 160
177 int ship; // ship that received the order
178 int order; // order that the ship received (see defines above)
179 int target; // ship that is the target of the order
182 extern int squadmsg_history_index;
183 extern squadmsg_history Squadmsg_history[SQUADMSG_HISTORY_MAX];
185 extern int Multi_squad_msg_local;
186 extern int Multi_squad_msg_targ;
188 extern void hud_init_squadmsg();
189 extern void hud_squadmsg_toggle(); // toggles the state of messaging mode
190 extern void hud_squadmsg_shortcut( int command ); // use of a shortcut key
191 extern int hud_squadmsg_hotkey_select( int k ); // a hotkey was hit -- maybe send a message to those ship(s)
192 extern void hud_squadmsg_save_keys( int do_scroll = 0 ); // saves into local area keys which need to be saved/restored when in messaging mode
193 extern int hud_squadmsg_do_frame();
194 extern int hud_query_order_issued(char *name, char *order, char *target);
195 extern int hud_squadmsg_read_key( int k ); // called from high level keyboard code
197 extern void hud_squadmsg_repair_rearm( int toggle_state, object *obj = NULL );
198 extern void hud_squadmsg_repair_rearm_abort( int toggle_state, object *obj = NULL );
199 extern void hud_squadmsg_rearm_shortcut();
201 extern int hud_squadmsg_send_ship_command( int shipnum, int command, int send_message, int player_num = -1 );
202 extern int hud_squadmsg_send_wing_command( int wingnum, int command, int send_message, int player_num = -1 );
203 extern void hud_squadmsg_send_to_all_fighters( int command, int player_num = -1 );
204 extern void hud_squadmsg_call_reinforcement(int reinforcement_num, int player_num = -1);
206 extern int hud_squadmsg_reinforcements_available(int team);
209 void hud_enemymsg_toggle(); // debug function to allow messaging of enemies