extends Node

@onready var item_notification: Label = $"../CanvasLayer/Item Notification"

var current_shop_item: ShopItem = null

# Public Methods
func OnPlayerInteractScannerAreaEntered(area: Area2D) -> void:
	if area is not ShopItem:
		return
	
	var shop_item := area as ShopItem
	if shop_item != current_shop_item:
		current_shop_item = shop_item
		var check_location := shop_item.check_location
		var item := GameManager.location_items.CheckItemAtLocation(check_location)
		var item_name: String = Enums.Items.keys()[item]
		item_notification.text = item_name


func OnPlayerInteractScannerAreaExited(area: Area2D) -> void:
	if area is not ShopItem:
		return
	
	if area == current_shop_item:
		item_notification.text = ""
		current_shop_item = null
