mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* PopupClient to PopupEntity/Coordinates * PopupPredictedX to PopupEntity/Cursor/Coordinates * The rest of the damn owl * nullability fixes * Buckle cleanup * cleanup, address PR comments * ExecutionSystem: one popup method * correct my filthy lies * Apply most of ajcm's suggestions * return user to SharedItemRecallSystem.cs * Fix lingering Ensnarable broadcast popups * targeted drain popups * fix lingering untargeted Guardian popups I read the comment on GuardianHostRecall. Oops. * target stethoscope popups * fix the PDA vibration popup * Fix target for encryption key removal popup * anomaly scanner: args.User, not uid * disposal unit comment, bcast pda vibration popup
57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
using Content.Shared.IdentityManagement;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Trigger.Components.Effects;
|
|
|
|
namespace Content.Shared.Trigger.Systems;
|
|
|
|
/// <summary>
|
|
/// This handles <see cref="PopupOnTriggerComponent"/>
|
|
/// </summary>
|
|
public sealed partial class PopupOnTriggerSystem : XOnTriggerSystem<PopupOnTriggerComponent>
|
|
{
|
|
[Dependency] private SharedPopupSystem _popup = default!;
|
|
|
|
protected override void OnTrigger(Entity<PopupOnTriggerComponent> ent, EntityUid target, ref TriggerEvent args)
|
|
{
|
|
var user = args.User != null ? Identity.Name(args.User.Value, EntityManager) : Loc.GetString("generic-unknown");
|
|
|
|
// Popups only play for one entity
|
|
if (ent.Comp.Quiet)
|
|
{
|
|
if (ent.Comp.Predicted)
|
|
{
|
|
_popup.PopupEntity(Loc.GetString(ent.Comp.Text, ("entity", ent), ("user", user)),
|
|
target,
|
|
ent.Comp.UserIsRecipient ? args.User : ent.Owner,
|
|
ent.Comp.PopupType);
|
|
}
|
|
|
|
else if (args.User != null)
|
|
{
|
|
_popup.PopupEntity(Loc.GetString(ent.Comp.OtherText ?? ent.Comp.Text, ("entity", ent), ("user", user)),
|
|
target,
|
|
args.User.Value,
|
|
ent.Comp.PopupType);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
// Popups play for all entities
|
|
if (ent.Comp.Predicted)
|
|
{
|
|
_popup.PopupEntity(Loc.GetString(ent.Comp.Text, ("entity", ent), ("user", user)),
|
|
Loc.GetString(ent.Comp.OtherText ?? ent.Comp.Text, ("entity", ent), ("user", user)),
|
|
target,
|
|
ent.Comp.UserIsRecipient ? args.User : ent.Owner,
|
|
ent.Comp.PopupType);
|
|
}
|
|
|
|
else
|
|
{
|
|
_popup.PopupEntity(Loc.GetString(ent.Comp.OtherText ?? ent.Comp.Text, ("entity", ent), ("user", user)),
|
|
target,
|
|
ent.Comp.PopupType);
|
|
}
|
|
}
|
|
}
|