Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix popup on handcuffing for person being handcuffed #33639

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Content.Shared/Cuffs/SharedCuffableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public bool TryCuffing(EntityUid user, EntityUid target, EntityUid handcuff, Han
{
_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);
}

Expand Down Expand Up @@ -636,10 +636,14 @@ public void TryUncuff(EntityUid target, EntityUid user, EntityUid? cuffsToRemove

_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)
{
Expand All @@ -648,9 +652,13 @@ public void TryUncuff(EntityUid target, EntityUid user, EntityUid? cuffsToRemove
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);
Expand Down
Loading