+using System.Linq;
using Content.Shared.Examine;
using Content.Shared.Hands.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Input;
+using Content.Shared.Localizations;
using Robust.Shared.Input.Binding;
using Robust.Shared.Map;
using Robust.Shared.Players;
//TODO: Actually shows all items/clothing/etc.
private void HandleExamined(EntityUid uid, HandsComponent handsComp, ExaminedEvent args)
{
- foreach (var inhand in EnumerateHeld(uid, handsComp))
+ var held = EnumerateHeld(uid, handsComp).ToList();
+ if (!held.Any())
{
- if (HasComp<HandVirtualItemComponent>(inhand))
- continue;
-
- args.PushText(Loc.GetString("comp-hands-examine", ("user", Identity.Entity(handsComp.Owner, EntityManager)), ("item", inhand)));
+ args.PushText(Loc.GetString("comp-hands-examine-empty",
+ ("user", Identity.Entity(uid, EntityManager))));
+ return;
}
+
+ var heldList = ContentLocalizationManager.FormatList(held
+ .Where(x => !HasComp<HandVirtualItemComponent>(x))
+ .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)));
}
}
# Examine text after when they're holding something (in-hand)
-comp-hands-examine = { CAPITALIZE(SUBJECT($user)) } { CONJUGATE-BE($user) } holding a { $item }.
+comp-hands-examine = { CAPITALIZE(SUBJECT($user)) } { CONJUGATE-BE($user) } holding { $items }.
+comp-hands-examine-empty = { CAPITALIZE(SUBJECT($user)) } { CONJUGATE-BE($user) } not holding anything.
+comp-hands-examine-wrapper = { INDEFINITE($item) } [color=paleturquoise]{$item}[/color]
hands-system-blocked-by = Blocked by