add interaction success/failure events (#32216)

* add interaction success/failure events

* pro

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-09-18 22:36:44 +00:00
committed by GitHub
parent ba24ebfb4f
commit 8a924c84ae
3 changed files with 21 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.Bed.Sleep;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
@@ -100,6 +101,9 @@ public sealed class InteractionPopupSystem : EntitySystem
if (component.InteractSuccessSpawn != null)
Spawn(component.InteractSuccessSpawn, _transform.GetMapCoordinates(uid));
var ev = new InteractionSuccessEvent(user);
RaiseLocalEvent(target, ref ev);
}
else
{
@@ -111,6 +115,9 @@ public sealed class InteractionPopupSystem : EntitySystem
if (component.InteractFailureSpawn != null)
Spawn(component.InteractFailureSpawn, _transform.GetMapCoordinates(uid));
var ev = new InteractionFailureEvent(user);
RaiseLocalEvent(target, ref ev);
}
if (!string.IsNullOrEmpty(component.MessagePerceivedByOthers))