Hearing - Add setting to add earplugs to all units (#9935)

Add option to add earplugs to all units
This commit is contained in:
johnb432 2024-04-10 13:23:50 +02:00 committed by GitHub
parent 095ce88279
commit 5130a22008
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View File

@ -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";
};

View File

@ -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;

View File

@ -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>