Moved the player inventory and selected slot to VesnaEntity

This commit is contained in:
jonathan
2026-02-04 21:32:24 +01:00
parent 7841252809
commit a6fa4315dc
14 changed files with 166 additions and 221 deletions
@@ -1,6 +1,8 @@
using System.Threading.Tasks;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Common.Services;
using Babushka.scripts.CSharp.GameEntity.Entities;
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.Common.Animation;
@@ -27,12 +29,12 @@ public partial class VesnaAnimations : Node
private void SetupSubscriptions()
{
InventoryManager.Instance.playerInventory.InventoryContentsChanged += HandleNewItemInInventory;
EntityManager.Instance.GetUniqueEntity<VesnaEntity>().inventory.InventoryContentsChanged += HandleNewItemInInventory;
}
public override void _ExitTree()
{
InventoryManager.Instance.playerInventory.InventoryContentsChanged -= HandleNewItemInInventory;
EntityManager.Instance.GetUniqueEntity<VesnaEntity>().inventory.InventoryContentsChanged -= HandleNewItemInInventory;
}
private void HandleNewItemInInventory()