diff --git a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs index 32339eb03ac5bf..6d4d332479fdac 100644 --- a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs +++ b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs @@ -8,6 +8,7 @@ using Robust.Shared.Input.Binding; using Robust.Shared.Map; using Robust.Shared.Player; +using Robust.Shared.Utility; namespace Content.Shared.Hands.EntitySystems; @@ -181,27 +182,21 @@ public bool TryMoveHeldEntityToActiveHand(EntityUid uid, string handName, bool c } //TODO: Actually shows all items/clothing/etc. - private void HandleExamined(EntityUid uid, HandsComponent handsComp, ExaminedEvent args) + private void HandleExamined(EntityUid examinedUid, HandsComponent handsComp, ExaminedEvent args) { - var held = EnumerateHeld(uid, handsComp) - .Where(x => !HasComp(x)).ToList(); + var heldItemNames = EnumerateHeld(examinedUid, handsComp) + .Where(entity => !HasComp(entity)) + .Select(item => FormattedMessage.EscapeText(Identity.Name(item, EntityManager))) + .Select(itemName => Loc.GetString("comp-hands-examine-wrapper", ("item", itemName))) + .ToList(); + + var locKey = heldItemNames.Count != 0 ? "comp-hands-examine" : "comp-hands-examine-empty"; + var locUser = ("user", Identity.Entity(examinedUid, EntityManager)); + var locItems = ("items", ContentLocalizationManager.FormatList(heldItemNames)); using (args.PushGroup(nameof(HandsComponent))) { - if (!held.Any()) - { - args.PushText(Loc.GetString("comp-hands-examine-empty", - ("user", Identity.Entity(uid, EntityManager)))); - return; - } - - var heldList = ContentLocalizationManager.FormatList(held - .Select(x => Loc.GetString("comp-hands-examine-wrapper", - ("item", Identity.Entity(x, EntityManager)))).ToList()); - - args.PushMarkup(Loc.GetString("comp-hands-examine", - ("user", Identity.Entity(uid, EntityManager)), - ("items", heldList))); + args.PushMarkup(Loc.GetString(locKey, locUser, locItems)); } } }