This commit is contained in:
Ed
2025-09-08 13:44:20 +03:00
parent e941d8afaf
commit 2d434654ae
3 changed files with 11 additions and 10 deletions

View File

@@ -1,7 +1,8 @@
using Content.Server._CP14.DeviceLinking.Components;
using Content.Server.DeviceLinking.Systems;
using Content.Server.Storage.Components;
using Content.Shared._CP14.DeviceLinking;
using Content.Shared.Placeable;
using Content.Shared.Storage.Components;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Components;
@@ -17,28 +18,28 @@ public sealed class CP14PressurePlateSystem : EntitySystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<Components.CP14PressurePlateComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<Components.CP14PressurePlateComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<Components.CP14PressurePlateComponent, ItemRemovedEvent>(OnItemRemoved);
SubscribeLocalEvent<CP14PressurePlateComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<CP14PressurePlateComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<CP14PressurePlateComponent, ItemRemovedEvent>(OnItemRemoved);
}
private void OnInit(Entity<Components.CP14PressurePlateComponent> plate, ref ComponentInit args)
private void OnInit(Entity<CP14PressurePlateComponent> plate, ref ComponentInit args)
{
_signal.EnsureSourcePorts(plate, plate.Comp.PressedPort, plate.Comp.ReleasedPort);
_appearance.SetData(plate, PressurePlateVisuals.Pressed, false);
}
private void OnItemRemoved(Entity<Components.CP14PressurePlateComponent> plate, ref ItemRemovedEvent args)
private void OnItemRemoved(Entity<CP14PressurePlateComponent> plate, ref ItemRemovedEvent args)
{
UpdateState(plate);
}
private void OnItemPlaced(Entity<Components.CP14PressurePlateComponent> plate, ref ItemPlacedEvent args)
private void OnItemPlaced(Entity<CP14PressurePlateComponent> plate, ref ItemPlacedEvent args)
{
UpdateState(plate);
}
private void UpdateState(Entity<Components.CP14PressurePlateComponent> plate)
private void UpdateState(Entity<CP14PressurePlateComponent> plate)
{
if (!TryComp<ItemPlacerComponent>(plate, out var itemPlacer))
return;

View File

@@ -1,6 +1,5 @@
using Content.Server._CP14.Currency;
using Content.Server.Cargo.Systems;
using Content.Server.Storage.Components;
using Content.Shared._CP14.Trading;
using Content.Shared._CP14.Trading.Components;
using Content.Shared._CP14.Trading.Prototypes;
@@ -9,6 +8,7 @@ using Content.Shared.Mobs.Components;
using Content.Shared.Placeable;
using Content.Shared.Popups;
using Content.Shared.Storage;
using Content.Shared.Storage.Components;
using Content.Shared.Tag;
using Content.Shared.UserInterface;
using Robust.Server.GameObjects;

View File

@@ -1,5 +1,4 @@
using System.Text;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
@@ -8,6 +7,7 @@ using Content.Server.Temperature.Systems;
using Content.Shared._CP14.DayCycle;
using Content.Shared._CP14.Vampire;
using Content.Shared._CP14.Vampire.Components;
using Content.Shared.Atmos.Components;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Ghost;