mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-09-15 14:52:26 +02:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
43 lines
1.7 KiB
C#
43 lines
1.7 KiB
C#
using Content.Shared.ActionBlocker;
|
|
using Content.Shared.Hands;
|
|
using Content.Shared.Interaction.Events;
|
|
using Content.Shared.Item;
|
|
using Content.Shared.Emoting;
|
|
using Content.Shared.Movement.Events;
|
|
|
|
namespace Content.Shared.Puppet;
|
|
|
|
// TODO deduplicate with BlockMovementComponent
|
|
public abstract partial class SharedVentriloquistPuppetSystem : EntitySystem
|
|
{
|
|
[Dependency] private ActionBlockerSystem _blocker = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, UseAttemptEvent>(Cancel);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, InteractionAttemptEvent>(CancelInteract);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, DropAttemptEvent>(Cancel);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, PickupAttemptEvent>(Cancel);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, UpdateCanMoveEvent>(Cancel);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, EmoteAttemptEvent>(Cancel);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, ChangeDirectionAttemptEvent>(Cancel);
|
|
SubscribeLocalEvent<VentriloquistPuppetComponent, ComponentStartup>(OnStartup);
|
|
}
|
|
|
|
private void CancelInteract(Entity<VentriloquistPuppetComponent> ent, ref InteractionAttemptEvent args)
|
|
{
|
|
args.Cancelled = true;
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, VentriloquistPuppetComponent component, ComponentStartup args)
|
|
{
|
|
_blocker.UpdateCanMove(uid);
|
|
}
|
|
|
|
private void Cancel<T>(EntityUid uid, VentriloquistPuppetComponent component, T args) where T : CancellableEntityEventArgs
|
|
{
|
|
args.Cancel();
|
|
}
|
|
}
|