Untracked Files
This commit is contained in:
27
Scripts/Maps/Connectors/shop_item_label_connector.gd
Normal file
27
Scripts/Maps/Connectors/shop_item_label_connector.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
1
Scripts/Maps/Connectors/shop_item_label_connector.gd.uid
Normal file
1
Scripts/Maps/Connectors/shop_item_label_connector.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cpr710p4wdgx
|
||||
Reference in New Issue
Block a user