]> icculus.org git repositories - taylor/freespace2.git/blob - include/missionlog.h
Initial revision
[taylor/freespace2.git] / include / missionlog.h
1 /*
2  * $Logfile: /Freespace2/code/Mission/MissionLog.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file to deal with Mission logs
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 4     8/22/99 5:53p Dave
15  * Scoring fixes. Added self destruct key. Put callsigns in the logfile
16  * instead of ship designations for multiplayer players.
17  * 
18  * 3     2/26/99 6:01p Andsager
19  * Add sexp has-been-tagged-delay and cap-subsys-cargo-known-delay
20  * 
21  * 2     10/07/98 10:53a Dave
22  * Initial checkin.
23  * 
24  * 1     10/07/98 10:49a Dave
25  * 
26  * 21    4/28/98 4:45p Allender
27  * fix mission log problems on clients
28  * 
29  * 20    1/07/98 4:41p Allender
30  * minor modification to special messages.  Fixed cargo_revealed problem
31  * for multiplayer and problem with is-cargo-known sexpression
32  * 
33  * 19    11/13/97 1:21p Hoffoss
34  * Added a hidden flag to entries can be hidden from being displayed to
35  * the user (but kept in log for checking things).
36  * 
37  * 18    11/03/97 10:12p Hoffoss
38  * Finished up work on the hud message/mission log scrollback screen.
39  * 
40  * 17    9/10/97 8:53a Allender
41  * made the mission log prettier.  Added team info to log entries -- meant
42  * reordering some code
43  * 
44  * 16    8/31/97 6:38p Lawrance
45  * pass in frametime to do_frame loop
46  * 
47  * 15    8/07/97 11:37a Allender
48  * made mission log cull non-essential entries when log starts getting
49  * full.  More drastic action is taken as the log gets more full.
50  * 
51  * 14    7/02/97 10:49p Allender
52  * added waypoints-done sexpressions
53  * 
54  * 13    7/01/97 2:52p Allender
55  * added packets for mission log stuff and for pregame chat stuff
56  * 
57  * 12    3/04/97 1:21p Mike
58  * Repair/Rearm aborting, code cleanup.
59  * 
60  * 11    3/03/97 1:21p Allender
61  * mission log stuff -- display the log during/after game.  Enhanced
62  * structure
63  * 
64  * 10    2/20/97 5:05p Allender
65  * support for docking and undocking multiple times -- also able to
66  * specify dock points through sexpression
67  * 
68  * 9     2/17/97 3:50p Allender
69  * change to allow ability to destroy single subsystem (through orders) or
70  * all engines (disable) or all turrets (disarm)
71  * 
72  * 8     1/06/97 10:44p Lawrance
73  * Changes to make save/restore functional
74  * 
75  * 7     1/06/97 11:29a Allender
76  * added define for logging a ship that undocks
77  * 
78  * 6     1/01/97 4:18p Allender
79  * added new field in mission log entry -- secondary name.  Used when
80  * there are two objects for a log entry (i.e. docking)
81  * 
82  * 5     12/17/96 1:04p Allender
83  * added subtype field for mission messages -- not used yet and may be
84  * removed
85  * 
86  * 4     11/08/96 9:06a Allender
87  * added LOG_SHIP_DOCK
88  * 
89  * 3     10/24/96 8:36a Allender
90  * added a couple of new event types
91  * 
92  * 2     10/23/96 12:48p Allender
93  * increased mission log functionality -- function to get the timestamp
94  * that a recorded event happened at
95  * 
96  * 1     10/22/96 4:49p Allender
97  * Mission log files
98  * 
99 */
100
101 #ifndef _MISSIONLOG_H
102 #define _MISSIONLOG_H
103
104 // defined for different mission log entries
105
106 #define LOG_SHIP_DESTROYED                              1
107 #define LOG_WING_DESTROYED                              2
108 #define LOG_SHIP_ARRIVE                                 3
109 #define LOG_WING_ARRIVE                                 4
110 #define LOG_SHIP_DEPART                                 5
111 #define LOG_WING_DEPART                                 6
112 #define LOG_SHIP_DOCK                                   7
113 #define LOG_SHIP_SUBSYS_DESTROYED       8
114 #define LOG_SHIP_UNDOCK                                 9
115 #define LOG_SHIP_DISABLED                               10
116 #define LOG_SHIP_DISARMED                               11
117 #define LOG_PLAYER_REARM                                12
118 #define LOG_PLAYER_REINFORCEMENT                13
119 #define LOG_GOAL_SATISFIED                              14
120 #define LOG_GOAL_FAILED                                 15
121 #define LOG_PLAYER_REARM_ABORT          16
122 #define LOG_WAYPOINTS_DONE                              17
123 #define LOG_CARGO_REVEALED                              18
124 #define LOG_CAP_SUBSYS_CARGO_REVEALED 19
125 #define LOG_SELF_DESTRUCT                               20
126
127 // structure definition for log entries
128
129 #define MLF_ESSENTIAL                           (1<<0)          // this entry is essential for goal checking code
130 #define MLF_OBSOLETE                                    (1<<1)          // this entry is obsolete and will be removed
131 #define MLF_PRIMARY_FRIENDLY            (1<<2)          // primary object in this entry is friendly
132 #define MLF_PRIMARY_HOSTILE             (1<<3)          // primary object in this entry is hostile
133 #define MLF_SECONDARY_FRIENDLY  (1<<4)          // secondary object is friendly
134 #define MLF_SECONDARY_HOSTILE           (1<<5)          // secondary object is hostile
135 #define MLF_HIDDEN                                      (1<<6)          // entry doesn't show up in displayed log.
136
137 typedef struct {
138         int             type;                                                                   // one of the log #defines in MissionLog.h
139         int             flags;                                                          // flags used for status of this log entry
140         fix             timestamp;                                                      // time in fixed seconds when entry was made from beginning of mission
141         char            pname[NAME_LENGTH];                             // name of primary object of this action
142         char            sname[NAME_LENGTH];                             // name of secondary object of this action
143         int             index;                                                          // a generic entry which can contain things like wave # (for wing arrivals), goal #, etc
144 } log_entry;
145
146 extern log_entry log_entries[];
147 extern int last_entry;
148 extern int Num_log_lines;
149
150 // function prototypes
151
152 // to be called before each mission starts
153 extern void mission_log_init();
154
155 // adds an entry to the mission log.  The name is a string identifier that is the object
156 // of the event.  The multiplayer version of this takes the actual entry number to modify.
157 extern void mission_log_add_entry(int type, char *pname, char *sname, int index = -1 );
158 extern void mission_log_add_entry_multi( int type, char *pname, char *sname, int index, fix timestamp, int flags );
159
160 // function to determine if event happened and what time it happened
161 extern int mission_log_get_time( int type, char *name, char *sname, fix *time);
162
163 // function to determine if event happend count times and return time that the count event
164 // happened
165 extern int mission_log_get_time_indexed( int type, char *name, char *sname, int count, fix *time);
166
167 // function to show all message log entries during or after mission
168 // (code stolen liberally from Alan!)
169 extern void mission_log_scrollback(float frametime);
170
171 void message_log_init_scrollback(int pw);
172 void message_log_shutdown_scrollback();
173 void mission_log_scrollback(int scroll_offset, int list_x, int list_y, int list_w, int list_h);
174
175 #endif
176