From 8f2b19e1038bc18f3d7c677d01c05afe4da03d60 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Sun, 8 Dec 2024 19:51:53 -0800 Subject: [PATCH] Popup when being pulled shows who is pulling you (#33612) * Popup when being pulled * Update Content.Shared/Movement/Pulling/Systems/PullingSystem.cs Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com> * Update Resources/Locale/en-US/movement/pulling.ftl Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com> --------- Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com> --- Content.Shared/Movement/Pulling/Systems/PullingSystem.cs | 7 ++++++- Resources/Locale/en-US/movement/pulling.ftl | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Resources/Locale/en-US/movement/pulling.ftl diff --git a/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs b/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs index 6392956d63..b17e34f171 100644 --- a/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs +++ b/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs @@ -6,6 +6,7 @@ using Content.Shared.Cuffs.Components; using Content.Shared.Database; using Content.Shared.Hands; using Content.Shared.Hands.EntitySystems; +using Content.Shared.IdentityManagement; using Content.Shared.Input; using Content.Shared.Interaction; using Content.Shared.Item; @@ -46,6 +47,7 @@ public sealed class PullingSystem : EntitySystem [Dependency] private readonly SharedInteractionSystem _interaction = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly HeldSpeedModifierSystem _clothingMoveSpeed = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; public override void Initialize() { @@ -326,7 +328,6 @@ public sealed class PullingSystem : EntitySystem RaiseLocalEvent(pullableUid, message); } - _alertsSystem.ClearAlert(pullableUid, pullableComp.PulledAlert); } @@ -514,6 +515,10 @@ public sealed class PullingSystem : EntitySystem Dirty(pullerUid, pullerComp); Dirty(pullableUid, pullableComp); + var pullingMessage = + Loc.GetString("getting-pulled-popup", ("puller", Identity.Entity(pullerUid, EntityManager))); + _popup.PopupEntity(pullingMessage, pullableUid, pullableUid); + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(pullerUid):user} started pulling {ToPrettyString(pullableUid):target}"); return true; diff --git a/Resources/Locale/en-US/movement/pulling.ftl b/Resources/Locale/en-US/movement/pulling.ftl new file mode 100644 index 0000000000..13349a9cfa --- /dev/null +++ b/Resources/Locale/en-US/movement/pulling.ftl @@ -0,0 +1 @@ +getting-pulled-popup = { CAPITALIZE(THE($puller)) } begins pulling you.