summaryrefslogtreecommitdiffstats
path: root/scripts/Game.gd
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@valuemotive.com>2020-08-01 20:27:03 +0300
committerJan Tuomi <jan.tuomi@valuemotive.com>2020-08-01 20:27:03 +0300
commitc438ce2976c4dda931918c019a25e00104d0cbc2 (patch)
tree5e8a1a6818fe82d6a51fba3a1040a40c1f6bad94 /scripts/Game.gd
parentf89994a8558ba59388c77b968ce5712bd709e15a (diff)
Improve dialogue system
Diffstat (limited to 'scripts/Game.gd')
-rw-r--r--scripts/Game.gd9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/Game.gd b/scripts/Game.gd
index 09dd538..bb74c44 100644
--- a/scripts/Game.gd
+++ b/scripts/Game.gd
@@ -51,13 +51,20 @@ func _on_PlayerCharacter_initiate_dialogue(other: Node):
var dialogues = other.get_dialogue()
$CanvasLayer/GUI/BottomRow/DialogueBox.set_visible(true)
- for d in dialogues:
+ for i in range(dialogues.size()):
+ var d = dialogues[i]
var name = d["name"]
var body = d["body"]
$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($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.