]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Popup when being pulled shows who is pulling you (#33612)
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Mon, 9 Dec 2024 03:51:53 +0000 (19:51 -0800)
committerGitHub <noreply@github.com>
Mon, 9 Dec 2024 03:51:53 +0000 (21:51 -0600)
* 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
Resources/Locale/en-US/movement/pulling.ftl [new file with mode: 0644]

index 6392956d632000851b755cf991172c235111b436..b17e34f1711bca85c0d9a3af06fd1b1e177177e2 100644 (file)
@@ -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 (file)
index 0000000..13349a9
--- /dev/null
@@ -0,0 +1 @@
+getting-pulled-popup = { CAPITALIZE(THE($puller)) } begins pulling you.