]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
telescreen and television require vision + Move eye to shared (#30260)
authorCojoke <83733158+Cojoke-dot@users.noreply.github.com>
Tue, 23 Jul 2024 02:33:41 +0000 (21:33 -0500)
committerGitHub <noreply@github.com>
Tue, 23 Jul 2024 02:33:41 +0000 (19:33 -0700)
* telescreen and television require vision

* Move Content.Server.Eye to Shared

* fix popups

* Filthy

Content.Shared/Eye/Blinding/Components/ActivatableUIRequiresVisionComponent.cs [moved from Content.Server/Eye/Blinding/ActivatableUIRequiresVisionComponent.cs with 58% similarity]
Content.Shared/Eye/Blinding/Systems/ActivatableUIRequiresVisionSystem.cs [moved from Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs with 77% similarity]
Content.Shared/Eye/Blinding/Systems/EyeProtectionSystem.cs [moved from Content.Server/Eye/Blinding/EyeProtection/EyeProtectionSystem.cs with 96% similarity]
Resources/Prototypes/Entities/Structures/Wallmounts/monitors_televisions.yml

similarity index 58%
rename from Content.Server/Eye/Blinding/ActivatableUIRequiresVisionComponent.cs
rename to Content.Shared/Eye/Blinding/Components/ActivatableUIRequiresVisionComponent.cs
index 725b871b16dfdcef3facdbf992cc3b002a27fd61..afb270414f314e5f9060378fc4001c4807de430c 100644 (file)
@@ -1,8 +1,6 @@
-namespace Content.Server.Eye.Blinding
+namespace Content.Shared.Eye.Blinding.Components
 {
     [RegisterComponent]
-    public sealed partial class ActivatableUIRequiresVisionComponent : Component
-    {
-    }
+    public sealed partial class ActivatableUIRequiresVisionComponent : Component;
 }
 
similarity index 77%
rename from Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs
rename to Content.Shared/Eye/Blinding/Systems/ActivatableUIRequiresVisionSystem.cs
index 7b937cf0d818d2c3aa60e84d0c9cbfb01ca79f90..6ed0c4cd6db03d984f8b8a276fb6202b5321aaa4 100644 (file)
@@ -1,18 +1,14 @@
-using Content.Shared.Eye.Blinding;
 using Content.Shared.UserInterface;
-using Content.Server.Popups;
 using Content.Shared.Eye.Blinding.Components;
-using Content.Shared.Eye.Blinding.Systems;
-using Robust.Shared.Player;
-using Robust.Server.GameObjects;
+using Content.Shared.Popups;
 using Robust.Shared.Collections;
 
-namespace Content.Server.Eye.Blinding;
+namespace Content.Shared.Eye.Blinding.Systems;
 
 public sealed class ActivatableUIRequiresVisionSystem : EntitySystem
 {
-    [Dependency] private readonly PopupSystem _popupSystem = default!;
-    [Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
+    [Dependency] private readonly SharedPopupSystem _popupSystem = default!;
+    [Dependency] private readonly SharedUserInterfaceSystem _userInterfaceSystem = default!;
 
     public override void Initialize()
     {
@@ -28,7 +24,7 @@ public sealed class ActivatableUIRequiresVisionSystem : EntitySystem
 
         if (TryComp<BlindableComponent>(args.User, out var blindable) && blindable.IsBlind)
         {
-            _popupSystem.PopupCursor(Loc.GetString("blindness-fail-attempt"), args.User, Shared.Popups.PopupType.MediumCaution);
+            _popupSystem.PopupClient(Loc.GetString("blindness-fail-attempt"), args.User, Shared.Popups.PopupType.MediumCaution);
             args.Cancel();
         }
     }
similarity index 96%
rename from Content.Server/Eye/Blinding/EyeProtection/EyeProtectionSystem.cs
rename to Content.Shared/Eye/Blinding/Systems/EyeProtectionSystem.cs
index 2d54c03b51bc6e0748ba28cf629e31e0fcb2d25d..0fc01f1b4e51e10a6c5087efa971e88a0fb562cd 100644 (file)
@@ -1,17 +1,16 @@
 using Content.Shared.StatusEffect;
 using Content.Shared.Inventory;
 using Content.Shared.Eye.Blinding.Components;
-using Content.Shared.Eye.Blinding.Systems;
 using Content.Shared.Tools.Components;
 using Content.Shared.Item.ItemToggle.Components;
 
-namespace Content.Server.Eye.Blinding.EyeProtection
+namespace Content.Shared.Eye.Blinding.Systems
 {
     public sealed class EyeProtectionSystem : EntitySystem
     {
         [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
         [Dependency] private readonly BlindableSystem _blindingSystem = default!;
-        
+
         public override void Initialize()
         {
             base.Initialize();
@@ -58,6 +57,7 @@ namespace Content.Server.Eye.Blinding.EyeProtection
         private void OnWelderToggled(EntityUid uid, RequiresEyeProtectionComponent component, ItemToggledEvent args)
         {
             component.Toggled = args.Activated;
+            Dirty(uid, component);
         }
     }
 }
index 408ab6b67c35a6839a48587d5b91e930feeaa2af..9c3141298f4027f1869d272e412f64a0043193a3 100644 (file)
   - type: ActivatableUI
     key: enum.SurveillanceCameraMonitorUiKey.Key
   - type: ActivatableUIRequiresPower
+  - type: ActivatableUIRequiresVision
   - type: UserInterface
     interfaces:
         enum.SurveillanceCameraMonitorUiKey.Key:
   - type: ActivatableUI
     key: enum.SurveillanceCameraMonitorUiKey.Key
   - type: ActivatableUIRequiresPower
+  - type: ActivatableUIRequiresVision
   - type: UserInterface
     interfaces:
         enum.SurveillanceCameraMonitorUiKey.Key: