Common - Add epilepsy friendly mode (#8452)

* Add epilepsy friendly mode

* Disable LSD vehicles in epilepsy friendly mode
This commit is contained in:
BaerMitUmlaut 2021-10-05 19:29:22 +02:00 committed by GitHub
parent 5fbbb34d2d
commit 8d804cf76d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 3 deletions

View File

@ -17,7 +17,7 @@
params ["", "_units", "_activated"];
if !(_activated) exitWith {};
if (!_activated || {GVAR(epilepsyFriendlyMode)}) exitWith {};
if (isNil QGVAR(LSD_Vehicles)) then {
GVAR(LSD_Vehicles) = [];

View File

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

View File

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

View File

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

View File

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