diff --git a/reaction/cgame/cg_consolecmds.c b/reaction/cgame/cg_consolecmds.c index 0e47e7a7..25052bad 100644 --- a/reaction/cgame/cg_consolecmds.c +++ b/reaction/cgame/cg_consolecmds.c @@ -324,7 +324,7 @@ static void CG_spWin_f( void) { trap_Cvar_Set("cg_thirdPersonAngle", "0"); trap_Cvar_Set("cg_thirdPersonRange", "100"); CG_AddBufferedSound(cgs.media.winnerSound); - //trap_S_StartLocalSound(cgs.media.winnerSound, CHAN_ANNOUNCER); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound(cgs.media.winnerSound, CHAN_ANNOUNCER); CG_CenterPrint("YOU WIN!", SCREEN_HEIGHT * .30, 0); } @@ -335,7 +335,7 @@ static void CG_spLose_f( void) { trap_Cvar_Set("cg_thirdPersonAngle", "0"); trap_Cvar_Set("cg_thirdPersonRange", "100"); CG_AddBufferedSound(cgs.media.loserSound); - //trap_S_StartLocalSound(cgs.media.loserSound, CHAN_ANNOUNCER); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound(cgs.media.loserSound, CHAN_ANNOUNCER); CG_CenterPrint("YOU LOSE...", SCREEN_HEIGHT * .30, 0); } diff --git a/reaction/cgame/cg_draw.c b/reaction/cgame/cg_draw.c index d2931bc4..7884e700 100644 --- a/reaction/cgame/cg_draw.c +++ b/reaction/cgame/cg_draw.c @@ -2597,13 +2597,13 @@ static void CG_DrawWarmup( void ) { cg.warmupCount = sec; switch ( sec ) { case 0: - trap_S_StartLocalSound( cgs.media.count1Sound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.count1Sound, CHAN_ANNOUNCER ); break; case 1: - trap_S_StartLocalSound( cgs.media.count2Sound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.count2Sound, CHAN_ANNOUNCER ); break; case 2: - trap_S_StartLocalSound( cgs.media.count3Sound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.count3Sound, CHAN_ANNOUNCER ); break; default: break; diff --git a/reaction/cgame/cg_event.c b/reaction/cgame/cg_event.c index 5a5cc557..d21e7a7d 100644 --- a/reaction/cgame/cg_event.c +++ b/reaction/cgame/cg_event.c @@ -2057,13 +2057,13 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { CG_AddBufferedSound(cgs.media.blueScoredSound); break; case GTS_REDTEAM_TOOK_LEAD: - CG_AddBufferedSound(cgs.media.redLeadsSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.redLeadsSound); break; case GTS_BLUETEAM_TOOK_LEAD: - CG_AddBufferedSound(cgs.media.blueLeadsSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.blueLeadsSound); break; case GTS_TEAMS_ARE_TIED: - CG_AddBufferedSound( cgs.media.teamsTiedSound ); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound( cgs.media.teamsTiedSound ); break; #ifdef MISSIONPACK case GTS_KAMIKAZE: diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index c00b6f88..aa698949 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -1209,6 +1209,8 @@ extern vmCvar_t cg_RQ3_ssgColorB; extern vmCvar_t cg_RQ3_ssgColorA; //Elder: smoke puffs, sparks, etc. extern vmCvar_t cg_RQ3_impactEffects; +//Blaze: anouncer sounds +extern vmCvar_t cg_RQ3_anouncer; extern vmCvar_t cg_drawFriend; extern vmCvar_t cg_teamChatsOnly; diff --git a/reaction/cgame/cg_main.c b/reaction/cgame/cg_main.c index 319c1b02..32075429 100644 --- a/reaction/cgame/cg_main.c +++ b/reaction/cgame/cg_main.c @@ -153,6 +153,9 @@ vmCvar_t cg_RQ3_ssgColorB; vmCvar_t cg_RQ3_ssgColorA; //Elder: smoke puffs, sparks, etc. vmCvar_t cg_RQ3_impactEffects; +//Blaze: anouncer sounds +vmCvar_t cg_RQ3_anouncer; + vmCvar_t cg_drawFriend; vmCvar_t cg_teamChatsOnly; vmCvar_t cg_noVoiceChats; @@ -315,7 +318,8 @@ cvarTable_t cvarTable[] = { { &cg_RQ3_ssgColorG, "cg_RQ3_ssgColorG", "1.0", CVAR_ARCHIVE }, { &cg_RQ3_ssgColorB, "cg_RQ3_ssgColorB", "0.0", CVAR_ARCHIVE }, { &cg_RQ3_ssgColorA, "cg_RQ3_ssgColorA", "0.75", CVAR_ARCHIVE }, - { &cg_RQ3_impactEffects, "cg_RQ3_impactEffects", "1", CVAR_ARCHIVE } + { &cg_RQ3_impactEffects, "cg_RQ3_impactEffects", "1", CVAR_ARCHIVE }, + { &cg_RQ3_anouncer, "cg_RQ3_anouncer", "1", CVAR_ARCHIVE }, // { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE } }; diff --git a/reaction/cgame/cg_playerstate.c b/reaction/cgame/cg_playerstate.c index 51259eac..a6c82b61 100644 --- a/reaction/cgame/cg_playerstate.c +++ b/reaction/cgame/cg_playerstate.c @@ -355,17 +355,17 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) { health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8; #ifdef MISSIONPACK if (armor > 50 ) { - trap_S_StartLocalSound( cgs.media.hitSoundHighArmor, CHAN_LOCAL_SOUND ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.hitSoundHighArmor, CHAN_LOCAL_SOUND ); } else if (armor || health > 100) { - trap_S_StartLocalSound( cgs.media.hitSoundLowArmor, CHAN_LOCAL_SOUND ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.hitSoundLowArmor, CHAN_LOCAL_SOUND ); } else { - trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND ); } #else - trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND ); #endif } else if ( ps->persistant[PERS_HITS] < ops->persistant[PERS_HITS] ) { - trap_S_StartLocalSound( cgs.media.hitTeamSound, CHAN_LOCAL_SOUND ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.hitTeamSound, CHAN_LOCAL_SOUND ); } // health changes of more than -1 should make pain sounds @@ -445,15 +445,15 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) { if (ps->persistant[PERS_PLAYEREVENTS] != ops->persistant[PERS_PLAYEREVENTS]) { if ((ps->persistant[PERS_PLAYEREVENTS] & PLAYEREVENT_DENIEDREWARD) != (ops->persistant[PERS_PLAYEREVENTS] & PLAYEREVENT_DENIEDREWARD)) { - trap_S_StartLocalSound( cgs.media.deniedSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.deniedSound, CHAN_ANNOUNCER ); } else if ((ps->persistant[PERS_PLAYEREVENTS] & PLAYEREVENT_GAUNTLETREWARD) != (ops->persistant[PERS_PLAYEREVENTS] & PLAYEREVENT_GAUNTLETREWARD)) { - trap_S_StartLocalSound( cgs.media.humiliationSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.humiliationSound, CHAN_ANNOUNCER ); } else if ((ps->persistant[PERS_PLAYEREVENTS] & PLAYEREVENT_HOLYSHIT) != (ops->persistant[PERS_PLAYEREVENTS] & PLAYEREVENT_HOLYSHIT)) { - trap_S_StartLocalSound( cgs.media.holyShitSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.holyShitSound, CHAN_ANNOUNCER ); } reward = qtrue; } @@ -476,11 +476,11 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) { if ( ps->persistant[PERS_RANK] != ops->persistant[PERS_RANK] ) { if ( cgs.gametype < GT_TEAM) { if ( ps->persistant[PERS_RANK] == 0 ) { - CG_AddBufferedSound(cgs.media.takenLeadSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.takenLeadSound); } else if ( ps->persistant[PERS_RANK] == RANK_TIED_FLAG ) { - CG_AddBufferedSound(cgs.media.tiedLeadSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.tiedLeadSound); } else if ( ( ops->persistant[PERS_RANK] & ~RANK_TIED_FLAG ) == 0 ) { - CG_AddBufferedSound(cgs.media.lostLeadSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.lostLeadSound); } } } @@ -494,15 +494,15 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) { msec = cg.time - cgs.levelStartTime; if ( !( cg.timelimitWarnings & 4 ) && msec > ( cgs.timelimit * 60 + 2 ) * 1000 ) { cg.timelimitWarnings |= 1 | 2 | 4; - trap_S_StartLocalSound( cgs.media.suddenDeathSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.suddenDeathSound, CHAN_ANNOUNCER ); } else if ( !( cg.timelimitWarnings & 2 ) && msec > (cgs.timelimit - 1) * 60 * 1000 ) { cg.timelimitWarnings |= 1 | 2; - trap_S_StartLocalSound( cgs.media.oneMinuteSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.oneMinuteSound, CHAN_ANNOUNCER ); } else if ( cgs.timelimit > 5 && !( cg.timelimitWarnings & 1 ) && msec > (cgs.timelimit - 5) * 60 * 1000 ) { cg.timelimitWarnings |= 1; - trap_S_StartLocalSound( cgs.media.fiveMinuteSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.fiveMinuteSound, CHAN_ANNOUNCER ); } } @@ -511,15 +511,15 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) { highScore = cgs.scores1; if ( !( cg.fraglimitWarnings & 4 ) && highScore == (cgs.fraglimit - 1) ) { cg.fraglimitWarnings |= 1 | 2 | 4; - CG_AddBufferedSound(cgs.media.oneFragSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.oneFragSound); } else if ( cgs.fraglimit > 2 && !( cg.fraglimitWarnings & 2 ) && highScore == (cgs.fraglimit - 2) ) { cg.fraglimitWarnings |= 1 | 2; - CG_AddBufferedSound(cgs.media.twoFragSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.twoFragSound); } else if ( cgs.fraglimit > 3 && !( cg.fraglimitWarnings & 1 ) && highScore == (cgs.fraglimit - 3) ) { cg.fraglimitWarnings |= 1; - CG_AddBufferedSound(cgs.media.threeFragSound); + if (cg_RQ3_anouncer.integer == 1) CG_AddBufferedSound(cgs.media.threeFragSound); } } } diff --git a/reaction/cgame/cg_servercmds.c b/reaction/cgame/cg_servercmds.c index 41e0208b..38a72c0d 100644 --- a/reaction/cgame/cg_servercmds.c +++ b/reaction/cgame/cg_servercmds.c @@ -162,11 +162,11 @@ static void CG_ParseWarmup( void ) { } else if ( warmup > 0 && cg.warmup <= 0 ) { #ifdef MISSIONPACK if (cgs.gametype >= GT_CTF && cgs.gametype <= GT_HARVESTER) { - trap_S_StartLocalSound( cgs.media.countPrepareTeamSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.countPrepareTeamSound, CHAN_ANNOUNCER ); } else #endif { - trap_S_StartLocalSound( cgs.media.countPrepareSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.countPrepareSound, CHAN_ANNOUNCER ); } } @@ -284,7 +284,7 @@ static void CG_ConfigStringModified( void ) { } else if ( num == CS_VOTE_STRING ) { Q_strncpyz( cgs.voteString, str, sizeof( cgs.voteString ) ); #ifdef MISSIONPACK - trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); #endif //MISSIONPACK } else if ( num >= CS_TEAMVOTE_TIME && num <= CS_TEAMVOTE_TIME + 1) { cgs.teamVoteTime[num-CS_TEAMVOTE_TIME] = atoi( str ); @@ -298,7 +298,7 @@ static void CG_ConfigStringModified( void ) { } else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) { Q_strncpyz( cgs.teamVoteString[num-CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) ); #ifdef MISSIONPACK - trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); #endif } else if ( num == CS_INTERMISSION ) { cg.intermissionStarted = atoi( str ); @@ -443,7 +443,7 @@ static void CG_MapRestart( void ) { // play the "fight" sound if this is a restart without warmup if ( cg.warmup == 0 /* && cgs.gametype == GT_TOURNAMENT */) { - trap_S_StartLocalSound( cgs.media.countFightSound, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.countFightSound, CHAN_ANNOUNCER ); CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH*2 ); } #ifdef MISSIONPACK @@ -960,9 +960,9 @@ static void CG_ServerCommand( void ) { cmd = CG_Argv(1); // yes, this is obviously a hack, but so is the way we hear about // votes passing or failing if ( !Q_stricmpn( cmd, "vote failed", 11 ) || !Q_stricmpn( cmd, "team vote failed", 16 )) { - trap_S_StartLocalSound( cgs.media.voteFailed, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.voteFailed, CHAN_ANNOUNCER ); } else if ( !Q_stricmpn( cmd, "vote passed", 11 ) || !Q_stricmpn( cmd, "team vote passed", 16 ) ) { - trap_S_StartLocalSound( cgs.media.votePassed, CHAN_ANNOUNCER ); + if (cg_RQ3_anouncer.integer == 1) trap_S_StartLocalSound( cgs.media.votePassed, CHAN_ANNOUNCER ); } #endif return;