extends Node2D

signal button_pushed

onready var activatorArea = $"%ActivatorArea"
onready var indicatorPlayer = $"%IndicatorPlayer"
onready var signal_manager := get_tree().root.get_child(4).get_node("%SignalManager")
onready var unactivatable_timer := $Timer
export(int) var frog_number := 0

var activatable = true

func _ready() -> void:
	$Digit.frame = frog_number


func selfActivate():
	indicatorPlayer.play("onning")
	#TODO dis importante
	self.emit_signal("button_pushed")
	activatorArea.set_deferred("monitoring", false)


func _on_ActivatorArea_area_entered(area:Area2D) -> void:
		$Highlight.visible = true
		if activatable:
			selfActivate()
			activatable = false
