Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Chatbox.cpp File Reference

#include "ui.h"
#include "mouse.h"
#include "Freespace.h"
#include "Chatbox.h"
#include "MissionScreenCommon.h"
#include "MultiMsgs.h"
#include "GameSnd.h"
#include "BmpMan.h"
#include "cmdline.h"
#include "key.h"
#include "multi.h"
#include "multiui.h"
#include "multi_pmsg.h"
#include "AlphaColors.h"

Defines

#define CHATBOX_TEAM_ICON_SPACE   18
#define CHAT_LINE_INDENT   20
#define CHATBOX_INVALID_CHARS   NOX("~`")
#define CHATBOX_STRING_LEN   (CALLSIGN_LEN + CHATBOX_MAX_LEN + 32)
#define CHATBOX_NUM_BUTTONS   3
#define CHATBOX_SCROLL_UP   0
#define CHATBOX_SCROLL_DOWN   1
#define CHATBOX_TOGGLE_SIZE   2
#define CHATBOX_X_COORD   0
#define CHATBOX_Y_COORD   1
#define CHATBOX_W_COORD   2
#define CHATBOX_H_COORD   3
#define MAX_BRIEF_CHAT_LINES   60
#define BRIEF_DISPLAY_SPACING   2
#define CHATBOX_MAX_RECALL_LINES   10

Functions

void chatbox_chat_init ()
void chatbox_render_chat_lines ()
void chatbox_set_mode (int mode_flags)
void chatbox_toggle_size ()
void chatbox_toggle_size_adjust_lines ()
void chat_autosplit_line (char *msg, char *remainder)
int chatbox_num_displayed_lines ()
void chatbox_recall_add (char *string)
void chatbox_recall_up ()
void chatbox_recall_down ()
void chatbox_autosplit_line ()
int chatbox_create (int mode_flags)
int chatbox_process (int key_in)
void chatbox_close ()
void chatbox_clear ()
void chatbox_render ()
int chatbox_scroll_up ()
int chatbox_scroll_down ()
void chatbox_add_line (char *msg, int pid, int add_id)
void chatbox_force_small ()
void chatbox_force_big ()
void chatbox_lose_focus ()
int chatbox_has_focus ()
void chatbox_set_focus ()
int chatbox_pressed ()
void chatbox_reset_timestamps ()

Variables

char * Chatbox_small_bitmap_fname [GR_NUM_RESOLUTIONS]
char * Chatbox_small_bitmap_mask_fname [GR_NUM_RESOLUTIONS]
int Chatbox_small_coords [GR_NUM_RESOLUTIONS][2]
int Chatbox_small_display_coords [GR_NUM_RESOLUTIONS][4]
int Chatbox_small_input_coords [GR_NUM_RESOLUTIONS][4]
int Chatbox_small_max_lines [GR_NUM_RESOLUTIONS]
char * Chatbox_big_bitmap_fname [GR_NUM_RESOLUTIONS]
char * Chatbox_big_bitmap_mask_fname [GR_NUM_RESOLUTIONS]
int Chatbox_big_coords [GR_NUM_RESOLUTIONS][2]
int Chatbox_big_display_coords [GR_NUM_RESOLUTIONS][4]
int Chatbox_big_input_coords [GR_NUM_RESOLUTIONS][4]
int Chatbox_big_max_lines [GR_NUM_RESOLUTIONS]
char * Chatbox_p_bitmap_fname [GR_NUM_RESOLUTIONS]
char * Chatbox_p_bitmap_mask_fname [GR_NUM_RESOLUTIONS]
int Chatbox_p_coords [GR_NUM_RESOLUTIONS][2]
int Chatbox_p_display_coords [GR_NUM_RESOLUTIONS][4]
int Chatbox_p_input_coords [GR_NUM_RESOLUTIONS][4]
int Chatbox_p_max_lines [GR_NUM_RESOLUTIONS]
char Chatbox_mask [50]
int Chatbox_x1
int Chatbox_y1
int Chatbox_icon_x
int Chatbox_w
int Chatbox_h
int Chatbox_begin_x
int Chatbox_begin_y
int Chatbox_disp_w
int Chatbox_max_lines
int Chatbox_inputbox_x
int Chatbox_inputbox_w
int Chatbox_textenter_y
int Chat_scroll_up_coord [2]
int Chat_scroll_down_coord [2]
UI_WINDOW Chat_window
UI_INPUTBOX Chat_inputbox
UI_BUTTON Chat_enter_text
ui_button_info Chatbox_buttons [GR_NUM_RESOLUTIONS][CHATBOX_NUM_BUTTONS+1]
int Chatbox_mode_flags = 0
int Chatbox_bitmap = -1
int Chatbox_big_bitmap = -1
int Chatbox_small_bitmap = -1
int Chatbox_mp_bitmap = -1
int Chatbox_created = 0
char Brief_chat_lines [MAX_BRIEF_CHAT_LINES][CHATBOX_STRING_LEN]
int Brief_chat_indents [MAX_BRIEF_CHAT_LINES]
int Brief_chat_next_index [MAX_BRIEF_CHAT_LINES]
int Brief_chat_prev_index [MAX_BRIEF_CHAT_LINES]
int Num_brief_chat_lines
int Brief_current_add_line
int Brief_start_display_index
int Chatbox_recall_count = 0
int Chatbox_recall_index = 0
int Chatbox_recall_last = -1
char Chatbox_recall_lines [CHATBOX_MAX_RECALL_LINES][CHATBOX_MAX_LEN+2]

Define Documentation

#define BRIEF_DISPLAY_SPACING   2
 

#define CHAT_LINE_INDENT   20
 

#define CHATBOX_H_COORD   3
 

#define CHATBOX_INVALID_CHARS   NOX("~`")
 

#define CHATBOX_MAX_RECALL_LINES   10
 

#define CHATBOX_NUM_BUTTONS   3
 

#define CHATBOX_SCROLL_DOWN   1
 

#define CHATBOX_SCROLL_UP   0
 

#define CHATBOX_STRING_LEN   (CALLSIGN_LEN + CHATBOX_MAX_LEN + 32)
 

#define CHATBOX_TEAM_ICON_SPACE   18
 

#define CHATBOX_TOGGLE_SIZE   2
 

#define CHATBOX_W_COORD   2
 

#define CHATBOX_X_COORD   0
 

#define CHATBOX_Y_COORD   1
 

#define MAX_BRIEF_CHAT_LINES   60
 


Function Documentation

void chat_autosplit_line char *    msg,
char *    remainder
 

void chatbox_add_line char *    msg,
int    pid,
int    add_id
 

void chatbox_autosplit_line  
 

void chatbox_chat_init  
 

void chatbox_clear  
 

void chatbox_close  
 

int chatbox_create int    mode_flags
 

void chatbox_force_big  
 

void chatbox_force_small  
 

int chatbox_has_focus  
 

void chatbox_lose_focus  
 

int chatbox_num_displayed_lines  
 

int chatbox_pressed  
 

int chatbox_process int    key_in
 

void chatbox_recall_add char *    string
 

void chatbox_recall_down  
 

void chatbox_recall_up  
 

void chatbox_render  
 

void chatbox_render_chat_lines  
 

void chatbox_reset_timestamps  
 

int chatbox_scroll_down  
 

int chatbox_scroll_up  
 

void chatbox_set_focus  
 

void chatbox_set_mode int    mode_flags
 

void chatbox_toggle_size  
 

void chatbox_toggle_size_adjust_lines  
 


Variable Documentation

int Brief_chat_indents[MAX_BRIEF_CHAT_LINES]
 

char Brief_chat_lines[MAX_BRIEF_CHAT_LINES][CHATBOX_STRING_LEN]
 

int Brief_chat_next_index[MAX_BRIEF_CHAT_LINES]
 

int Brief_chat_prev_index[MAX_BRIEF_CHAT_LINES]
 

int Brief_current_add_line
 

int Brief_start_display_index
 

UI_BUTTON Chat_enter_text
 

UI_INPUTBOX Chat_inputbox
 

int Chat_scroll_down_coord[2]
 

int Chat_scroll_up_coord[2]
 

UI_WINDOW Chat_window
 

int Chatbox_begin_x
 

int Chatbox_begin_y
 

int Chatbox_big_bitmap = -1
 

char* Chatbox_big_bitmap_fname[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        "ChatboxBig",           
        "2_ChatboxBig"          
}

char* Chatbox_big_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        "Chatbox-m",            
        "2_Chatbox-m"                   
}

int Chatbox_big_coords[GR_NUM_RESOLUTIONS][2]
 

Initial value:

 {
        { 
                192, 0
        },
        { 
                307, 0
        }
}

int Chatbox_big_display_coords[GR_NUM_RESOLUTIONS][4]
 

Initial value:

int Chatbox_big_input_coords[GR_NUM_RESOLUTIONS][4]
 

Initial value:

 {
        {       
                204, 352, 371, 22
        },
        {       
                328, 565, 591, 34
        }
}

int Chatbox_big_max_lines[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        32,                     
        51                              
}

int Chatbox_bitmap = -1
 

ui_button_info Chatbox_buttons[GR_NUM_RESOLUTIONS][CHATBOX_NUM_BUTTONS+1]
 

Initial value:

 {
        { 
                ui_button_info("CHB_00",        613,    3,              -1,     -1,     0),
                ui_button_info("CHB_01",        613,    41,     -1,     -1,     1),
                ui_button_info("CHB_02a",       607,    74,     -1,     -1,     2),
                ui_button_info("CHB_02b",       607,    74,     -1,     -1,     2),
        },      
        { 
                ui_button_info("2_CHB_00",              981,    5,              -1,     -1,     0),
                ui_button_info("2_CHB_01",              981,    67,     -1,     -1,     1),
                ui_button_info("2_CHB_02a",     971,    119,    -1,     -1,     2),
                ui_button_info("2_CHB_02b",     971,    119,    -1,     -1,     2),
        }
}

int Chatbox_created = 0
 

int Chatbox_disp_w
 

int Chatbox_h
 

int Chatbox_icon_x
 

int Chatbox_inputbox_w
 

int Chatbox_inputbox_x
 

char Chatbox_mask[50]
 

int Chatbox_max_lines
 

int Chatbox_mode_flags = 0
 

int Chatbox_mp_bitmap = -1
 

char* Chatbox_p_bitmap_fname[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        "MPPause",                      
        "2_MPPause"                     
}

char* Chatbox_p_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        "MPPause-m",            
        "2_MPPause-m"           
}

int Chatbox_p_coords[GR_NUM_RESOLUTIONS][2]
 

Initial value:

 {
        { 
                192, 0
        },
        { 
                307, 0
        }
}

int Chatbox_p_display_coords[GR_NUM_RESOLUTIONS][4]
 

Initial value:

 {
        {       
                103 + CHATBOX_TEAM_ICON_SPACE, 149, 380 - CHATBOX_TEAM_ICON_SPACE, 143
        },
        {       
                165 + CHATBOX_TEAM_ICON_SPACE, 244, 654 - CHATBOX_TEAM_ICON_SPACE, 263
        }
}

int Chatbox_p_input_coords[GR_NUM_RESOLUTIONS][4]
 

Initial value:

 {
        {       
                106, 328, 379, 17
        },
        {       
                165, 525, 607, 27
        }
}

int Chatbox_p_max_lines[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        17,                     
        26                              
}

int Chatbox_recall_count = 0
 

int Chatbox_recall_index = 0
 

int Chatbox_recall_last = -1
 

char Chatbox_recall_lines[CHATBOX_MAX_RECALL_LINES][CHATBOX_MAX_LEN+2]
 

int Chatbox_small_bitmap = -1
 

char* Chatbox_small_bitmap_fname[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        "Chatbox",              
        "2_Chatbox"             
}

char* Chatbox_small_bitmap_mask_fname[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        "Chatbox-m",    
        "2_Chatbox-m"   
}

int Chatbox_small_coords[GR_NUM_RESOLUTIONS][2]
 

Initial value:

 {
        { 
                192, 0
        },
        { 
                308, 0                   
        }
}

int Chatbox_small_display_coords[GR_NUM_RESOLUTIONS][4]
 

Initial value:

int Chatbox_small_input_coords[GR_NUM_RESOLUTIONS][4]
 

Initial value:

 {
        {       
                204, 100, 371, 22
        },
        {       
                328, 163, 591, 34
        }
}

int Chatbox_small_max_lines[GR_NUM_RESOLUTIONS]
 

Initial value:

 {
        7,                              
        12                              
}

int Chatbox_textenter_y
 

int Chatbox_w
 

int Chatbox_x1
 

int Chatbox_y1
 

int Num_brief_chat_lines
 


Generated on Mon Jul 8 11:29:04 2002 for fs2source_released by doxygen1.2.16