extends Control


func update_inventory(inventory:Array[String], useFirstIndex:bool = true):
	if inventory.is_empty():
		visible = false;
		return
	
	visible = true;
	var inventory_text = $inventorytext1 if useFirstIndex else $inventorytext2
	inventory_text.clear()
	if !inventory.is_empty():
		inventory_text.append_text("INVENTORY")
	for item in inventory:
		inventory_text.append_text("\n" + item)
	inventory_text.visible = true
	($inventorytext1 if !useFirstIndex else $inventorytext2).visible = false
