telescreen and television require vision + Move eye to shared (#30260)

* telescreen and television require vision

* Move Content.Server.Eye to Shared

* fix popups

* Filthy
This commit is contained in:
Cojoke
2024-07-22 21:33:41 -05:00
committed by GitHub
parent 851a0e15a7
commit 2d4aaa414f
4 changed files with 12 additions and 16 deletions

View 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;
}

View 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();
}
}

View 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);
}
}
}

View File

@@ -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: