mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Settings Category, Minor Cleanup
This commit is contained in:
parent
698b934801
commit
749425dfb7
@ -1,19 +1,23 @@
|
|||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
class GVAR(EnableCombatDeafness) {
|
class GVAR(EnableCombatDeafness) {
|
||||||
|
category = CSTRING(Module_DisplayName);
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
displayName = CSTRING(EnableCombatDeafness_DisplayName);
|
displayName = CSTRING(EnableCombatDeafness_DisplayName);
|
||||||
description = CSTRING(EnableCombatDeafness_Description);
|
description = CSTRING(EnableCombatDeafness_Description);
|
||||||
};
|
};
|
||||||
class GVAR(EarplugsVolume) {
|
class GVAR(EarplugsVolume) {
|
||||||
|
category = CSTRING(Module_DisplayName);
|
||||||
value = 0.5;
|
value = 0.5;
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
};
|
};
|
||||||
class GVAR(UnconsciousnessVolume) {
|
class GVAR(UnconsciousnessVolume) {
|
||||||
|
category = CSTRING(Module_DisplayName);
|
||||||
value = 0.4;
|
value = 0.4;
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
};
|
};
|
||||||
class GVAR(DisableEarRinging) {
|
class GVAR(DisableEarRinging) {
|
||||||
|
category = CSTRING(Module_DisplayName);
|
||||||
value = 0;
|
value = 0;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
@ -21,12 +25,14 @@ class ACE_Settings {
|
|||||||
description = CSTRING(DisableEarRinging_Description);
|
description = CSTRING(DisableEarRinging_Description);
|
||||||
};
|
};
|
||||||
class GVAR(enabledForZeusUnits) {
|
class GVAR(enabledForZeusUnits) {
|
||||||
|
category = CSTRING(Module_DisplayName);
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
displayName = CSTRING(enabledForZeusUnits_DisplayName);
|
displayName = CSTRING(enabledForZeusUnits_DisplayName);
|
||||||
description = CSTRING(enabledForZeusUnits_Description);
|
description = CSTRING(enabledForZeusUnits_Description);
|
||||||
};
|
};
|
||||||
class GVAR(autoAddEarplugsToUnits) {
|
class GVAR(autoAddEarplugsToUnits) {
|
||||||
|
category = CSTRING(Module_DisplayName);
|
||||||
value = 1;
|
value = 1;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
displayName = CSTRING(autoAddEarplugsToUnits_DisplayName);
|
displayName = CSTRING(autoAddEarplugsToUnits_DisplayName);
|
||||||
|
@ -12,6 +12,10 @@ GVAR(playerVehAttenuation) = 1;
|
|||||||
GVAR(time3) = 0;
|
GVAR(time3) = 0;
|
||||||
|
|
||||||
["SettingsInitialized", {
|
["SettingsInitialized", {
|
||||||
|
TRACE_1("settingInit",GVAR(EnableCombatDeafness));
|
||||||
|
// Only run if combat deafness is enabled
|
||||||
|
if (!GVAR(EnableCombatDeafness)) exitWith {};
|
||||||
|
|
||||||
// Spawn volume updating process
|
// Spawn volume updating process
|
||||||
[FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler;
|
[FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler;
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Author: KoffeinFlummi, commy2, Rocko, Rommel, Ruthberg
|
* Author: KoffeinFlummi, commy2, Rocko, Rommel, Ruthberg
|
||||||
* Ear ringing PFH
|
* Handle new sound souce near player and apply hearing damage
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: unit <OBJECT>
|
* 0: strength of ear ringing (Number between 0 and 1) <NUMBER>
|
||||||
* 1: strength of ear ringing (Number between 0 and 1) <NUMBER>
|
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -15,9 +14,8 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
params ["_unit", "_strength"];
|
params ["_strength"];
|
||||||
|
|
||||||
if (_unit != ACE_player) exitWith {};
|
|
||||||
if (_strength < 0.05) exitWith {};
|
if (_strength < 0.05) exitWith {};
|
||||||
if (!isNull curatorCamera) exitWith {};
|
if (!isNull curatorCamera) exitWith {};
|
||||||
if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {};
|
if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {};
|
||||||
|
@ -30,4 +30,4 @@ _strength = (0 max _damage) * 30;
|
|||||||
if (_strength < 0.01) exitWith {};
|
if (_strength < 0.01) exitWith {};
|
||||||
|
|
||||||
// Call inmediately, as it will get pick up later anyway by the update thread
|
// Call inmediately, as it will get pick up later anyway by the update thread
|
||||||
[ACE_player, _strength] call FUNC(earRinging);
|
[_strength] call FUNC(earRinging);
|
||||||
|
@ -98,4 +98,4 @@ TRACE_1("result",_strength);
|
|||||||
if (_strength < 0.01) exitWith {};
|
if (_strength < 0.01) exitWith {};
|
||||||
|
|
||||||
// Call inmediately, as it will get pick up later anyway by the update thread
|
// Call inmediately, as it will get pick up later anyway by the update thread
|
||||||
[ACE_player, _strength] call FUNC(earRinging);
|
[_strength] call FUNC(earRinging);
|
||||||
|
@ -16,12 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
// Only run if combat deafness is enabled
|
|
||||||
if (!GVAR(EnableCombatDeafness)) exitWith {};
|
|
||||||
|
|
||||||
(_this select 0) params ["_justUpdateVolume"];
|
(_this select 0) params ["_justUpdateVolume"];
|
||||||
|
|
||||||
|
|
||||||
GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0;
|
GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0;
|
||||||
GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0.05;
|
GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0.05;
|
||||||
TRACE_3("",GVAR(volume),GVAR(deafnessDV),GVAR(deafnessDV) - GVAR(deafnessPrior));
|
TRACE_3("",GVAR(volume),GVAR(deafnessDV),GVAR(deafnessDV) - GVAR(deafnessPrior));
|
||||||
@ -46,7 +42,7 @@ if (!_justUpdateVolume) then {
|
|||||||
GVAR(deafnessDV) = (GVAR(deafnessDV) - (0.5 * (GVAR(volume) max 0.1))) max 0;
|
GVAR(deafnessDV) = (GVAR(deafnessDV) - (0.5 * (GVAR(volume) max 0.1))) max 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) || {!GVAR(enableCombatDeafness)}) exitWith {};
|
if (missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) exitWith {};
|
||||||
|
|
||||||
private _volume = GVAR(volume);
|
private _volume = GVAR(volume);
|
||||||
|
|
||||||
@ -57,8 +53,7 @@ if ([ACE_player] call FUNC(hasEarPlugsIn)) then {
|
|||||||
|
|
||||||
// Headgear can reduce hearing
|
// Headgear can reduce hearing
|
||||||
if (headgear ACE_player != "") then {
|
if (headgear ACE_player != "") then {
|
||||||
private ["_lowerVolume"];
|
private _lowerVolume = (getNumber (configFile >> "CfgWeapons" >> (headgear ACE_player) >> QGVAR(lowerVolume))) min 1;
|
||||||
_lowerVolume = (getNumber (configFile >> "CfgWeapons" >> (headgear ACE_player) >> QGVAR(lowerVolume))) min 1;
|
|
||||||
if (_lowerVolume > 0) then {
|
if (_lowerVolume > 0) then {
|
||||||
_volume = _volume min (1 - _lowerVolume);
|
_volume = _volume min (1 - _lowerVolume);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user