extends Area2D signal hover_enter signal hover_exit signal select_primary(event: InputEvent) signal select_secondary(event: InputEvent) #func _on_area_entered(_area: Area2D) -> void: #hover_enter.emit() # # #func _on_area_exited(_area: Area2D) -> void: #hover_exit.emit() func _on_mouse_entered() -> void: if not get_tree().get_first_node_in_group("selection_rectangle").is_active: hover_enter.emit() func _on_mouse_exited() -> void: if not get_tree().get_first_node_in_group("selection_rectangle").is_active: hover_exit.emit() func _on_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void: if event.is_action_pressed("select"): select_primary.emit(event) if event.is_action_pressed("select_secondary"): select_secondary.emit(event)