]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
polymorph popup fixes (#35796)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Wed, 12 Mar 2025 18:48:45 +0000 (19:48 +0100)
committerGitHub <noreply@github.com>
Wed, 12 Mar 2025 18:48:45 +0000 (19:48 +0100)
polymorph fixes

Content.Server/Polymorph/Systems/PolymorphSystem.cs
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Content.Shared/Polymorph/PolymorphPrototype.cs
Resources/Locale/en-US/polymorph/polymorph.ftl

index 8adab1e00db4187d3a7c794b8efeb0d196f4a7c2..e305109ad54e2f9916089a3221a23f7062ce4f86 100644 (file)
@@ -204,6 +204,12 @@ public sealed partial class PolymorphSystem : EntitySystem
 
         var child = Spawn(configuration.Entity, _transform.GetMapCoordinates(uid, targetTransformComp), rotation: _transform.GetWorldRotation(uid));
 
+        if (configuration.PolymorphPopup != null)
+            _popup.PopupEntity(Loc.GetString(configuration.PolymorphPopup,
+                ("parent", Identity.Entity(uid, EntityManager)),
+                ("child", Identity.Entity(child, EntityManager))),
+                child);
+
         MakeSentientCommand.MakeSentient(child, EntityManager);
 
         var polymorphedComp = _compFact.GetComponent<PolymorphedEntityComponent>();
@@ -347,10 +353,11 @@ public sealed partial class PolymorphSystem : EntitySystem
         var ev = new PolymorphedEvent(uid, parent, true);
         RaiseLocalEvent(uid, ref ev);
 
-        _popup.PopupEntity(Loc.GetString("polymorph-revert-popup-generic",
+        if (component.Configuration.ExitPolymorphPopup != null)
+            _popup.PopupEntity(Loc.GetString(component.Configuration.ExitPolymorphPopup,
                 ("parent", Identity.Entity(uid, EntityManager)),
                 ("child", Identity.Entity(parent, EntityManager))),
-            parent);
+                parent);
         QueueDel(uid);
 
         return parent;
index 1745730647d0f6657c709cbf4bb1771f62b5c082..3d2d263652a4be6dd32a8483e50e0f20cf39d058 100644 (file)
@@ -416,7 +416,7 @@ public abstract partial class SharedBuckleSystem
 
     public bool TryUnbuckle(Entity<BuckleComponent?> buckle, EntityUid? user, bool popup)
     {
-        if (!Resolve(buckle.Owner, ref buckle.Comp))
+        if (!Resolve(buckle.Owner, ref buckle.Comp, false))
             return false;
 
         if (!CanUnbuckle(buckle, user, popup, out var strap))
index c05766940840a7c487a6e7b3b693b80a6ac3f974..07901b1857f0afaceb04adbc866aecfdaa55038d 100644 (file)
@@ -128,6 +128,18 @@ public sealed partial record PolymorphConfiguration
     /// </summary>
     [DataField]
     public SoundSpecifier? ExitPolymorphSound;
+
+    /// <summary>
+    ///     If not null, this popup will be displayed when being polymorphed into something.
+    /// </summary>
+    [DataField]
+    public LocId? PolymorphPopup = "polymorph-popup-generic";
+
+    /// <summary>
+    ///     If not null, this popup will be displayed when when being reverted from a polymorph.
+    /// </summary>
+    [DataField]
+    public LocId? ExitPolymorphPopup = "polymorph-revert-popup-generic";
 }
 
 public enum PolymorphInventoryChange : byte
index 0066196b031c4fdfc2ae371754307f2185a7df4a..ac78eb6bb4761dbd515f6232cd9be9cf52b74c31 100644 (file)
@@ -1,5 +1,5 @@
 polymorph-self-action-name = Polymorph ({CAPITALIZE($target)})
 polymorph-self-action-description = Instantly polymorph yourself into {$target}.
 
-polymorph-popup-generic = {CAPITALIZE($parent)} turned into {$child}.
-polymorph-revert-popup-generic = {CAPITALIZE($parent)} reverted back into {$child}.
+polymorph-popup-generic = {CAPITALIZE(THE($parent))} turned into {$child}.
+polymorph-revert-popup-generic = {CAPITALIZE(THE($parent))} reverted back into {$child}.