diff --git a/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml b/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml
index 72df18390f..5a389ca491 100644
--- a/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml
+++ b/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml
@@ -7,6 +7,7 @@
+
diff --git a/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml.cs b/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml.cs
index 0c88eae50d..f33da4c501 100644
--- a/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml.cs
+++ b/Content.Client/Options/UI/Tabs/AccessibilityTab.xaml.cs
@@ -15,6 +15,7 @@ public sealed partial class AccessibilityTab : Control
Control.AddOptionCheckBox(CCVars.ChatEnableColorName, EnableColorNameCheckBox);
Control.AddOptionCheckBox(CCVars.AccessibilityColorblindFriendly, ColorblindFriendlyCheckBox);
Control.AddOptionCheckBox(CCVars.ReducedMotion, ReducedMotionCheckBox);
+ Control.AddOptionCheckBox(CCVars.DisableAiStatic, DisableAiStaticCheckBox);
Control.AddOptionPercentSlider(CCVars.ScreenShakeIntensity, ScreenShakeIntensitySlider);
Control.AddOptionPercentSlider(CCVars.ChatWindowOpacity, ChatWindowOpacitySlider);
Control.AddOptionPercentSlider(CCVars.SpeechBubbleTextOpacity, SpeechBubbleTextOpacitySlider);
diff --git a/Content.Client/Silicons/StationAi/StationAiOverlay.cs b/Content.Client/Silicons/StationAi/StationAiOverlay.cs
index ee5105d84a..4db8965868 100644
--- a/Content.Client/Silicons/StationAi/StationAiOverlay.cs
+++ b/Content.Client/Silicons/StationAi/StationAiOverlay.cs
@@ -1,8 +1,10 @@
using System.Numerics;
using Content.Client.Graphics;
+using Content.Shared.CCVar;
using Content.Shared.Silicons.StationAi;
using Robust.Client.Graphics;
using Robust.Client.Player;
+using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
@@ -14,10 +16,12 @@ namespace Content.Client.Silicons.StationAi;
public sealed partial class StationAiOverlay : Overlay
{
private static readonly ProtoId CameraStaticShader = "CameraStatic";
+ private static readonly ProtoId CameraStaticAccessibleShader = "CameraStaticAccessible";
private static readonly ProtoId StencilMaskShader = "StencilMask";
private static readonly ProtoId StencilDrawShader = "StencilDraw";
[Dependency] private IClyde _clyde = default!;
+ [Dependency] private IConfigurationManager _cfg = default!;
[Dependency] private IEntityManager _entManager = default!;
[Dependency] private IGameTiming _timing = default!;
[Dependency] private IPlayerManager _player = default!;
@@ -29,12 +33,20 @@ public sealed partial class StationAiOverlay : Overlay
private readonly OverlayResourceCache _resources = new();
+ private ProtoId _activeShader = CameraStaticShader;
private float _updateRate = 1f / 30f;
private float _accumulator;
public StationAiOverlay()
{
IoCManager.InjectDependencies(this);
+ _cfg.OnValueChanged(CCVars.DisableAiStatic, OnAiStaticChanged, invokeImmediately: true);
+
+ }
+
+ private void OnAiStaticChanged(bool toggle)
+ {
+ _activeShader = toggle ? CameraStaticAccessibleShader : CameraStaticShader;
}
protected override void Draw(in OverlayDrawArgs args)
@@ -97,7 +109,7 @@ public sealed partial class StationAiOverlay : Overlay
() =>
{
worldHandle.SetTransform(invMatrix);
- var shader = _proto.Index(CameraStaticShader).Instance();
+ var shader = _proto.Index(_activeShader).Instance();
worldHandle.UseShader(shader);
worldHandle.DrawRect(worldBounds, Color.White);
},
diff --git a/Content.Shared/CCVar/CCVars.Accessibility.cs b/Content.Shared/CCVar/CCVars.Accessibility.cs
index 3f752cbeea..e748789910 100644
--- a/Content.Shared/CCVar/CCVars.Accessibility.cs
+++ b/Content.Shared/CCVar/CCVars.Accessibility.cs
@@ -19,6 +19,13 @@ public sealed partial class CCVars
public static readonly CVarDef ReducedMotion =
CVarDef.Create("accessibility.reduced_motion", false, CVar.CLIENTONLY | CVar.ARCHIVE);
+ ///
+ /// Replaces the AI static camera effect with a plain gradient.
+ /// Used for photosensitivity triggers.
+ ///
+ public static readonly CVarDef DisableAiStatic =
+ CVarDef.Create("accessibility.disable_ai_static", false, CVar.CLIENTONLY | CVar.ARCHIVE);
+
public static readonly CVarDef ChatEnableColorName =
CVarDef.Create("accessibility.enable_color_name",
true,
diff --git a/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl b/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
index 26281b1ff8..58aab1f275 100644
--- a/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
+++ b/Resources/Locale/en-US/escape-menu/ui/options-menu.ftl
@@ -366,6 +366,7 @@ ui-options-accessability-header-content = Content
ui-options-enable-color-name = Add colors to character names
ui-options-colorblind-friendly = Colorblind friendly mode
ui-options-reduced-motion = Reduce motion of visual effects
+ui-options-disable-ai-static = Disable the static effect on the AI camera overlay
ui-options-screen-shake-intensity = Screen shake intensity
ui-options-chat-window-opacity = Chat window opacity
diff --git a/Resources/Prototypes/Shaders/shaders.yml b/Resources/Prototypes/Shaders/shaders.yml
index bf740ba1f6..6e8184c2fd 100644
--- a/Resources/Prototypes/Shaders/shaders.yml
+++ b/Resources/Prototypes/Shaders/shaders.yml
@@ -58,6 +58,11 @@
kind: source
path: "/Textures/Shaders/camera_static.swsl"
+- type: shader
+ id: CameraStaticAccessible
+ kind: source
+ path: "/Textures/Shaders/camera_static_accessible.swsl"
+
- type: shader
id: Drunk
kind: source
@@ -115,7 +120,7 @@
id: Hologram
kind: source
path: "/Textures/Shaders/hologram.swsl"
-
+
- type: shader
id: HeatBlur
kind: source
diff --git a/Resources/Textures/Shaders/camera_static_accessible.swsl b/Resources/Textures/Shaders/camera_static_accessible.swsl
new file mode 100644
index 0000000000..026329c430
--- /dev/null
+++ b/Resources/Textures/Shaders/camera_static_accessible.swsl
@@ -0,0 +1,6 @@
+void fragment() {
+ highp vec2 coords = FRAGCOORD.xy;
+ highp vec2 value = vec2(coords * SCREEN_PIXEL_SIZE);
+ highp vec3 color = vec3(0.0,value.x/3.0,value.x/2.0);
+ COLOR = vec4(0.1 * color,1.0);
+}