Fix popup on handcuffing for person being handcuffed (#33639)

* Fix popup on handcuffing for person being handcuffed

* wrap onto newlines to appease the style gods
This commit is contained in:
Plykiya 2024-12-27 05:34:32 -08:00 committed by deltanedas
parent bd2e6bbe42
commit 1fcbb599d4
1 changed files with 16 additions and 8 deletions

View File

@ -534,7 +534,7 @@ namespace Content.Shared.Cuffs
{
_popup.PopupClient(Loc.GetString("handcuff-component-start-cuffing-target-message",
("targetName", Identity.Name(target, EntityManager, user))), user, user);
_popup.PopupClient(Loc.GetString("handcuff-component-start-cuffing-by-other-message",
_popup.PopupEntity(Loc.GetString("handcuff-component-start-cuffing-by-other-message",
("otherName", Identity.Name(user, EntityManager, target))), target, target);
}
@ -642,10 +642,14 @@ namespace Content.Shared.Cuffs
_adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}");
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-observer",
("user", Identity.Name(user, EntityManager)), ("target", Identity.Name(target, EntityManager))),
target, Filter.Pvs(target, entityManager: EntityManager)
.RemoveWhere(e => e.AttachedEntity == target || e.AttachedEntity == user), true);
_popup.PopupEntity(
Loc.GetString("cuffable-component-start-uncuffing-observer",
("user", Identity.Name(user, EntityManager)),
("target", Identity.Name(target, EntityManager))),
target,
Filter.Pvs(target, entityManager: EntityManager)
.RemoveWhere(e => e.AttachedEntity == target || e.AttachedEntity == user),
true);
if (target == user)
{
@ -654,9 +658,13 @@ namespace Content.Shared.Cuffs
else
{
_popup.PopupClient(Loc.GetString("cuffable-component-start-uncuffing-target-message",
("targetName", Identity.Name(target, EntityManager, user))), user, user);
_popup.PopupClient(Loc.GetString("cuffable-component-start-uncuffing-by-other-message",
("otherName", Identity.Name(user, EntityManager, target))), target, target);
("targetName", Identity.Name(target, EntityManager, user))),
user,
user);
_popup.PopupEntity(Loc.GetString("cuffable-component-start-uncuffing-by-other-message",
("otherName", Identity.Name(user, EntityManager, target))),
target,
target);
}
_audio.PlayPredicted(isOwner ? cuff.StartBreakoutSound : cuff.StartUncuffSound, target, user);