TinyAdventure/systems/InteractionSystem.gd

27 lines
742 B
GDScript
Raw Normal View History

extends Node
signal conversation_started
signal conversation_stopped
var is_conversation_active:bool = false
var player:Player = null
func _ready():
if not DialogueManager.is_connected("dialogue_ended", InteractionSystem.stop_conversation):
DialogueManager.connect("dialogue_ended", InteractionSystem.stop_conversation)
func start_conversation(resource: DialogueResource) -> void:
is_conversation_active = true
print ("Conversation started")
emit_signal("conversation_started")
if player:
player.is_input_blocked = true
func stop_conversation(resource: DialogueResource) -> void:
is_conversation_active = false
print ("Conversation stopped")
emit_signal("conversation_stopped")
if player:
player.is_input_blocked = false