Files
Super-Mario-Bros.-Remastere…/Scripts/UI/QuitDialog.gd
KirbyKidJ 19c113ea57 Resource Pack Expansion Pt. 1
- Fixed Disclaimer Screen not playing Sound Effects loaded from the Resource Pack
- Fixed Quit Dialog not playing Beep.wav loaded from Resource Packs
- Fixed the Campaign Icons not loading the Resource Pack textures (in fairness the only icon applicable is the Custom Levels one)
2025-09-15 19:21:19 -07:00

25 lines
614 B
GDScript

extends Control
signal cancelled
var is_active := false
func _ready() -> void:
update()
Global.level_theme_changed.connect(update)
func update() -> void:
$AudioStreamPlayer.stream = $ResourceGetter.get_resource($AudioStreamPlayer.stream)
func _physics_process(delta: float) -> void:
modulate.a = lerpf(modulate.a, int(is_active), delta * 15)
if Input.is_action_just_released("ui_back") and is_active:
cancelled.emit()
is_active = false
$AnimationPlayer.stop()
func start() -> void:
$AnimationPlayer.play("Animation")
is_active = true
await $AnimationPlayer.animation_finished
get_tree().quit()