Only play repatitive sounds when game is focused (#7265)

This commit is contained in:
PabstMirror 2019-11-16 12:42:15 -06:00 committed by GitHub
parent 5a4f76efb0
commit 00a91610ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -27,6 +27,7 @@ params ["_unit", "_fatigue", "_speed", "_overexhausted"];
// - Audible effects ---------------------------------------------------------- // - Audible effects ----------------------------------------------------------
GVAR(lastBreath) = GVAR(lastBreath) + 1; GVAR(lastBreath) = GVAR(lastBreath) + 1;
if (_fatigue > 0.4 && {GVAR(lastBreath) > (_fatigue * -10 + 9)} && {!underwater _unit}) then { if (_fatigue > 0.4 && {GVAR(lastBreath) > (_fatigue * -10 + 9)} && {!underwater _unit}) then {
if (!isGameFocused) exitWith {};
switch (true) do { switch (true) do {
case (_fatigue < 0.6): { case (_fatigue < 0.6): {
playSound (QGVAR(breathLow) + str(floor random 6)); playSound (QGVAR(breathLow) + str(floor random 6));

View File

@ -36,6 +36,7 @@ if (!_justUpdateVolume) then {
if (CBA_missionTime - GVAR(time3) < 3) exitWith {}; if (CBA_missionTime - GVAR(time3) < 3) exitWith {};
GVAR(time3) = CBA_missionTime; GVAR(time3) = CBA_missionTime;
if (!isGameFocused) exitWith {};
if (GVAR(deafnessDV) > 19.75) then { if (GVAR(deafnessDV) > 19.75) then {
playSound (["ACE_Combat_Deafness_Heavy", "ACE_Combat_Deafness_Heavy_NoRing"] select GVAR(DisableEarRinging)); playSound (["ACE_Combat_Deafness_Heavy", "ACE_Combat_Deafness_Heavy_NoRing"] select GVAR(DisableEarRinging));
} else { } else {

View File

@ -10,8 +10,8 @@
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
// MINIMAL required version for the Mod. Components can specify others.. // MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 1.94 #define REQUIRED_VERSION 1.96
#define REQUIRED_CBA_VERSION {3,11,2} #define REQUIRED_CBA_VERSION {3,12,2}
#ifdef COMPONENT_BEAUTIFIED #ifdef COMPONENT_BEAUTIFIED
#define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED) #define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED)

View File

@ -28,11 +28,11 @@ private _waitTime = 60 / _heartRate;
switch (true) do { switch (true) do {
case (_heartRate > 160): { case (_heartRate > 160): {
// playSound SND_HEARBEAT_FAST; // Array doesn't blend together well, just play one file consistently // playSound SND_HEARBEAT_FAST; // Array doesn't blend together well, just play one file consistently
playSound "ACE_heartbeat_fast_1"; if (isGameFocused) then { playSound "ACE_heartbeat_fast_1"; };
[FUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute; [FUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute;
}; };
case (_heartRate < 60): { case (_heartRate < 60): {
playSound SND_HEARBEAT_SLOW; if (isGameFocused) then { playSound SND_HEARBEAT_SLOW; };
[FUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute; [FUNC(effectHeartBeat), [], _waitTime] call CBA_fnc_waitAndExecute;
}; };
default { default {