using System;
using ColdMint.scripts.item;
using ColdMint.scripts.item.itemStacks;
using ColdMint.scripts.map.events;
using ColdMint.scripts.utils;
using Godot;
namespace ColdMint.scripts.inventory;
///
/// A slot in the inventory
/// 物品栏内的一个插槽
///
public partial class ItemSlotNode : MarginContainer
{
private IItemStack? _itemStack;
private TextureRect? _backgroundTextureRect;
private TextureRect? _iconTextureRect;
private Label? _quantityLabel;
private Control? _control;
private bool _isSelect;
private Texture2D? _backgroundTexture;
private Texture2D? _backgroundTextureWhenSelect;
public Action? ItemStackChangeEvent;
public override void _Ready()
{
_backgroundTexture = GD.Load("res://sprites/ui/ItemBarEmpty.png");
_backgroundTextureWhenSelect = GD.Load("res://sprites/ui/ItemBarFocus.png");
_backgroundTextureRect =
GetNode("BackgroundTexture");
_iconTextureRect = GetNode("BackgroundTexture/IconTextureRect");
_quantityLabel = GetNode