Items will display size when examined. (#19703)

This commit is contained in:
Varen
2023-09-01 17:09:58 +02:00
committed by GitHub
parent a6d1bf788c
commit 155f6a418f
2 changed files with 11 additions and 0 deletions

View File

@@ -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<ItemComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<ItemComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<ItemComponent, ExaminedEvent>(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)));
}
/// <summary>
/// Notifies any entity that is holding or wearing this item that they may need to update their sprite.
/// </summary>