You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
704 B
32 lines
704 B
using Godot;
|
|
using System;
|
|
|
|
namespace Babushka.scripts.CSharp.Common.Inventory;
|
|
|
|
public partial class SlotUi : Control
|
|
{
|
|
public Label nameLabel;
|
|
public int index;
|
|
public Label amountLabel;
|
|
public TextureRect icon;
|
|
|
|
[Signal] public delegate void ClickedEventHandler(int index);
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
nameLabel = GetNode<Label>("NameLabel");
|
|
amountLabel = GetNode<Label>("AmountLabel");
|
|
icon = GetNode<TextureRect>("Icon");
|
|
}
|
|
|
|
public void _on_gui_input(InputEvent ev)
|
|
{
|
|
if (ev is not InputEventMouseButton mev) return;
|
|
|
|
if (mev.Pressed)
|
|
{
|
|
EmitSignalClicked(index);
|
|
}
|
|
}
|
|
}
|