mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-15 16:53:47 +00:00
Item HUD management
This commit is contained in:
parent
5110cace07
commit
13c4489017
17 changed files with 215 additions and 44 deletions
|
|
@ -1,12 +1,13 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using Cirno.Scripts.Resources;
|
||||
|
||||
public partial class Hud : CanvasLayer
|
||||
{
|
||||
[Signal]
|
||||
public delegate void StartGameEventHandler();
|
||||
|
||||
private Label _healthLabel;
|
||||
//private Label _healthLabel;
|
||||
|
||||
[Export]
|
||||
public PackedScene SelectorScene { get; set; }
|
||||
|
|
@ -14,10 +15,13 @@ public partial class Hud : CanvasLayer
|
|||
[Export]
|
||||
private Node2D _selector;
|
||||
|
||||
[Export] private Label _healthLabel;
|
||||
[Export] private Container _itemsContainer;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
// Assuming the HUD has a Label node named "HealthLabel"
|
||||
_healthLabel = GetNode<Label>("HealthLabel");
|
||||
//_healthLabel = GetNode<Label>("HealthLabel");
|
||||
}
|
||||
|
||||
public void ShowMessage(string text)
|
||||
|
|
@ -56,4 +60,17 @@ public partial class Hud : CanvasLayer
|
|||
|
||||
//_selector.Position = _selector.tolo
|
||||
}
|
||||
|
||||
public void AddInventoryItem(LootItem item)
|
||||
{
|
||||
TextureRect texture = new TextureRect();
|
||||
texture.Texture = item.InventorySprite;
|
||||
|
||||
_itemsContainer.AddChild(texture);
|
||||
}
|
||||
|
||||
public void RemoveInventoryItem(LootItem item)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue