I found some remains of a team chat message draw thing.
part of the code got removed with the purge of MISSIONPACK stuff.
already existing code:
{ &cg_teamChatTime, "cg_teamChatTime", "3000", CVAR_ARCHIVE },
{ &cg_teamChatHeight, "cg_teamChatHeight", "0", CVAR_ARCHIVE },
before testing make sure you set cg_teamChatHeight to a positive non zero value, like 20
some sloppy porting from the ioquake3 svn:
src\cgame\cg_draw.c
/*
=================
CG_DrawTeamInfo
=================
*/
static void CG_DrawTeamInfo( void ) {
int w, h;
int i, len;
vec4_t hcolor;
int chatHeight;
#define CHATLOC_Y 420 // bottom end
#define CHATLOC_X 0
if (cg_teamChatHeight.integer < TEAMCHAT_HEIGHT)
chatHeight = cg_teamChatHeight.integer;
else
chatHeight = TEAMCHAT_HEIGHT;
if (chatHeight <= 0)
return; // disabled
if (cgs.teamLastChatPos != cgs.teamChatPos) {
if (cg.time - cgs.teamChatMsgTimes[cgs.teamLastChatPos % chatHeight] > cg_teamChatTime.integer) {
cgs.teamLastChatPos++;
}
h = (cgs.teamChatPos - cgs.teamLastChatPos) * TINYCHAR_HEIGHT;
w = 0;
for (i = cgs.teamLastChatPos; i < cgs.teamChatPos; i++) {
len = CG_DrawStrlen(cgs.teamChatMsgs[i % chatHeight]);
if (len > w)
w = len;
}
w *= TINYCHAR_WIDTH;
w += TINYCHAR_WIDTH * 2;
//if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED ) {
if ( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) {
hcolor[0] = 1.0f;
hcolor[1] = 0.0f;
hcolor[2] = 0.0f;
hcolor[3] = 0.33f;
//} else if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) {
} else if ( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) {
hcolor[0] = 0.0f;
hcolor[1] = 0.0f;
hcolor[2] = 1.0f;
hcolor[3] = 0.33f;
} else {
hcolor[0] = 0.0f;
hcolor[1] = 1.0f;
hcolor[2] = 0.0f;
hcolor[3] = 0.33f;
}
trap_R_SetColor( hcolor );
//CG_DrawPic( CHATLOC_X, CHATLOC_Y - h, 640, h, cgs.media.teamStatusBar );
trap_R_SetColor( NULL );
hcolor[0] = hcolor[1] = hcolor[2] = 1.0f;
hcolor[3] = 1.0f;
//void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
//qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars ) {
//void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) {
for (i = cgs.teamChatPos - 1; i >= cgs.teamLastChatPos; i--) {
/*
CG_DrawStringExt( CHATLOC_X + TINYCHAR_WIDTH,
CHATLOC_Y - (cgs.teamChatPos - i)*TINYCHAR_HEIGHT,
cgs.teamChatMsgs[i % chatHeight], hcolor, qfalse, qfalse,
TINYCHAR_WIDTH, TINYCHAR_HEIGHT, 0 );
*/
CG_Text_Paint( CHATLOC_X + TINYCHAR_WIDTH, CHATLOC_Y - (cgs.teamChatPos - i)*TINYCHAR_HEIGHT, 0.5, hcolor, cgs.teamChatMsgs[i % chatHeight], 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE );
}
}
}
add
CG_DrawTeamInfo();
before
CG_DrawVote( );
in fuction
static void CG_Draw2D( void )
i tested it, looks a little messy, needs tweaking, this thing will show team messages (result of messagemode2) near the bottom of the screen, left side.
also see, "CG_AddToTeamChat" and the place its called, and CG_Obituary for death message