Move items
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Inventory;
|
||||
|
||||
public partial class SlotUi : Control
|
||||
{
|
||||
public Label nameLabel;
|
||||
public int index;
|
||||
|
||||
[Signal] public delegate void ClickedEventHandler(int index);
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
nameLabel = GetNode<Label>("NameLabel");
|
||||
}
|
||||
|
||||
public void _on_gui_input(InputEvent ev)
|
||||
{
|
||||
if (ev is not InputEventMouseButton mev) return;
|
||||
|
||||
if (mev.Pressed)
|
||||
{
|
||||
EmitSignalClicked(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user