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>();
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;
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))
/// </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
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}.