From c6bbb834f7758027c0df338f1520f34fad3befea Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 9 Sep 2025 19:09:34 -0300 Subject: Organização MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/GUI/ItemMenuEntry.cs | 61 ++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 27 deletions(-) (limited to 'scripts/GUI/ItemMenuEntry.cs') diff --git a/scripts/GUI/ItemMenuEntry.cs b/scripts/GUI/ItemMenuEntry.cs index 449c97b..7ee3fcd 100644 --- a/scripts/GUI/ItemMenuEntry.cs +++ b/scripts/GUI/ItemMenuEntry.cs @@ -1,41 +1,48 @@ using Godot; +using TheLegendOfGustav.Entities.Items; + +namespace TheLegendOfGustav.GUI; public partial class ItemMenuEntry : HBoxContainer { - private TextureRect icon; - private Label shortcutLabel; - private Label nameLabel; - private Button activateBtn; - private Button dropBtn; - [Signal] public delegate void ActivateEventHandler(ConsumableItem Item); [Signal] - public delegate void DropEventHandler(ConsumableItem item); - - private ConsumableItem item; + public delegate void DropEventHandler(ConsumableItem Item); - public void Initialize(ConsumableItem item, char? shortcut) { - this.item = item; - nameLabel.Text = item.DisplayName; - if (shortcut != null) { - shortcutLabel.Text = $"{shortcut}"; - } else { - shortcutLabel.Text = ""; - } - icon.Texture = item.Texture; - } + private TextureRect Icon { get; set; } + private Label ShortcutLabel { get; set; } + private Label NameLabel { get; set; } + private Button ActivateBtn { get; set; } + private Button DropBtn { get; set; } + private ConsumableItem Item { get; set; } - public override void _Ready() { + public override void _Ready() + { base._Ready(); - icon = GetNode("Icon"); - shortcutLabel = GetNode