Made items activate directly when picked up

This commit is contained in:
2025-07-05 13:18:19 +02:00
parent 48796de1ba
commit 600d9cfca1
3 changed files with 16 additions and 1 deletions
@@ -11,6 +11,8 @@ public partial class ItemOnGround2D : Node
[Export] public bool IsActive = true;
private int pickUpCounter = 0;
[Signal] public delegate void SuccessfulPickUpEventHandler();
private Label _itemLabel => GetNode<Label>("ItemLabel");
private Label _pickupErrorLabel => GetNode<Label>("PickupErrorLabel");
@@ -38,6 +40,7 @@ public partial class ItemOnGround2D : Node
return;
var result = InventoryManager.Instance.CollectItem(itemInstance.Clone());
EmitSignal(SignalName.SuccessfulPickUp);
if (result == InventoryActionResult.Success)
{
if (!_infiniteSupply)