From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:48:45 +0000 (+0100) Subject: polymorph popup fixes (#35796) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d8ac1524efee1e20d6fcfe22052c8645eaec0ad8;p=space-station-14.git polymorph popup fixes (#35796) polymorph fixes --- diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.cs index 8adab1e00d..e305109ad5 100644 --- a/Content.Server/Polymorph/Systems/PolymorphSystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphSystem.cs @@ -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(); @@ -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; diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 1745730647..3d2d263652 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -416,7 +416,7 @@ public abstract partial class SharedBuckleSystem public bool TryUnbuckle(Entity 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)) diff --git a/Content.Shared/Polymorph/PolymorphPrototype.cs b/Content.Shared/Polymorph/PolymorphPrototype.cs index c057669408..07901b1857 100644 --- a/Content.Shared/Polymorph/PolymorphPrototype.cs +++ b/Content.Shared/Polymorph/PolymorphPrototype.cs @@ -128,6 +128,18 @@ public sealed partial record PolymorphConfiguration /// [DataField] public SoundSpecifier? ExitPolymorphSound; + + /// + /// If not null, this popup will be displayed when being polymorphed into something. + /// + [DataField] + public LocId? PolymorphPopup = "polymorph-popup-generic"; + + /// + /// If not null, this popup will be displayed when when being reverted from a polymorph. + /// + [DataField] + public LocId? ExitPolymorphPopup = "polymorph-revert-popup-generic"; } public enum PolymorphInventoryChange : byte diff --git a/Resources/Locale/en-US/polymorph/polymorph.ftl b/Resources/Locale/en-US/polymorph/polymorph.ftl index 0066196b03..ac78eb6bb4 100644 --- a/Resources/Locale/en-US/polymorph/polymorph.ftl +++ b/Resources/Locale/en-US/polymorph/polymorph.ftl @@ -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}.