stick-the-quick/ui/FadingSlideshowSlideUI.gd

26 lines
681 B
GDScript3
Raw Permalink Normal View History

class_name FadingSlideshowSlideUI extends Control
@export var next: PackedScene
@export var countdown: float = 6.0
var closing := false
func _input(event: InputEvent) -> void:
if (
event.is_action_released(&'confirm') or
event.is_action_released(&'cancel') or
event.is_action_released(&'interact') or
event.is_action_released(&'pause') or
event.is_action_released(&'alt_pause')
) and not closing:
get_viewport().set_input_as_handled()
closing = true
await Storyboard.go_to_non_level_scene(next)
func _process(delta: float) -> void:
if not closing:
countdown -= delta
if countdown <= 0.0:
closing = true
await Storyboard.go_to_non_level_scene(next)