From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:01:18 +0000 (-0400) Subject: Reformat hand examine text (#20842) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=25a691266726065cff463880407d6bf09bca81e6;p=space-station-14.git Reformat hand examine text (#20842) --- diff --git a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs index 1cd9ad9d6e..d0c3be3b31 100644 --- a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs +++ b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs @@ -1,7 +1,9 @@ +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; @@ -180,12 +182,21 @@ public abstract partial class SharedHandsSystem : EntitySystem //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(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(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))); } } diff --git a/Resources/Locale/en-US/hands/hands-system.ftl b/Resources/Locale/en-US/hands/hands-system.ftl index f9372ae779..7761b0c0ce 100644 --- a/Resources/Locale/en-US/hands/hands-system.ftl +++ b/Resources/Locale/en-US/hands/hands-system.ftl @@ -4,6 +4,8 @@ hands-system-empty-equipment-slot = There's nothing in your {$slotName} to take # 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