@@ -5,6 +5,9 @@ extends Control
55@onready var title : Label = % Title
66@onready var animated_texture_rect : AnimatedTextureRect = % AnimatedTextureRect
77@onready var rich_text_label : RichTextLabel = % RichTextLabel
8+ @onready var play_button : Button = % PlayButton
9+ @onready var auto_play_progress_bar : ProgressBar = % AutoPlayProgressBar
10+ @onready var auto_play_timer : Timer = % AutoPlayTimer
811
912
1013func _ready () -> void :
@@ -15,14 +18,20 @@ func _ready() -> void:
1518 animated_texture_rect .animation_name = quest .animation_name
1619 rich_text_label .text = quest .description
1720
18- await get_tree ().create_timer (3 ).timeout
21+ play_button .grab_focus ()
22+ play_button .pressed .connect (play )
1923
20- (
21- SceneSwitcher
22- . change_to_file_with_transition (
23- quest .first_scene ,
24- ^ "" ,
25- Transition .Effect .RADIAL ,
26- Transition .Effect .FADE ,
27- )
24+ auto_play_progress_bar .max_value = auto_play_timer .wait_time
25+ auto_play_timer .timeout .connect (play )
26+
27+
28+ func _process (_delta : float ) -> void :
29+ auto_play_progress_bar .value = auto_play_timer .wait_time - auto_play_timer .time_left
30+
31+
32+ func play () -> void :
33+ auto_play_timer .stop ()
34+ var quest := GameState .quest .quest
35+ SceneSwitcher .change_to_file_with_transition (
36+ quest .first_scene , ^ "" , Transition .Effect .RADIAL , Transition .Effect .FADE
2837 )
0 commit comments