]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
play a different sound (sound/misc/talk2.wav) for team chat messages (only if the...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Mar 2007 13:08:52 +0000 (13:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Mar 2007 13:08:52 +0000 (13:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6993 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
client.h
console.c
host_cmd.c

index 986defbdb2dd5423b9b46d6e2c917551351fcf37..766546278bebf64ca3c0ec828895db2f187bf813 100644 (file)
@@ -505,6 +505,8 @@ static void QW_CL_RequestNextDownload(void)
                CL_Locs_Reload_f();
                R_Modules_NewMap();
 
+               cl.foundtalk2wav = FS_FileExists("sound/misc/talk2.wav");
+
                // add pmodel/emodel CRCs to userinfo
                CL_SetInfo("pmodel", va("%i", FS_CRCFile("progs/player.mdl", NULL)), true, true, true, true);
                CL_SetInfo("emodel", va("%i", FS_CRCFile("progs/eyes.mdl", NULL)), true, true, true, true);
@@ -949,6 +951,7 @@ void CL_BeginDownloads(qboolean aborteddownload)
                                CL_UpdateRenderEntity(&cl.entities[0].render);
                                CL_Locs_Reload_f();
                                R_Modules_NewMap();
+                               cl.foundtalk2wav = FS_FileExists("sound/misc/talk2.wav");
                                // check memory integrity
                                Mem_CheckSentinelsGlobal();
                                if (!cl.loadfinished && cl_joinbeforedownloadsfinish.integer)
@@ -999,6 +1002,7 @@ void CL_BeginDownloads(qboolean aborteddownload)
                                        CL_UpdateRenderEntity(&cl.entities[0].render);
                                        CL_Locs_Reload_f();
                                        R_Modules_NewMap();
+                                       cl.foundtalk2wav = FS_FileExists("sound/misc/talk2.wav");
                                        // check memory integrity
                                        Mem_CheckSentinelsGlobal();
                                        if (!cl.loadfinished && cl_joinbeforedownloadsfinish.integer)
@@ -1038,6 +1042,7 @@ void CL_BeginDownloads(qboolean aborteddownload)
                                CL_UpdateRenderEntity(&cl.entities[0].render);
                                CL_Locs_Reload_f();
                                R_Modules_NewMap();
+                               cl.foundtalk2wav = FS_FileExists("sound/misc/talk2.wav");
                                // check memory integrity
                                Mem_CheckSentinelsGlobal();
                                if (!cl.loadfinished && cl_joinbeforedownloadsfinish.integer)
@@ -3199,7 +3204,7 @@ void CL_ParseServerMessage(void)
                                                {
                                                        model_t *model = Mod_ForName(s, false, false, i == 1);
                                                        if (!model)
-                                                               Con_Printf("svc_precache: Mod_ForName(\"%s\") failed\n", s);
+                                                               Con_DPrintf("svc_precache: Mod_ForName(\"%s\") failed\n", s);
                                                        cl.model_precache[i] = model;
                                                }
                                                else
@@ -3212,7 +3217,7 @@ void CL_ParseServerMessage(void)
                                                {
                                                        sfx_t *sfx = S_PrecacheSound (s, true, false);
                                                        if (!sfx && snd_initialized.integer)
-                                                               Con_Printf("svc_precache: S_PrecacheSound(\"%s\") failed\n", s);
+                                                               Con_DPrintf("svc_precache: S_PrecacheSound(\"%s\") failed\n", s);
                                                        cl.sound_precache[i] = sfx;
                                                }
                                                else
index 7141da00b5495060ad771e147494e5b84f8135a1..de267c06c5ffa165d19a245c7fc14ed76243cc43 100644 (file)
--- a/client.h
+++ b/client.h
@@ -823,6 +823,8 @@ typedef struct client_state_s
        sfx_t *sfx_ric2;
        sfx_t *sfx_ric3;
        sfx_t *sfx_r_exp3;
+       // indicates that the file "sound/misc/talk2.wav" was found (for use by team chat messages)
+       qboolean foundtalk2wav;
 
 // refresh related state
 
index 1581aab2823031ed42007eb8219b4baf6ba9c090..97f6526b8dd6582427c372124cd5f464f84625f5 100644 (file)
--- a/console.c
+++ b/console.c
@@ -636,7 +636,12 @@ void Con_Print(const char *msg)
                        {
                                // play talk wav
                                if (*msg == 1)
-                                       S_LocalSound ("sound/misc/talk.wav");
+                               {
+                                       if (msg[1] == '(' && cl.foundtalk2wav)
+                                               S_LocalSound ("sound/misc/talk2.wav");
+                                       else
+                                               S_LocalSound ("sound/misc/talk.wav");
+                               }
                                line[index++] = STRING_COLOR_TAG;
                                line[index++] = '3';
                                msg++;
index 4dcc0e5d8a7363d0e80f09c7aa5a03d320b5ba3c..5c4dfa59128842115e13d7d8aedee2da32d302c2 100644 (file)
@@ -944,8 +944,10 @@ void Host_Say(qboolean teamonly)
                p1++;
        }
        // note this uses the chat prefix \001
-       if (!fromServer)
+       if (!fromServer && !teamonly)
                dpsnprintf (text, sizeof(text), "\001%s" STRING_COLOR_DEFAULT_STR ": %s", host_client->name, p1);
+       else if (!fromServer && teamonly)
+               dpsnprintf (text, sizeof(text), "\001(%s" STRING_COLOR_DEFAULT_STR "): %s", host_client->name, p1);
        else if(*(sv_adminnick.string))
                dpsnprintf (text, sizeof(text), "\001<%s" STRING_COLOR_DEFAULT_STR "> %s", sv_adminnick.string, p1);
        else