Skip to content

Commit

Permalink
Allow opt-out of unconscious spectator (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
3Mydlo3 authored Aug 14, 2024
1 parent caff75c commit 5fcd8a4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions addons/spectator/functions/fnc_canSpectate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ params [["_player", player]];

!(alive _player)
|| {GVAR(allowUnconscious)
&& GVAR(enabledUnconscious)
&& {[_player] call EFUNC(common,isUnconscious)}}
10 changes: 10 additions & 0 deletions addons/spectator/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
{[_this] call FUNC(restart)}
] call CBA_fnc_addSetting;

[
QGVAR(enabledUnconscious),
"CHECKBOX",
[LSTRING(EnabledUnconscious), LSTRING(EnabledUnconscious_Description)],
[LSTRING(DisplayName), LSTRING(Unconscious)],
true,
0,
{[_this] call FUNC(restart)}
] call CBA_fnc_addSetting;

[
QGVAR(unconsciousDelay),
"SLIDER",
Expand Down
16 changes: 12 additions & 4 deletions addons/spectator/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@
<English>Enables spectator for dead players</English>
<Polish>Włącza obserwatora martwym graczom</Polish>
</Key>
<Key ID="STR_AFM_Spectator_EnabledUnconscious">
<English>Enable spectator (CLIENT)</English>
<Polish>Włącz obserwatora (KLIENT)</Polish>
</Key>
<Key ID="STR_AFM_Spectator_EnabledUnconscious_Description">
<English>Enables spectator when unconscious if it's allowed by server setting.</English>
<Polish>Włącza obserwatora podczas nieprzytomności jeżeli ustawienia serwera pozwalają.</Polish>
</Key>
<Key ID="STR_AFM_Spectator_Unconscious">
<English>Unconscious</English>
<Polish>Nieprzytomni</Polish>
</Key>
<Key ID="STR_AFM_Spectator_AllowUnconscious">
<English>Allow unconscious</English>
<Polish>Obserwator dla nieprzytomnych</Polish>
<English>Allow spectator for unconscious</English>
<Polish>Pozwól na obserwatora dla nieprzytomnych</Polish>
</Key>
<Key ID="STR_AFM_Spectator_AllowUnconscious_Description">
<English>Enables spectator also for unconscious players. Requires enabling spectator.</English>
<Polish>Włącza obserwatora także nieprzytomnym graczom. Wymaga włączenia obserwatora.</Polish>
<English>Allows spectator also for unconscious players. Requires enabling spectator.</English>
<Polish>Pozwala na obserwatora także nieprzytomnym graczom. Wymaga włączenia obserwatora.</Polish>
</Key>
<Key ID="STR_AFM_Spectator_UnconsciousDelay">
<English>Unconscious spectator delay</English>
Expand Down

0 comments on commit 5fcd8a4

Please sign in to comment.