Hide earplug actions if setting disabled (#4913)

* Hide earplug actions if setting disabled

* Add lines that are new
This commit is contained in:
PabstMirror 2017-02-16 10:16:46 -06:00 committed by GitHub
parent 19d5fa0a4e
commit 9d128152a3
3 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,7 @@ class CfgVehicles {
class ACE_Equipment {
class ACE_PutInEarplugs {
displayName = CSTRING(EarPlugs_On);
condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} );
condition = QUOTE(GVAR(EnableCombatDeafness) && {!([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player}});
exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE( [_player] call FUNC(putInEarPlugs) );
showDisabled = 0;
@ -14,7 +14,7 @@ class CfgVehicles {
};
class ACE_RemoveEarplugs {
displayName = CSTRING(EarPlugs_Off);
condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) );
condition = QUOTE( GVAR(EnableCombatDeafness) && {[_player] call FUNC(hasEarPlugsIn)});
exceptions[] = {"isNotInside", "isNotSitting"};
statement = QUOTE( [_player] call FUNC(removeEarPlugs) );
showDisabled = 0;

View File

@ -17,6 +17,8 @@
params ["_player"];
if (!GVAR(EnableCombatDeafness)) exitWith {};
// Plugs in inventory, putting them in
_player removeItem "ACE_EarPlugs";

View File

@ -17,6 +17,8 @@
params ["_player"];
if (!GVAR(EnableCombatDeafness)) exitWith {};
if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full
[localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured);
};