Skip to content

Commit

Permalink
Common - Add epilepsy friendly mode (acemod#8452)
Browse files Browse the repository at this point in the history
* Add epilepsy friendly mode

* Disable LSD vehicles in epilepsy friendly mode
  • Loading branch information
BaerMitUmlaut authored and AndreasBrostrom committed Dec 3, 2021
1 parent 1cba199 commit ae47a9f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_moduleLSDVehicles.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

params ["", "_units", "_activated"];

if !(_activated) exitWith {};
if (!_activated || {GVAR(epilepsyFriendlyMode)}) exitWith {};

if (isNil QGVAR(LSD_Vehicles)) then {
GVAR(LSD_Vehicles) = [];
Expand Down
9 changes: 9 additions & 0 deletions addons/common/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@
true,
true
] call CBA_fnc_addSetting;

[
QGVAR(epilepsyFriendlyMode),
"CHECKBOX",
[LSTRING(EpilepsyFriendlyMode), LSTRING(EpilepsyFriendlyModeTooltip)],
format ["ACE %1", localize LSTRING(DisplayName)],
false,
2
] call CBA_fnc_addSetting;
8 changes: 8 additions & 0 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,14 @@
<Spanish>Permitir a los scripts de ACE reducir el volumen la música</Spanish>
<Turkish>ACE scripti müziği kısmana izin verir</Turkish>
</Key>
<Key ID="STR_ACE_Common_EpilepsyFriendlyMode">
<English>Epilepsy friendly mode</English>
<German>Epilepsiefreundlicher Modus</German>
</Key>
<Key ID="STR_ACE_Common_EpilepsyFriendlyModeTooltip">
<English>Disables some flashing light effects to reduce seizure risk.</English>
<German>Deaktiviert einige Lichtflackereffekte um das Risiko von Epilepsieanfällen zu reduzieren.</German>
</Key>
<Key ID="STR_ACE_Common_FlagBlack">
<English>Flag (ACE - Black)</English>
<German>Flagge (Ace - Schwarz)</German>
Expand Down
4 changes: 3 additions & 1 deletion addons/grenades/functions/fnc_flashbangExplosionEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then {

// Blind player
if (_strength > 0.1) then {
private _blend = [[1,1,1,0], [0.3,0.3,0.3,1]] select EGVAR(common,epilepsyFriendlyMode);

GVAR(flashbangPPEffectCC) ppEffectEnable true;
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectAdjust [1, 1, (0.8 + _strength) min 1, _blend, [0,0,0,1], [0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit 0.01;

//PARTIALRECOVERY - start decreasing effect over time
Expand Down
7 changes: 6 additions & 1 deletion addons/nightvision/functions/fnc_onFiredPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile);

if ((!GVAR(running)) || {!GVAR(shutterEffects)} || {_weapon == "throw"} || {_weapon == "put"}) exitWith {};
if ((!GVAR(running))
|| {!GVAR(shutterEffects)}
|| {EGVAR(common,epilepsyFriendlyMode)}
|| {_weapon == "throw"}
|| {_weapon == "put"}
) exitWith {};

private _visibleFireCoef = 1;
if (_unit == ace_player) then {
Expand Down

0 comments on commit ae47a9f

Please sign in to comment.