using ColdMint.scripts.utils; using Godot; namespace ColdMint.scripts.inventory; /// /// A slot in the inventory /// 物品栏内的一个插槽 /// public partial class ItemSlotNode : MarginContainer, IItemDisplay { private TextureRect? _backgroundTextureRect; private TextureRect? _iconTextureRect; private Label? _quantityLabel; private Control? _control; private Texture2D? _backgroundTexture; private Texture2D? _backgroundTextureWhenSelect; public IItem? Item { get; private set; } 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