enabled enforced static typing
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
extends Control
|
||||
class_name PauseMenu
|
||||
class_name PauseMenu extends Control
|
||||
|
||||
signal closed
|
||||
signal closed()
|
||||
|
||||
var options_menu_scene: PackedScene = preload("res://Scenes/Menus/options_menu.tscn")
|
||||
var confirmation_popup_scene: PackedScene = preload("res://Scenes/Menus/confirmation_popup.tscn")
|
||||
|
||||
var options_menu_scene = preload("res://Scenes/Menus/options_menu.tscn")
|
||||
var confirmation_popup_scene = preload("res://Scenes/Menus/confirmation_popup.tscn")
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("Pause"):
|
||||
@@ -18,30 +18,30 @@ func _on_resume_pressed() -> void:
|
||||
|
||||
|
||||
func _on_options_pressed() -> void:
|
||||
var menu = options_menu_scene.instantiate()
|
||||
var menu: OptionsMenu = options_menu_scene.instantiate()
|
||||
add_child(menu)
|
||||
|
||||
|
||||
func _on_quit_to_main_menu_pressed() -> void:
|
||||
var popup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
var popup: ConfirmationPopup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
popup.set_popup("Are you sure you want to quit and return to main menu?", "Yes", "No")
|
||||
popup.completed.connect(return_to_menu)
|
||||
add_child(popup)
|
||||
|
||||
|
||||
func return_to_menu(confirmation):
|
||||
func return_to_menu(confirmation: bool) -> void:
|
||||
if confirmation:
|
||||
Game.scene_switch_main_menu()
|
||||
|
||||
|
||||
func _on_quit_to_desktop_pressed() -> void:
|
||||
var popup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
var popup: ConfirmationPopup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
popup.set_popup("Are you sure you want to quit?", "Yes", "No")
|
||||
popup.completed.connect(quit_game)
|
||||
add_child(popup)
|
||||
|
||||
|
||||
func quit_game(confirmation):
|
||||
func quit_game(confirmation: bool) -> void:
|
||||
if confirmation:
|
||||
Game.quit_to_desktop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user