summaryrefslogtreecommitdiff
path: root/scripts/GUI
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/GUI')
-rw-r--r--scripts/GUI/InventoryMenu.cs10
-rw-r--r--scripts/GUI/ItemMenuEntry.cs12
2 files changed, 11 insertions, 11 deletions
diff --git a/scripts/GUI/InventoryMenu.cs b/scripts/GUI/InventoryMenu.cs
index dd8e133..7e264fa 100644
--- a/scripts/GUI/InventoryMenu.cs
+++ b/scripts/GUI/InventoryMenu.cs
@@ -11,9 +11,9 @@ public partial class InventoryMenu : CanvasLayer
private VBoxContainer itemsNode;
[Signal]
- public delegate void ItemSelectedEventHandler(ConsumableItem item);
+ public delegate void ItemSelectedEventHandler(Item item);
[Signal]
- public delegate void ItemDropEventHandler(ConsumableItem item);
+ public delegate void ItemDropEventHandler(Item item);
public override void _Ready()
{
@@ -23,12 +23,12 @@ public partial class InventoryMenu : CanvasLayer
Hide();
}
- public void OnActivate(ConsumableItem item)
+ public void OnActivate(Item item)
{
EmitSignal(SignalName.ItemSelected, item);
}
- public void OnDrop(ConsumableItem item)
+ public void OnDrop(Item item)
{
EmitSignal(SignalName.ItemDrop, item);
}
@@ -43,7 +43,7 @@ public partial class InventoryMenu : CanvasLayer
Show();
}
- private void RegisterItem(int index, ConsumableItem item)
+ private void RegisterItem(int index, Item item)
{
char? shortcut = null;
diff --git a/scripts/GUI/ItemMenuEntry.cs b/scripts/GUI/ItemMenuEntry.cs
index 6f18bd9..364c694 100644
--- a/scripts/GUI/ItemMenuEntry.cs
+++ b/scripts/GUI/ItemMenuEntry.cs
@@ -11,13 +11,13 @@ public partial class ItemMenuEntry : HBoxContainer
private Label nameLabel;
private Button activateBtn;
private Button dropBtn;
- private ConsumableItem item;
+ private Item item;
[Signal]
- public delegate void ActivateEventHandler(ConsumableItem Item);
+ public delegate void ActivateEventHandler(Item Item);
[Signal]
- public delegate void DropEventHandler(ConsumableItem Item);
+ public delegate void DropEventHandler(Item Item);
public override void _Ready()
{
@@ -32,10 +32,10 @@ public partial class ItemMenuEntry : HBoxContainer
dropBtn.Pressed += () => EmitSignal(SignalName.Drop, item);
}
- public void Initialize(ConsumableItem item, char? shortcut)
+ public void Initialize(Item item, char? shortcut)
{
this.item = item;
- nameLabel.Text = item.DisplayName;
+ nameLabel.Text = item.Definition.DisplayName;
if (shortcut != null)
{
shortcutLabel.Text = $"{shortcut}";
@@ -70,6 +70,6 @@ public partial class ItemMenuEntry : HBoxContainer
{
shortcutLabel.Text = "";
}
- icon.Texture = item.Texture;
+ icon.Texture = item.Definition.Icon;
}
}