diff --git a/project.godot b/project.godot index 4a6559e..9f441c0 100644 --- a/project.godot +++ b/project.godot @@ -34,6 +34,7 @@ _global_script_class_icons={ config/name="Spy Game Chooser" run/main_scene="res://scenes/Main.tscn" +config/quit_on_go_back=false [display] diff --git a/scenes/Finish.gd b/scenes/Finish.gd index 0ac7d70..99aec48 100644 --- a/scenes/Finish.gd +++ b/scenes/Finish.gd @@ -10,3 +10,7 @@ func _reset() -> void: var transition: int = Scene.Transition.FLY + Scene.Transition.RIGHT + Scene.Transition.FADE var scene: Scene = load("res://scenes/Setup.tscn").instance() _main_scene.change_scene(scene, transition, transition) + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST: + _reset() diff --git a/scenes/GameInfo.gd b/scenes/GameInfo.gd index eb523a6..8c74bea 100644 --- a/scenes/GameInfo.gd +++ b/scenes/GameInfo.gd @@ -19,3 +19,7 @@ func _back() -> void: var transition: int = Scene.Transition.FLY + Scene.Transition.UP + Scene.Transition.FADE var scene: Scene = SETUP.instance() _main_scene.change_scene(scene, transition, transition) + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST: + _back() diff --git a/scenes/PlayerAssignments.gd b/scenes/PlayerAssignments.gd index 99eb5b2..cb7b6ac 100644 --- a/scenes/PlayerAssignments.gd +++ b/scenes/PlayerAssignments.gd @@ -56,3 +56,13 @@ func _wipe_midpoint() -> void: func _wipe_finish() -> void: _wipe.visible = false + +func _back() -> void: + # TODO: Some other transition + var transition: int = Scene.Transition.FLY + Scene.Transition.RIGHT + Scene.Transition.FADE + var scene: Scene = load("res://scenes/Setup.tscn").instance() + _main_scene.change_scene(scene, transition, transition) + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST: + _back() diff --git a/scenes/Setup.gd b/scenes/Setup.gd index ab8eb28..2fac6b3 100644 --- a/scenes/Setup.gd +++ b/scenes/Setup.gd @@ -53,3 +53,7 @@ func _show_game_info() -> void: var scene: Scene = GAME_INFO.instance() scene.games = _possible_games _main_scene.change_scene(scene, transition, transition) + +func _notification(what): + if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST: + get_tree().quit(0)