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