Items will display size when examined. (#19703)
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Hands.EntitySystems;
|
|||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Stacks;
|
using Content.Shared.Stacks;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
|
using Content.Shared.Examine;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -26,6 +27,8 @@ public abstract class SharedItemSystem : EntitySystem
|
|||||||
|
|
||||||
SubscribeLocalEvent<ItemComponent, ComponentGetState>(OnGetState);
|
SubscribeLocalEvent<ItemComponent, ComponentGetState>(OnGetState);
|
||||||
SubscribeLocalEvent<ItemComponent, ComponentHandleState>(OnHandleState);
|
SubscribeLocalEvent<ItemComponent, ComponentHandleState>(OnHandleState);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<ItemComponent, ExaminedEvent>(OnExamine);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Public API
|
#region Public API
|
||||||
@@ -129,6 +132,12 @@ public abstract class SharedItemSystem : EntitySystem
|
|||||||
args.Verbs.Add(verb);
|
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>
|
/// <summary>
|
||||||
/// Notifies any entity that is holding or wearing this item that they may need to update their sprite.
|
/// Notifies any entity that is holding or wearing this item that they may need to update their sprite.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -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" doesn't make sense if the item is already in their inventory
|
||||||
|
|
||||||
pick-up-verb-get-data-text-inventory = Put in hand
|
pick-up-verb-get-data-text-inventory = Put in hand
|
||||||
|
|
||||||
|
item-component-on-examine-size = Size: {$size}
|
||||||
|
|||||||
Reference in New Issue
Block a user