mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
25 lines
No EOL
525 B
C#
25 lines
No EOL
525 B
C#
using Cirno.Scripts.Resources;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.UI;
|
|
|
|
[Tool]
|
|
public partial class DebugItemButton : Button
|
|
{
|
|
[Export] public LootItem Item { get; set; }
|
|
|
|
public override void _Ready()
|
|
{
|
|
if (Item is null) return;
|
|
this.Icon = Item.InventorySprite;
|
|
|
|
if (Engine.IsEditorHint()) return;
|
|
this.Pressed += OnPressed;
|
|
}
|
|
|
|
private void OnPressed()
|
|
{
|
|
if (Engine.IsEditorHint()) return;
|
|
InventoryManager.Instance.AddItem(Item);
|
|
}
|
|
} |