mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
added the game
This commit is contained in:
34
addons/mod_loader/restart_notification.gd
Normal file
34
addons/mod_loader/restart_notification.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
extends Control
|
||||
|
||||
|
||||
@export var wait_time := 20.0
|
||||
|
||||
@onready var timer_label: Label = %TimerLabel
|
||||
@onready var timer: Timer = %Timer
|
||||
|
||||
@onready var restart_button: Button = %RestartButton
|
||||
@onready var cancel_button: Button = %CancelButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
cancel_button.pressed.connect(cancel)
|
||||
restart_button.pressed.connect(restart)
|
||||
restart_button.grab_focus()
|
||||
|
||||
timer.timeout.connect(restart)
|
||||
timer.start(wait_time)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timer_label.text = "%d" % (timer.time_left -1)
|
||||
|
||||
|
||||
func cancel() -> void:
|
||||
timer.stop()
|
||||
hide()
|
||||
queue_free()
|
||||
|
||||
|
||||
func restart() -> void:
|
||||
OS.set_restart_on_exit(true)
|
||||
get_tree().quit()
|
Reference in New Issue
Block a user