]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Disable rainbow overlay when reduced motion is enabled (#28496)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Sun, 2 Jun 2024 01:41:06 +0000 (18:41 -0700)
committerGitHub <noreply@github.com>
Sun, 2 Jun 2024 01:41:06 +0000 (18:41 -0700)
Disable rainbow ovelray when reduced motion is enabled

Content.Client/Drugs/RainbowOverlay.cs

index e62b0dfa66cd062317c3c768a61600c07493e1dd..fb48c91010965ab499d7ce68b406769943916cb8 100644 (file)
@@ -1,7 +1,9 @@
+using Content.Shared.CCVar;
 using Content.Shared.Drugs;
 using Content.Shared.StatusEffect;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
+using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
@@ -10,6 +12,7 @@ namespace Content.Client.Drugs;
 
 public sealed class RainbowOverlay : Overlay
 {
+    [Dependency] private readonly IConfigurationManager _config = default!;
     [Dependency] private readonly IEntityManager _entityManager = default!;
     [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
     [Dependency] private readonly IPlayerManager _playerManager = default!;
@@ -75,6 +78,10 @@ public sealed class RainbowOverlay : Overlay
 
     protected override void Draw(in OverlayDrawArgs args)
     {
+        // TODO disable only the motion part or ike's idea (single static frame of the overlay)
+        if (_config.GetCVar(CCVars.ReducedMotion))
+            return;
+
         if (ScreenTexture == null)
             return;