extends Area2D

@export var Player : Node2D

@onready var InteractibleManager = $InteractibleManager

@onready var Camera : Camera2D = $Camera2D

var selected = false

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	if Input.is_action_just_pressed("interact") and InteractibleManager.selected:
		if not selected:
			Camera.enabled = true
			Player.Camera.enabled = false
			Player.Frozen = true
			selected = true
			
			get_tree().call_group("Telescope Label", "show")
			
		else:
			Camera.enabled = false
			Player.Camera.enabled = true
			Player.Frozen = false
			selected = false
			
			get_tree().call_group("Telescope Label", "hide")
