Actions System + UI (#2710)
Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
@@ -20,10 +20,13 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
|
||||
/// A character UI which shows items the user has equipped within his inventory
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedInventoryComponent))]
|
||||
public class ClientInventoryComponent : SharedInventoryComponent
|
||||
{
|
||||
private readonly Dictionary<Slots, IEntity> _slots = new();
|
||||
|
||||
public IReadOnlyDictionary<Slots, IEntity> AllSlots => _slots;
|
||||
|
||||
[ViewVariables] public InventoryInterfaceController InterfaceController { get; private set; } = default!;
|
||||
|
||||
private ISpriteComponent? _sprite;
|
||||
@@ -70,6 +73,11 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsEquipped(IEntity item)
|
||||
{
|
||||
return item != null && _slots.Values.Any(e => e == item);
|
||||
}
|
||||
|
||||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
Reference in New Issue
Block a user