]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Reformat hand examine text (#20842)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sun, 8 Oct 2023 21:01:18 +0000 (17:01 -0400)
committerGitHub <noreply@github.com>
Sun, 8 Oct 2023 21:01:18 +0000 (14:01 -0700)
Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs
Resources/Locale/en-US/hands/hands-system.ftl

index 1cd9ad9d6e64b18dc894d11e817f61b2f456be1e..d0c3be3b311cddd549b2065ba4d66b65fb321f7b 100644 (file)
@@ -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<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)));
     }
 }
index f9372ae7792ef5871071495a68d662e72355cb5f..7761b0c0ce43a4395c4b9b111ca7465a0ef466ae 100644 (file)
@@ -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