Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -41,9 +41,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>