ACE3/addons/volume/functions/fnc_lowerVolume.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

32 lines
730 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Kingsley
* Lowers the game and music volume with values from ACE settings.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_volume_fnc_lowerVolume
*
* Public: No
*/
EGVAR(hearing,disableVolumeUpdate) = true;
private _coef = XGVAR(reduction) / 10;
private _reductionGame = _coef * GVAR(initialGameVolume);
private _reductionMusic = _coef * GVAR(initialMusicVolume);
XGVAR(fadeDelay) fadeSound (GVAR(initialGameVolume) - _reductionGame);
XGVAR(fadeDelay) fadeMusic (GVAR(initialMusicVolume) - _reductionMusic);
GVAR(isLowered) = true;
if (XGVAR(showNotification)) then {
[LLSTRING(Lowered)] call EFUNC(common,displayTextStructured);
};