2024-11-15 13:09:38 +01:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
2024-11-16 22:01:55 +01:00
|
|
|
func start_conversation(_resource: DialogueResource) -> void:
|
2024-11-15 13:09:38 +01:00
|
|
|
is_conversation_active = true
|
2024-11-16 20:43:21 +01:00
|
|
|
|
2024-11-15 13:09:38 +01:00
|
|
|
if player:
|
|
|
|
player.is_input_blocked = true
|
|
|
|
|
2024-11-16 22:01:55 +01:00
|
|
|
func stop_conversation(_resource: DialogueResource) -> void:
|
2024-11-15 13:09:38 +01:00
|
|
|
is_conversation_active = false
|
|
|
|
|
|
|
|
if player:
|
|
|
|
player.is_input_blocked = false
|
2024-11-17 22:00:24 +01:00
|
|
|
|
|
|
|
func start_chest_open_sequence(chest: Chest) -> void:
|
|
|
|
if chest == null:
|
|
|
|
push_error("Error starting chest open sequence: no chest specified!")
|
|
|
|
|
|
|
|
if player:
|
|
|
|
player.is_input_blocked = true
|
|
|
|
|
|
|
|
chest.chest_opened.connect(on_chest_opened)
|
|
|
|
|
|
|
|
func on_chest_opened(_chest: Chest) -> void:
|
|
|
|
if player:
|
|
|
|
player.is_input_blocked = false
|