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/Chatbox.h $
15 * Header file for chat box code
18 * Revision 1.2 2002/06/09 04:41:12 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 3 5/22/99 5:35p Dave
26 * Debrief and chatbox screens. Fixed small hi-res HUD bug.
28 * 2 10/07/98 10:53a Dave
31 * 1 10/07/98 10:49a Dave
33 * 14 9/11/98 5:08p Dave
34 * More tweaks to kick notification system.
36 * 13 9/11/98 4:14p Dave
37 * Fixed file checksumming of < file_size. Put in more verbose kicking and
38 * PXO stats store reporting.
40 * 12 5/15/98 5:15p Dave
41 * Fix a standalone resetting bug.Tweaked PXO interface. Display captaincy
42 * status for team vs. team. Put in asserts to check for invalid team vs.
45 * 11 4/14/98 5:06p Dave
46 * Don't load or send invalid pilot pics. Fixed chatbox graphic errors.
47 * Made chatbox display team icons in a team vs. team game. Fixed up pause
48 * and endgame sequencing issues.
50 * 10 4/12/98 2:09p Dave
51 * Make main hall door text less stupid. Make sure inputbox focus in the
52 * multi host options screen is managed more intelligently.
54 * 9 4/01/98 11:19p Dave
55 * Put in auto-loading of xferred pilot pic files. Grey out background
56 * behind pinfo popup. Put a chatbox message in when players are kicked.
57 * Moved mission title down in briefing. Other ui fixes.
59 * 8 3/29/98 1:24p Dave
60 * Make chatbox not clear between multiplayer screens. Select player ship
61 * as default in mp team select and weapons select screens. Made create
62 * game mission list use 2 fixed size columns.
64 * 7 2/13/98 3:46p Dave
65 * Put in dynamic chatbox sizing. Made multiplayer file lookups use cfile
68 * 6 1/16/98 2:34p Dave
69 * Made pause screen work properly (multiplayer). Changed how chat packets
72 * 5 1/07/98 5:20p Dave
73 * Put in support for multiplayer campaigns with the new interface
76 * 4 12/18/97 8:59p Dave
77 * Finished putting in basic support for weapon select and ship select in
80 * 3 10/01/97 4:47p Lawrance
81 * move some #defines out of header file into .cpp file
83 * 2 10/01/97 4:39p Lawrance
84 * move chat code into Chatbox.cpp, simplify interface
86 * 1 10/01/97 10:54a Lawrance
91 #ifndef __FREESPACE_CHATBOX_H__
92 #define __FREESPACE_CHATBOX_H__
97 #define CHATBOX_MAX_LEN 125 // max length of the actual text string
99 // chatbox flags for creation/switching between modes
100 #define CHATBOX_FLAG_SMALL (1<<0) // small chatbox
101 #define CHATBOX_FLAG_BIG (1<<1) // big chatbox
102 #define CHATBOX_FLAG_MULTI_PAUSED (1<<2) // chatbox in the multiplayer paused screen
103 #define CHATBOX_FLAG_DRAW_BOX (1<<3) // should be drawn by the chatbox code
104 #define CHATBOX_FLAG_BUTTONS (1<<4) // the chatbox should be drawing/checking its own buttons
105 // NOTE : CHATBOX_FLAG_BUTTONS requires that CHATBOX_FLAG_DRAW_BOX is also set!
107 // initialize all chatbox details with the given mode flags
108 int chatbox_create(int mode_flags = (CHATBOX_FLAG_SMALL | CHATBOX_FLAG_DRAW_BOX | CHATBOX_FLAG_BUTTONS));
110 // process this frame for the chatbox
111 int chatbox_process(int key_in=-1);
113 // shutdown all chatbox functionality
114 void chatbox_close();
116 // render the chatbox for this frame
117 void chatbox_render();
119 // try and scroll the chatbox up. return 0 or 1 on fail or success
120 int chatbox_scroll_up();
122 // try and scroll the chatbox down, return 0 or 1 on fail or success
123 int chatbox_scroll_down();
125 // clear the contents of the chatbox
126 void chatbox_clear();
128 // add a line of text (from the player identified by pid) to the chatbox
129 void chatbox_add_line(const char *msg, int pid, int add_id = 1);
131 // force the chatbox to go into small mode (if its in large mode) - will not wotk if in multi paused chatbox mode
132 void chatbox_force_small();
134 // force the chatbox to go into big mode (if its in small mode) - will not work if in multi paused chatbox mode
135 void chatbox_force_big();
137 // "lose" the focus on the chatbox inputbox
138 void chatbox_lose_focus();
140 // return if the inputbox for the chatbox currently has focus
141 int chatbox_has_focus();
143 // grab the focus for the chatbox inputbox
144 void chatbox_set_focus();
146 // return if the inputbox was pressed - "clicked on"
147 int chatbox_pressed();
149 // reset all timestamps associated with the chatbox
150 void chatbox_reset_timestamps();