midori-school/levels/Testrooms/dialogtest.gd

22 lines
600 B
GDScript3
Raw Normal View History

2024-01-27 23:38:20 +01:00
extends Node2D
2024-11-07 21:39:59 +01:00
var talk = load("res://levels/ui/talk.tscn").instance()
2024-01-27 23:38:20 +01:00
# Called when the node enters the scene tree for the first time.
func _ready():
2024-05-11 03:35:07 +02:00
Global.cdialog = [[tr("DIALOG_TEST_0"), true, 0, 0], [tr("DIALOG_TEST_1"), false, 9], [tr("DIALOG_TEST_2"), false, 0]]
2024-01-27 23:38:20 +01:00
Global.live = 0
2024-11-07 21:39:59 +01:00
call_deferred("_talk")
2024-01-27 23:38:20 +01:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
2024-06-17 23:08:25 +02:00
if Global.cdialog.size() != 0 && Global.live == 1:
2024-01-27 23:38:20 +01:00
get_tree().root.remove_child(talk)
2024-06-17 23:08:25 +02:00
Global.cdialog = []
2024-11-07 21:39:59 +01:00
func _talk():
get_tree().root.add_child(talk)