Weapon hud fix

This commit is contained in:
Marco 2025-05-08 11:07:23 +02:00
commit 19da648f62
3 changed files with 17 additions and 3 deletions

View file

@ -23,8 +23,15 @@ public partial class InventoryManager : Node2D
[Signal]
public delegate void ItemRemovedEventHandler(string itemKey, int currentAmount);
[Signal]
public delegate void WeaponEquipEventHandler(string itemKey);
/// <summary>
/// Use when equipping a weapon from the inventory screen
/// </summary>
[Signal] public delegate void WeaponEquipEventHandler(string itemKey);
/// <summary>
/// Use when updating the weapon shown on the hud
/// </summary>
[Signal] public delegate void WeaponUpdateEventHandler(string itemKey);
[Signal]
public delegate void ItemUsedEventHandler(LootItem itemKey, int totalCount);
@ -208,6 +215,11 @@ public partial class InventoryManager : Node2D
GD.Print($"Items after loading: {_itemsDict.Count}");
}
public void UpdateEquippedWeapon(string itemKey)
{
EmitSignalWeaponUpdate(itemKey);
}
}
public class ItemContainer