34 #define CHATBOX_TEAM_ICON_SPACE 18
228 #define CHAT_LINE_INDENT 20
231 #define CHATBOX_INVALID_CHARS NOX("~`") // this is primarily so that we don't interfere with the voice recording keys
234 #define CHATBOX_STRING_LEN (CALLSIGN_LEN + CHATBOX_MAX_LEN + 32)
240 #define CHATBOX_NUM_BUTTONS 3
241 #define CHATBOX_SCROLL_UP 0
242 #define CHATBOX_SCROLL_DOWN 1
243 #define CHATBOX_TOGGLE_SIZE 2 // used for both big and small
246 #define CHATBOX_X_COORD 0
247 #define CHATBOX_Y_COORD 1
248 #define CHATBOX_W_COORD 2
249 #define CHATBOX_H_COORD 3
278 #define MAX_BRIEF_CHAT_LINES 60 // how many lines we can store in the scrollback buffer
279 #define BRIEF_DISPLAY_SPACING 2 // pixel spacing between chat lines
292 #define CHATBOX_MAX_RECALL_LINES 10
403 if ((msg[0] !=
'/') && (strchr(msg,
':') != NULL) ) {
408 return strcspn(msg,
":") + 1 ;
418 int target, target_length = -1;
435 remainder = strrchr(msg,
' ');
450 strncpy(temp, msg+1, target_length-2);
451 temp[target_length-2] =
'\0';
458 strncpy(temp, msg, target_length);
459 temp[target_length] =
' ';
460 temp[target_length+1] =
'\0';
482 strncpy(temp, msg+1, target_length-2);
483 temp[target_length-2] =
'\0';
566 Chat_enter_text.
create( &Chat_window,
"", 0, 0, 60, 30, 0);
567 Chat_enter_text.
hide();
588 key_out = Chat_window.
process();
590 key_out = Chat_window.
process(key_in);
624 if ( Chat_enter_text.
pressed() ) {
766 for(idx=MAX_BRIEF_CHAT_LINES-1; idx > 0 ; idx--){
784 const char *p_str[3];
841 for(idx=0;idx<n_lines;idx++){
890 int started_at,player_num,
count,ly,line_height;
980 while(count_diff > 0){
996 while(count_diff > 0){
1107 return Chat_inputbox.
pressed();
void set_text(const char *in)
void set_highlight_action(void(*_user_function)(void))
#define MY_NET_PLAYER_NUM
#define UI_INPUTBOX_FLAG_EAT_USED
int chatbox_create(int mode_flags)
#define CHATBOX_SCROLL_DOWN
#define MULTI_MSG_FRIENDLY
#define CHATBOX_MAX_RECALL_LINES
#define CHATBOX_SCROLL_UP
INT64 INT64 INT64 remainder
#define CHATBOX_TEAM_ICON_SPACE
CFILE * Multi_chat_stream
#define MULTI_STANDALONE(np)
#define CHATBOX_NUM_BUTTONS
int Chatbox_small_coords[GR_NUM_RESOLUTIONS][2]
#define GR_NUM_RESOLUTIONS
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
int Chatbox_p_input_coords[GR_NUM_RESOLUTIONS][4]
void chatbox_toggle_size_adjust_lines()
#define MAX_BRIEF_CHAT_LINES
int chatbox_scroll_down()
int Chat_scroll_up_coord[2]
void gr_set_color_fast(color *dst)
int chatbox_num_displayed_lines()
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
#define CHATBOX_FLAG_BUTTONS
int chatbox_get_msg_target_length(char *msg)
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
char Brief_chat_lines[MAX_BRIEF_CHAT_LINES][CHATBOX_STRING_LEN]
int Brief_chat_prev_index[MAX_BRIEF_CHAT_LINES]
void chatbox_recall_add(char *string)
int chatbox_get_msg_target_type(char *msg)
int cfwrite_char(char b, CFILE *file)
void set_mask_bmap(char *fname)
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
void chatbox_reset_timestamps()
#define CHATBOX_FLAG_SMALL
void send_game_chat_packet(net_player *from, const char *msg, int msg_mode, net_player *to, const char *expr, int server_msg)
int Chat_scroll_down_coord[2]
#define strnicmp(s1, s2, n)
int cfwrite_string(const char *buf, CFILE *file)
void chatbox_force_small()
void chatbox_set_mode(int mode_flags)
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
int Brief_chat_next_index[MAX_BRIEF_CHAT_LINES]
UI_INPUTBOX Chat_inputbox
#define CHATBOX_STRING_LEN
int Chatbox_small_display_coords[GR_NUM_RESOLUTIONS][4]
int Brief_start_display_index
char * Chatbox_p_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
#define NETINFO_FLAG_TEAM_CAPTAIN
int Brief_chat_indents[MAX_BRIEF_CHAT_LINES]
int split_str(const char *src, int max_pixel_w, int *n_chars, const char **p_str, int max_lines, char ignore_char)
void chatbox_toggle_size()
color * Color_netplayer[NETPLAYER_COLORS]
GLint GLint GLint GLint GLint x
void chatbox_lose_focus()
int Chatbox_small_max_lines[GR_NUM_RESOLUTIONS]
#define MULTI_MSG_HOSTILE
int Chatbox_big_max_lines[GR_NUM_RESOLUTIONS]
ui_button_info Chatbox_buttons[GR_NUM_RESOLUTIONS][CHATBOX_NUM_BUTTONS+1]
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
void update_dimensions(int _x, int _y, int _w, int _h)
void link_hotspot(int num)
int Chatbox_big_coords[GR_NUM_RESOLUTIONS][2]
int Chatbox_p_coords[GR_NUM_RESOLUTIONS][2]
#define CHATBOX_FLAG_DRAW_BOX
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
char Chatbox_recall_lines[CHATBOX_MAX_RECALL_LINES][CHATBOX_MAX_LEN+2]
int Chatbox_p_max_lines[GR_NUM_RESOLUTIONS]
void chatbox_autosplit_line()
void set_invalid_chars(char *ichars)
char * Chatbox_small_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
int Brief_current_add_line
char * Chatbox_p_bitmap_fname[GR_NUM_RESOLUTIONS]
void common_play_highlight_sound()
int Chatbox_big_display_coords[GR_NUM_RESOLUTIONS][4]
#define MICON_TEAM0_SELECT
void create(UI_WINDOW *wnd, int _x, int _y, int _w, int _textlen, char *_text, int _flags=0, int pixel_lim=-1, color *clr=NULL)
#define UI_INPUTBOX_FLAG_INVIS
int chatbox_process(int key_in)
void chat_autosplit_line(char *msg, char *remainder)
#define MICON_TEAM1_SELECT
void gr_bitmap(int _x, int _y, int resize_mode)
int Chatbox_big_input_coords[GR_NUM_RESOLUTIONS][4]
char * Chatbox_big_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
void chatbox_recall_down()
char * Chatbox_small_bitmap_fname[GR_NUM_RESOLUTIONS]
void gamesnd_play_iface(int n)
struct ui_button_info ui_button_info
int Chatbox_small_input_coords[GR_NUM_RESOLUTIONS][4]
int process(int key_in=-1, int process_mouse=1)
int Multi_common_icons[MULTI_NUM_COMMON_ICONS]
void chatbox_add_line(const char *msg, int pid, int add_id)
net_player Net_players[MAX_PLAYERS]
int Cmdline_multi_stream_chat_to_file
#define UI_INPUTBOX_FLAG_KEYTHRU
#define CHATBOX_INVALID_CHARS
UI_BUTTON Chat_enter_text
#define UI_INPUTBOX_FLAG_ESC_CLR
#define CHATBOX_TOGGLE_SIZE
void chatbox_render_chat_lines()
int Chatbox_p_display_coords[GR_NUM_RESOLUTIONS][4]
char * Chatbox_big_bitmap_fname[GR_NUM_RESOLUTIONS]