Reformat hand examine text (#20842)

This commit is contained in:
Nemanja
2023-10-08 17:01:18 -04:00
committed by GitHub
parent 7adbf78b12
commit 25a6912667
2 changed files with 19 additions and 6 deletions

View 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)));
}
}

View 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