Save/Load rework
This commit is contained in:
+7
-31
@@ -1,12 +1,14 @@
|
||||
extends CanvasLayer
|
||||
|
||||
#UI Elements
|
||||
@onready var next = $UI/SkipContainer/NextButton
|
||||
@onready var confirmation_mask = $ConfirmationMask
|
||||
@onready var masks = $Masks
|
||||
|
||||
#GameOver Scenes
|
||||
@onready var its_game_over = $ITSGameOverControl
|
||||
|
||||
#Signals for progressing through slides
|
||||
signal next_request
|
||||
signal next_slide
|
||||
|
||||
#Signals for saving and loading
|
||||
@@ -55,12 +57,7 @@ func _ready() -> void:
|
||||
|
||||
#Connecting signals
|
||||
#GameOver Signals
|
||||
|
||||
|
||||
#Next Signals
|
||||
next.pressed.connect(_on_next_pressed)
|
||||
self.connect("next_request", _on_next_request)
|
||||
|
||||
|
||||
#Menu Signals
|
||||
$UI/UpperContainer/Menu.pressed.connect(_on_menu_pressed)
|
||||
|
||||
@@ -145,36 +142,15 @@ func ask_confirmation(function_yes: Callable, function_no: Callable, choice_text
|
||||
confirmation_mask.visible = true
|
||||
|
||||
|
||||
|
||||
#Requests next when the Next Button is pressed
|
||||
func _on_next_pressed():
|
||||
next_request.emit()
|
||||
|
||||
|
||||
|
||||
#Requests next when the space key is pressed
|
||||
func _input(event):
|
||||
if event is InputEventKey and event.is_action_released("ui_accept"):
|
||||
next_request.emit()
|
||||
|
||||
|
||||
|
||||
#Makes sure fading transitions are done before approving a next request
|
||||
func _on_next_request():
|
||||
if Globals.is_transitioning == false:
|
||||
next_slide.emit()
|
||||
|
||||
|
||||
|
||||
func _on_menu_pressed():
|
||||
TransitionScreen.mask.visible = true
|
||||
UI.masks.mask.visible = true
|
||||
$UI/Menu.show()
|
||||
|
||||
|
||||
|
||||
#Back to the game
|
||||
func _on_resume_pressed():
|
||||
TransitionScreen.mask.visible = false
|
||||
UI.masks.mask.visible = false
|
||||
$UI/Menu.hide()
|
||||
|
||||
|
||||
@@ -208,7 +184,7 @@ func _on_back_pressed():
|
||||
func _on_back_title_pressed():
|
||||
$UI/Load.hide()
|
||||
$UI/Settings.hide()
|
||||
TransitionScreen.mask.visible = false
|
||||
UI.masks.mask.visible = false
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user