From 155f6a418fbe8d6a39a6d889b373b55f62c87cbc Mon Sep 17 00:00:00 2001 From: Varen Date: Fri, 1 Sep 2023 17:09:58 +0200 Subject: [PATCH] Items will display size when examined. (#19703) --- Content.Shared/Item/SharedItemSystem.cs | 9 +++++++++ .../Locale/en-US/items/components/item-component.ftl | 2 ++ 2 files changed, 11 insertions(+) diff --git a/Content.Shared/Item/SharedItemSystem.cs b/Content.Shared/Item/SharedItemSystem.cs index cca871d153..bda92c500a 100644 --- a/Content.Shared/Item/SharedItemSystem.cs +++ b/Content.Shared/Item/SharedItemSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Stacks; using Content.Shared.Verbs; +using Content.Shared.Examine; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; @@ -26,6 +27,8 @@ public abstract class SharedItemSystem : EntitySystem SubscribeLocalEvent(OnGetState); SubscribeLocalEvent(OnHandleState); + + SubscribeLocalEvent(OnExamine); } #region Public API @@ -129,6 +132,12 @@ public abstract class SharedItemSystem : EntitySystem args.Verbs.Add(verb); } + private void OnExamine(EntityUid uid, ItemComponent component, ExaminedEvent args) + { + args.PushMarkup(Loc.GetString("item-component-on-examine-size", + ("size", component.Size))); + } + /// /// Notifies any entity that is holding or wearing this item that they may need to update their sprite. /// diff --git a/Resources/Locale/en-US/items/components/item-component.ftl b/Resources/Locale/en-US/items/components/item-component.ftl index 26512b5c38..f9750a55fa 100644 --- a/Resources/Locale/en-US/items/components/item-component.ftl +++ b/Resources/Locale/en-US/items/components/item-component.ftl @@ -5,3 +5,5 @@ pick-up-verb-get-data-text = Pick Up # "pick up" doesn't make sense if the item is already in their inventory pick-up-verb-get-data-text-inventory = Put in hand + +item-component-on-examine-size = Size: {$size}