From c6943fbdaf2b73b84c0134970168be5c72043b78 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 14:45:21 -0700 Subject: [PATCH] fixes to ACRE volume, and this transform should really be in set/get global volume. Closes #588 --- addons/common/functions/fnc_setHearingCapability.sqf | 2 +- addons/common/functions/fnc_setVolume.sqf | 6 +++--- addons/hearing/functions/fnc_updateVolume.sqf | 2 +- addons/medical/XEH_postInit.sqf | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 26d8ca98ac..c90a5448ae 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -52,4 +52,4 @@ _lowestVolume = 1; // Set Radio mod variables. player setVariable ["tf_globalVolume", _lowestVolume]; -player setVariable ["acre_sys_core_globalVolume", _lowestVolume]; +[_lowestVolume] call acre_api_fnc_setGlobalVolume; diff --git a/addons/common/functions/fnc_setVolume.sqf b/addons/common/functions/fnc_setVolume.sqf index ee2c42e39c..133a09bd24 100644 --- a/addons/common/functions/fnc_setVolume.sqf +++ b/addons/common/functions/fnc_setVolume.sqf @@ -27,8 +27,8 @@ if (_setVolume) then { player setVariable ["tf_unable_to_use_radio", false]; // ACRE2 - [NORMAL_LEVEL] call acre_api_fnc_setGlobalVolume; - player setVariable ["acre_sys_core_isDisabled", false, true]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [NORMAL_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; }; + player setVariable ["acre_sys_core_isDisabled", false, true]; } else { // Vanilla Game @@ -40,7 +40,7 @@ if (_setVolume) then { player setVariable ["tf_unable_to_use_radio", true]; // ACRE2 - [MUTED_LEVEL] call acre_api_fnc_setGlobalVolume; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [MUTED_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; }; player setVariable ["acre_sys_core_isDisabled", true, true]; }; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 1aa38848a5..dd51f30e19 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -56,7 +56,7 @@ if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { 0.1 fadeSound _volume; 0.1 fadeSpeech _volume; ACE_player setVariable ["tf_globalVolume", _volume]; - if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume] call acre_api_fnc_setGlobalVolume;}; + if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume^(0.33)] call acre_api_fnc_setGlobalVolume;}; }; //hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume]; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 1b0a38f1af..905c34cd48 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -21,14 +21,14 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; _unit setVariable ["tf_unable_to_use_radio", true, true]; _unit setVariable ["acre_sys_core_isDisabled", true, true]; - _unit setVariable ["acre_sys_core_globalVolume", 0.4]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [0.4] call acre_api_fnc_setGlobalVolume; }; } else { _unit setVariable ["tf_globalVolume", 1]; _unit setVariable ["tf_voiceVolume", 1, true]; _unit setVariable ["tf_unable_to_use_radio", false, true]; _unit setVariable ["acre_sys_core_isDisabled", false, true]; - _unit setVariable ["acre_sys_core_globalVolume", 1]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [1] call acre_api_fnc_setGlobalVolume; }; }; }; }] call ace_common_fnc_addEventHandler;