extends Node3D

@export var mesh: MeshInstance3D
@export var count_label: Label3D


func reflect_bundle(p_bundle: Dictionary) -> void:
	var item = GameState.fetch().INVENTORY_ITEM_DB[p_bundle["item_id"]]
	mesh.material_override.set("shader_parameter/albedo_texture", item.icon)
	if item.stackable:
		count_label.text = str(p_bundle["count"]) + "\n=\n" + str(item.stack_limit)
	else:
		count_label.text = str(p_bundle["count"])
