diff options
Diffstat (limited to 'scripts/Game.gd')
| -rw-r--r-- | scripts/Game.gd | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/Game.gd b/scripts/Game.gd index bb74c44..25edde0 100644 --- a/scripts/Game.gd +++ b/scripts/Game.gd @@ -1,12 +1,16 @@ extends Node class_name Game +signal dialogue_begin() +signal dialogue_next() +signal dialogue_end() + onready var gui: GUI = $CanvasLayer/GUI var in_dialogue_with: Node = null # Called when the node enters the scene tree for the first time. -func _ready(): +func _ready(): update_debug_gui() connect_signals() @@ -50,6 +54,7 @@ func _on_PlayerCharacter_initiate_dialogue(other: Node): in_dialogue_with = other var dialogues = other.get_dialogue() $CanvasLayer/GUI/BottomRow/DialogueBox.set_visible(true) + emit_signal("dialogue_begin") for i in range(dialogues.size()): var d = dialogues[i] @@ -58,13 +63,9 @@ func _on_PlayerCharacter_initiate_dialogue(other: Node): $CanvasLayer/GUI/BottomRow/DialogueBox/Name.set_text(name) $CanvasLayer/GUI/BottomRow/DialogueBox/Text.set_text(body) print("[%s] %s" % [name, body]) - if dialogues.size() - i > 1: - yield($CanvasLayer/GUI, "dialogue_next") + yield($CanvasLayer/GUI, "dialogue_next") + emit_signal("dialogue_next") - yield($Level/YSort/PlayerCharacter, "end_dialogue") in_dialogue_with = null $CanvasLayer/GUI/BottomRow/DialogueBox.set_visible(false) - - -func _on_GUI_dialogue_next(): - pass # Replace with function body. + emit_signal("dialogue_end") |
