diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 6a7bd94c8..9536c1af4 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -116,6 +116,7 @@ cvar_t cl_item_bobbing = {"cl_model_bobbing", "0"}; cvar_t requiredownloads = {"requiredownloads","1", NULL, CVAR_ARCHIVE}; cvar_t cl_standardchat = {"cl_standardchat", "0"}; +cvar_t cl_parsewhitetext = {"cl_parsewhitetext", "0"}; cvar_t host_mapname = {"host_mapname", ""}; @@ -2411,6 +2412,7 @@ void CL_Init (void) Cvar_Register (&requiredownloads, cl_controlgroup); Cvar_Register (&cl_standardchat, cl_controlgroup); + Cvar_Register (&cl_parsewhitetext, cl_controlgroup); Cvar_Register (&cl_nopext, cl_controlgroup); Cvar_Register (&cl_splitscreen, cl_controlgroup); diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index ca5a4d1b0..9c9b2b38e 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -26,7 +26,7 @@ void CLNQ_ParseDarkPlaces5Entities(void); void CL_SetStat (int pnum, int stat, int value); int nq_dp_protocol; - +int msgflags; char *svc_strings[] = @@ -2967,103 +2967,91 @@ void CLQ2_ParseInventory (void) { int i; + // TODO: finish this properly for (i=0 ; ibottomcolor) + { //translate q1 skin colours to console colours + case 10: + case 1: + name_ormask = CON_STANDARDMASK; + case 4: //red + c = 1; + break; + case 11: + name_ormask = CON_STANDARDMASK; + case 3: // green + c = 2; + break; + case 5: + name_ormask = CON_STANDARDMASK; + case 12: + c = 3; + break; + case 6: + case 7: + name_ormask = CON_STANDARDMASK; + case 8: + case 9: + c = 5; + break; + case 2: // light blue + name_ormask = CON_STANDARDMASK; + case 13: //blue + case 14: //blue + c = 6; + break; + default: + name_ormask = CON_STANDARDMASK; + case 0: // white + c = 7; + break; + } + } + else + { + //primary override. + t = Info_ValueForKey(plr->userinfo, "tc"); + if (*t) + c = atoi(t); + else + c = plr->userid - 1; + + if ((c / 7) & 1) + name_ormask = CON_STANDARDMASK; + + c = 1 + (c % 7); + } + + c = '0' + c; + + if (memessage) + { + con_ormask = CON_STANDARDMASK; + if (!cl_standardchat.value && observer) + Con_Printf ("^0*^7 "); + else + Con_Printf ("* "); + } + + if (team) // for team chat don't highlight the name, just the brackets + { + // color is reset every printf so we're safe here + con_ormask = name_ormask; + Con_Printf("^%c(", c); + con_ormask = CON_STANDARDMASK; + Con_Printf("%s", plr->name); + con_ormask = name_ormask; + Con_Printf("^%c)", c); + } + else + { + con_ormask = name_ormask; + Con_Printf("^%c%s", c, plr->name); + } + + if (!memessage) + { + // only print seperator with an actual player name + con_ormask = CON_STANDARDMASK; + if (!cl_standardchat.value && observer) + Con_Printf ("^0:^7 "); + else + Con_Printf (": "); + } + else + Con_Printf (" "); + } + + // print message + con_ormask = CON_STANDARDMASK; + if (cl_parsewhitetext.value && team && plr) + { + char *u; + + while (t = strchr(msg, '{')) + { + u = strchr(msg, '}'); + if (u) + { + *t = 0; + *u = 0; + Con_Printf("%s", msg); + con_ormask = 0; + Con_Printf("%s", t+1); + con_ormask = CON_STANDARDMASK; + msg = u+1; + } + else + break; + } + Con_Printf("%s", msg); + con_ormask = 0; + } + else + { + Con_Printf ("%s", msg); + } + con_ormask = 0; + +} + char stufftext[4096]; void CL_ParseStuffCmd(char *msg, int destsplit) //this protects stuffcmds from network segregation. { @@ -3114,64 +3265,6 @@ void CL_ParseStuffCmd(char *msg, int destsplit) //this protects stuffcmds from n } } -int getplayerid(char *msg) -{ - int i; - int namelen; - char *colon = strstr(msg, ":"); - if (!colon) - return -1; - - namelen = colon-msg; - - for (i=0 ; iteam)) ) flags |= 2; + *offset = len + 4; + *plr = player; + } + } + + if (!flags) + { + if (name = strstr(s, ": ")) // use name as temp + { + *offset = (name - s) + 2; + flags = 16; } } @@ -3212,22 +3228,8 @@ void CL_Say (qboolean team, char *extra) } *d = '\0'; + CL_PrintChat(&cl.players[cl.playernum[SP]], text, team, false); - if (!cl_standardchat.value) - colouration = CL_PlayerChatColour(cl.playernum[SP])%6+'1'; //don't ever print it in white. - else - { - con_ormask = CON_STANDARDMASK; - colouration = '7'; - } - - if (team) - Con_Printf("^%c(%s): %s\n", colouration, cl.players[cl.playernum[SP]].name, text); - else - Con_Printf("^%c%s: %s\n", colouration, cl.players[cl.playernum[SP]].name, text); - - con_ormask = 0; - //strip out the extra markup for (s = sendtext, d = sendtext; *s; s++, d++) { diff --git a/engine/common/translate.c b/engine/common/translate.c index 40e6876d7..85a357a3d 100644 --- a/engine/common/translate.c +++ b/engine/common/translate.c @@ -266,7 +266,6 @@ static char *defaultlanguagetext = "TL_FILE_X_MISSING \"\\nThe required model file '%s' could not be found or downloaded.\\n\\n\"\n" "TL_GETACLIENTPACK \"You may need to download or purchase a %s client or map pack in order to play on this server.\\n\\n\"\n" "TLC_LINEBREAK_MINUS \"------------------\\n\"\n" -"TL_CSPECIALPRINT \"^%c%s\"\n" "TL_INT_SPACE \"%i \"\n" ; diff --git a/engine/common/translate.h b/engine/common/translate.h index a93f28d76..64b41891f 100644 --- a/engine/common/translate.h +++ b/engine/common/translate.h @@ -310,7 +310,6 @@ NAME(TL_FILE_X_MISSING) NAME(TL_GETACLIENTPACK) NAME(TLC_LINEBREAK_MINUS) - NAME(TL_CSPECIALPRINT) NAME(TL_INT_SPACE) #else diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 702893469..6f0461c49 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -2456,6 +2456,7 @@ void SV_Vote_f (void) VoteRemoveCommands(command, -1); Cbuf_AddText(command, votelevel.value); + Cbuf_AddText("\n", votelevel.value); //Cmd_ExecuteString (command, votelevel.value); return; } diff --git a/engine/server/svq2_game.c b/engine/server/svq2_game.c index ab77c4bce..1e34256bc 100644 --- a/engine/server/svq2_game.c +++ b/engine/server/svq2_game.c @@ -413,6 +413,7 @@ qboolean VARGS PFQ2_AreasConnected(int area1, int area2) #define Q2CHAN_VOICE 2 #define Q2CHAN_ITEM 3 #define Q2CHAN_BODY 4*/ +#define Q2CHAN_NO_PHS_ADD 8 #define Q2CHAN_RELIABLE 16 void VARGS SVQ2_StartSound (vec3_t origin, q2edict_t *entity, int channel, @@ -440,11 +441,8 @@ void VARGS SVQ2_StartSound (vec3_t origin, q2edict_t *entity, int channel, ent = Q2NUM_FOR_EDICT(entity); - if (channel & 8) // no PHS flag - { + if (channel & Q2CHAN_NO_PHS_ADD) // no PHS flag use_phs = false; - channel &= 7; - } else use_phs = true;