Remove IDestroyAct, IBreakAct (#7876)
This commit is contained in:
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Linq;
|
||||
using Content.Server.Disposal.Unit.Components;
|
||||
using Content.Server.Disposal.Unit.EntitySystems;
|
||||
using Content.Shared.Acts;
|
||||
using Content.Shared.Construction.Components;
|
||||
using Content.Shared.Disposal.Components;
|
||||
using Content.Shared.Popups;
|
||||
@@ -18,7 +17,7 @@ using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Disposal.Tube.Components
|
||||
{
|
||||
public abstract class DisposalTubeComponent : Component, IDisposalTubeComponent, IBreakAct
|
||||
public abstract class DisposalTubeComponent : Component, IDisposalTubeComponent
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
@@ -73,7 +72,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
private void Disconnect()
|
||||
public void Disconnect()
|
||||
{
|
||||
if (!_connected)
|
||||
{
|
||||
@@ -108,7 +107,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
}
|
||||
|
||||
var state = Anchored
|
||||
? DisposalTubeVisualState.Anchored
|
||||
? DisposalTubeVisualState.Anchored
|
||||
: DisposalTubeVisualState.Free;
|
||||
|
||||
appearance.SetData(DisposalTubeVisuals.VisualState, state);
|
||||
@@ -171,10 +170,5 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
void IBreakAct.OnBreak(BreakageEventArgs eventArgs)
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Disposal.Tube.Components;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Shared.Destructible;
|
||||
using Content.Shared.Movement;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Popups;
|
||||
@@ -23,6 +24,7 @@ namespace Content.Server.Disposal.Tube
|
||||
|
||||
SubscribeLocalEvent<DisposalTubeComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
|
||||
SubscribeLocalEvent<DisposalTubeComponent, RelayMovementEntityEvent>(OnRelayMovement);
|
||||
SubscribeLocalEvent<DisposalTubeComponent, BreakageEventArgs>(OnBreak);
|
||||
SubscribeLocalEvent<DisposalTaggerComponent, GetVerbsEvent<InteractionVerb>>(AddOpenUIVerbs);
|
||||
SubscribeLocalEvent<DisposalRouterComponent, GetVerbsEvent<InteractionVerb>>(AddOpenUIVerbs);
|
||||
SubscribeLocalEvent<DisposalRouterComponent, ActivatableUIOpenAttemptEvent>(OnOpenRouterUIAttempt);
|
||||
@@ -73,6 +75,11 @@ namespace Content.Server.Disposal.Tube
|
||||
SoundSystem.Play(Filter.Pvs(uid), component.ClangSound.GetSound(), uid);
|
||||
}
|
||||
|
||||
private void OnBreak(EntityUid uid, DisposalTubeComponent component, BreakageEventArgs args)
|
||||
{
|
||||
component.Disconnect();
|
||||
}
|
||||
|
||||
private void OnOpenRouterUIAttempt(EntityUid uid, DisposalRouterComponent router, ActivatableUIOpenAttemptEvent args)
|
||||
{
|
||||
if (!TryComp<HandsComponent>(args.User, out var hands))
|
||||
|
||||
@@ -10,9 +10,9 @@ using Content.Server.Hands.Components;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Acts;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Construction.Components;
|
||||
using Content.Shared.Destructible;
|
||||
using Content.Shared.Disposal;
|
||||
using Content.Shared.Disposal.Components;
|
||||
using Content.Shared.DragDrop;
|
||||
|
||||
Reference in New Issue
Block a user