From c8a316e4b8987dad963656a34665fa0e23dedcb1 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 22 Apr 2024 16:34:25 +0200 Subject: update --- Scenes/Utilities.gd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Scenes/Utilities.gd') diff --git a/Scenes/Utilities.gd b/Scenes/Utilities.gd index 8dbe666..bcdfe7e 100644 --- a/Scenes/Utilities.gd +++ b/Scenes/Utilities.gd @@ -4,6 +4,8 @@ extends Node const TILE_SIZE = 16 const SCREEN_FADE_DURATION = 0.25 +static var has_dialog = false + func get_level_position(scene) -> Vector2: return self.from_position_to_grid(scene.position) @@ -86,6 +88,18 @@ func fade_bg_music(duration: float = SCREEN_FADE_DURATION): ) +func dialog(timeline: Variant): + if not self.has_dialog: + self.has_dialog = true + get_tree().paused = true + Dialogic.start(timeline).process_mode = Node.PROCESS_MODE_ALWAYS + Dialogic.process_mode = PROCESS_MODE_ALWAYS + await Dialogic.timeline_ended + get_tree().paused = false + await get_tree().create_timer(0.5).timeout + self.has_dialog = false + + func get_collision_shape_bounds(collision_shape: CollisionShape2D): var shape: Shape2D = collision_shape.shape var bounds -- cgit v1.2.3