From 2d4aaa414f0898a634b4ebf53c2088d2c5bde278 Mon Sep 17 00:00:00 2001 From: Cojoke <83733158+Cojoke-dot@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:33:41 -0500 Subject: [PATCH] telescreen and television require vision + Move eye to shared (#30260) * telescreen and television require vision * Move Content.Server.Eye to Shared * fix popups * Filthy --- .../ActivatableUIRequiresVisionComponent.cs | 6 ++---- .../Systems}/ActivatableUIRequiresVisionSystem.cs | 14 +++++--------- .../Eye/Blinding/Systems}/EyeProtectionSystem.cs | 6 +++--- .../Structures/Wallmounts/monitors_televisions.yml | 2 ++ 4 files changed, 12 insertions(+), 16 deletions(-) rename {Content.Server/Eye/Blinding => Content.Shared/Eye/Blinding/Components}/ActivatableUIRequiresVisionComponent.cs (58%) rename {Content.Server/Eye/Blinding => Content.Shared/Eye/Blinding/Systems}/ActivatableUIRequiresVisionSystem.cs (77%) rename {Content.Server/Eye/Blinding/EyeProtection => Content.Shared/Eye/Blinding/Systems}/EyeProtectionSystem.cs (96%) diff --git a/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionComponent.cs b/Content.Shared/Eye/Blinding/Components/ActivatableUIRequiresVisionComponent.cs similarity index 58% rename from Content.Server/Eye/Blinding/ActivatableUIRequiresVisionComponent.cs rename to Content.Shared/Eye/Blinding/Components/ActivatableUIRequiresVisionComponent.cs index 725b871b16..afb270414f 100644 --- a/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionComponent.cs +++ b/Content.Shared/Eye/Blinding/Components/ActivatableUIRequiresVisionComponent.cs @@ -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; } diff --git a/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs b/Content.Shared/Eye/Blinding/Systems/ActivatableUIRequiresVisionSystem.cs similarity index 77% rename from Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs rename to Content.Shared/Eye/Blinding/Systems/ActivatableUIRequiresVisionSystem.cs index 7b937cf0d8..6ed0c4cd6d 100644 --- a/Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs +++ b/Content.Shared/Eye/Blinding/Systems/ActivatableUIRequiresVisionSystem.cs @@ -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(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(); } } diff --git a/Content.Server/Eye/Blinding/EyeProtection/EyeProtectionSystem.cs b/Content.Shared/Eye/Blinding/Systems/EyeProtectionSystem.cs similarity index 96% rename from Content.Server/Eye/Blinding/EyeProtection/EyeProtectionSystem.cs rename to Content.Shared/Eye/Blinding/Systems/EyeProtectionSystem.cs index 2d54c03b51..0fc01f1b4e 100644 --- a/Content.Server/Eye/Blinding/EyeProtection/EyeProtectionSystem.cs +++ b/Content.Shared/Eye/Blinding/Systems/EyeProtectionSystem.cs @@ -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); } } } diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/monitors_televisions.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/monitors_televisions.yml index 408ab6b67c..9c3141298f 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/monitors_televisions.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/monitors_televisions.yml @@ -108,6 +108,7 @@ - type: ActivatableUI key: enum.SurveillanceCameraMonitorUiKey.Key - type: ActivatableUIRequiresPower + - type: ActivatableUIRequiresVision - type: UserInterface interfaces: enum.SurveillanceCameraMonitorUiKey.Key: @@ -167,6 +168,7 @@ - type: ActivatableUI key: enum.SurveillanceCameraMonitorUiKey.Key - type: ActivatableUIRequiresPower + - type: ActivatableUIRequiresVision - type: UserInterface interfaces: enum.SurveillanceCameraMonitorUiKey.Key: