Reformat hand examine text (#20842)
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
|
using System.Linq;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
|
using Content.Shared.Localizations;
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
@@ -180,12 +182,21 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
//TODO: Actually shows all items/clothing/etc.
|
//TODO: Actually shows all items/clothing/etc.
|
||||||
private void HandleExamined(EntityUid uid, HandsComponent handsComp, ExaminedEvent args)
|
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))
|
args.PushText(Loc.GetString("comp-hands-examine-empty",
|
||||||
continue;
|
("user", Identity.Entity(uid, EntityManager))));
|
||||||
|
return;
|
||||||
args.PushText(Loc.GetString("comp-hands-examine", ("user", Identity.Entity(handsComp.Owner, EntityManager)), ("item", inhand)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
# 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
|
hands-system-blocked-by = Blocked by
|
||||||
|
|||||||
Reference in New Issue
Block a user