From 0489ed3ef4c92b67e28345e11cde0350100163bb Mon Sep 17 00:00:00 2001 From: Ryan Davies Date: Sat, 25 Nov 2023 00:43:38 +0000 Subject: [PATCH] Grab focus on level completed --- level_completed.gd | 4 ---- world.gd | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/level_completed.gd b/level_completed.gd index ef6955e..099923a 100644 --- a/level_completed.gd +++ b/level_completed.gd @@ -9,10 +9,6 @@ signal next_level @onready var best_time_label = %BestTimeLabel -func _ready(): - next_level_button.grab_focus() - - func set_times(your_time, best_time): your_time_label.text = "Your Time: " + str(your_time / 1000.0) best_time_label.text = "Best Time: " + str(best_time / 1000.0) diff --git a/world.gd b/world.gd index a27e2b6..20608c6 100644 --- a/world.gd +++ b/world.gd @@ -35,11 +35,11 @@ func _process(_delta): func show_level_completed(): level_completed.show() - var level_name = get_tree().current_scene.name HighScores.add_time(level_name, level_time) level_completed.set_times(level_time, HighScores.get_best_time(level_name)) level_time_label.visible = false + level_completed.next_level_button.grab_focus() get_tree().paused = true