summaryrefslogtreecommitdiffstats
path: root/dialogue.gd
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-02-05 22:02:42 +0200
committerJan Tuomi <jan@jantuomi.fi>2026-02-05 23:11:06 +0200
commit8967f6bb6e8ecb3b5b4073424692ce0ddfec61cb (patch)
tree5961c0b5226d077c6b1e97c02c1f5fcc1d6a729f /dialogue.gd
parentf53d1d99707c5063a35c0c68890e0947077108ad (diff)
Rework cinematicsHEADmain
Diffstat (limited to 'dialogue.gd')
-rw-r--r--dialogue.gd47
1 files changed, 0 insertions, 47 deletions
diff --git a/dialogue.gd b/dialogue.gd
deleted file mode 100644
index 311d5e2..0000000
--- a/dialogue.gd
+++ /dev/null
@@ -1,47 +0,0 @@
-class_name Dialogue
-extends Node
-
-signal next(arg: Variant)
-
-@onready var parent: Node2D = get_parent()
-@onready var cam: GameCamera = parent.get_node("GameCamera")
-
-enum Type { SAY, ASK }
-var type: Type
-
-func say(who: Object, text: String):
- var tb: TextBubble = preload("res://text_bubble.tscn").instantiate()
- tb.text = text
- if who is Node2D:
- tb.global_position = who.global_position + Vector2(0, -20)
- else:
- tb.global_position = cam.global_position
-
- tb.add_to_group("text_bubbles")
- parent.add_child(tb)
- type = Type.SAY
- await next
-
-func ask(who: Object, text: String, options: Array[String]) -> String:
- var tb: TextBubble = preload("res://text_bubble.tscn").instantiate()
- tb.text = text
- tb.options = options
- tb.connect("answered", _on_answered)
- if who is Node2D:
- tb.global_position = who.global_position + Vector2(0, -20)
- else:
- tb.global_position = cam.global_position
-
- tb.add_to_group("text_bubbles")
- parent.add_child(tb)
- type = Type.ASK
- return await next
-
-func _process(_delta: float):
- if type == Type.SAY and (Input.is_action_just_pressed("action") or Input.is_action_just_pressed("jump")):
- get_tree().call_group("text_bubbles", "queue_free")
- next.emit()
-
-func _on_answered(answer: String):
- get_tree().call_group("text_bubbles", "queue_free")
- next.emit(answer)