Skip to content

Commit

Permalink
Hearing - Add setting to add earplugs to all units (#9935)
Browse files Browse the repository at this point in the history
Add option to add earplugs to all units
  • Loading branch information
johnb432 authored Apr 10, 2024
1 parent 095ce88 commit 5130a22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions addons/hearing/functions/fnc_addEarPlugs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ params ["_unit"];
TRACE_2("params",_unit,typeOf _unit);

// Exit if hearing is disabled OR autoAdd is disabled OR soldier has earplugs already in (persistence scenarios)
if (!GVAR(enableCombatDeafness) || {!GVAR(autoAddEarplugsToUnits)} || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {};
if (!GVAR(enableCombatDeafness) || {GVAR(autoAddEarplugsToUnits) == 0} || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {};

// add earplugs if the soldier has a rocket launcher
if ((secondaryWeapon _unit) != "") exitWith {
// Add earplugs if enabled for everyone or if the soldier has a rocket launcher
if (GVAR(autoAddEarplugsToUnits) == 2 || {(secondaryWeapon _unit) != ""}) exitWith {
TRACE_1("has launcher - adding",_unit);
_unit addItem "ACE_EarPlugs";
};
Expand Down
4 changes: 2 additions & 2 deletions addons/hearing/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
] call CBA_fnc_addSetting;

[
QGVAR(autoAddEarplugsToUnits), "CHECKBOX",
QGVAR(autoAddEarplugsToUnits), "LIST",
[LSTRING(autoAddEarplugsToUnits_DisplayName), LSTRING(autoAddEarplugsToUnits_Description)],
_category,
true,
[[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(heavyWeaponUnits), ELSTRING(common,Enabled)], 1],
1
] call CBA_fnc_addSetting;
3 changes: 3 additions & 0 deletions addons/hearing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -371,5 +371,8 @@
<Korean>귀마개 토글</Korean>
<French>Mettre/enlever les bouchons</French>
</Key>
<Key ID="STR_ACE_Hearing_heavyWeaponUnits">
<English>Only units with heavy weapons</English>
</Key>
</Package>
</Project>

0 comments on commit 5130a22

Please sign in to comment.