Files
tbd-station-14/Content.Client/GameObjects/Components/GUI/StrippableComponent.cs
Víctor Aguilera Puerto c3df108b27 Stripping (#1668)
* Start work on stripping.

* more strippable work

* Stripping works

* Nullable

* MORE NULLABLE

* nullable moment

* life is pain

* Interaction check.

* Update Content.Client/GameObjects/Components/HUD/Inventory/StrippableBoundUserInterface.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Client/GameObjects/Components/HUD/Inventory/StrippableBoundUserInterface.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/HandsComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/HandsComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/HandsComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/StrippableComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/StrippableComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/HandsComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/StrippableComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/StrippableComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Shared/GameObjects/Components/GUI/SharedStrippableComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/GUI/StrippableComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Rename InventoryComponent and HandsComponent's OnChanged event to OnItemChanged

* Apply suggestions from code review

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Use static EquipmentSlotDefines

* Do not expose ContainerSlot on Inventory or Hands.

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
2020-08-15 20:33:42 +02:00

23 lines
738 B
C#

using Content.Client.GameObjects.Components.Items;
using Content.Client.Interfaces.GameObjects.Components.Interaction;
using Content.Shared.GameObjects.Components.GUI;
using Robust.Shared.GameObjects;
namespace Content.Client.GameObjects.Components.GUI
{
[RegisterComponent]
public class StrippableComponent : SharedStrippableComponent, IClientDraggable
{
public bool ClientCanDropOn(CanDropEventArgs eventArgs)
{
return eventArgs.Target.HasComponent<HandsComponent>()
&& eventArgs.Target != eventArgs.Dragged && eventArgs.Target == eventArgs.User;
}
public bool ClientCanDrag(CanDragEventArgs eventArgs)
{
return true;
}
}
}