Actions System + UI (#2710)
Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Content.Client.GameObjects.Components.Items
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(ISharedHandsComponent))]
|
||||
[ComponentReference(typeof(SharedHandsComponent))]
|
||||
public class HandsComponent : SharedHandsComponent
|
||||
{
|
||||
[Dependency] private readonly IGameHud _gameHud = default!;
|
||||
@@ -31,6 +32,18 @@ namespace Content.Client.GameObjects.Components.Items
|
||||
|
||||
[ViewVariables] public IEntity? ActiveHand => GetEntity(ActiveIndex);
|
||||
|
||||
public override bool IsHolding(IEntity entity)
|
||||
{
|
||||
foreach (var hand in _hands)
|
||||
{
|
||||
if (hand.Entity == entity)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void AddHand(Hand hand)
|
||||
{
|
||||
_sprite?.LayerMapReserveBlank($"hand-{hand.Name}");
|
||||
|
||||
Reference in New Issue
Block a user