mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:05:34 +00:00
Item HUD management
This commit is contained in:
parent
5110cace07
commit
13c4489017
17 changed files with 215 additions and 44 deletions
|
|
@ -10,6 +10,12 @@ public partial class InventoryManager : Node2D
|
|||
public bool RedKeycard { get; set; }
|
||||
|
||||
private List<LootItem> _items = new List<LootItem>();
|
||||
|
||||
[Signal]
|
||||
public delegate void ItemAddedEventHandler(LootItem item);
|
||||
|
||||
[Signal]
|
||||
public delegate void ItemRemovedEventHandler(LootItem item);
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
|
|
@ -33,8 +39,10 @@ public partial class InventoryManager : Node2D
|
|||
|
||||
public bool AddItem(ItemTypes type, int amount = 1)
|
||||
{
|
||||
_items.Add(new LootItem() { Item = type, Amount = amount });
|
||||
var item = new LootItem() { Item = type, Amount = amount };
|
||||
_items.Add(item);
|
||||
GD.Print($"Added {type} x{amount}");
|
||||
EmitSignal(nameof(ItemAdded), item);
|
||||
// switch (type)
|
||||
// {
|
||||
// // case ItemTypes.KeycardRed:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue