2024-09-22 15:13:59 +00:00
|
|
|
using ColdMint.scripts.utils;
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
namespace ColdMint.scripts.inventory;
|
|
|
|
|
|
|
|
public class ItemSlotContainerDisplay(Node rootNode) : ItemContainerDisplayTemplate
|
|
|
|
{
|
2024-10-09 02:49:10 +00:00
|
|
|
private readonly PackedScene? _packedScene = ResourceLoader.Load<PackedScene>("res://prefab/ui/ItemSlot.tscn");
|
2024-09-22 15:13:59 +00:00
|
|
|
|
|
|
|
protected override void AddItemDisplay()
|
|
|
|
{
|
|
|
|
if (_packedScene == null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var itemSlotNode = NodeUtils.InstantiatePackedScene<ItemSlotNode>(_packedScene);
|
|
|
|
if (itemSlotNode == null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ItemDisplayList.Add(itemSlotNode);
|
|
|
|
NodeUtils.CallDeferredAddChild(rootNode, itemSlotNode);
|
|
|
|
}
|
|
|
|
}
|