From de26699cfe5663cc465ff8200ac17ef62f3459b6 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Tue, 26 Mar 2019 13:46:07 +0100 Subject: [PATCH] Pick up verb. --- .../Components/Items/Storage/ItemComponent.cs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index eac141d2f1..843bc08bf1 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -1,6 +1,6 @@ using Content.Server.Interfaces.GameObjects; using SS14.Server.Interfaces.GameObjects; -using System; +using Content.Shared.GameObjects; using SS14.Shared.Interfaces.GameObjects; namespace Content.Server.GameObjects @@ -32,5 +32,27 @@ namespace Content.Server.GameObjects hands.PutInHand(this, hands.ActiveIndex, fallback: false); return true; } + + [Verb] + public sealed class PickUpVerb : Verb + { + protected override string GetText(IEntity user, ItemComponent component) + { + return "Pick Up"; + } + + protected override bool IsDisabled(IEntity user, ItemComponent component) + { + return false; + } + + protected override void Activate(IEntity user, ItemComponent component) + { + if (user.TryGetComponent(out HandsComponent hands)) + { + hands.PutInHand(component); + } + } + } } }