Fix auto transition when changing room without exit_scene event (#462)

Added a new fourth button in room14 to demonstrate this.
Renamed BYPASS_LAST_SCENE to FORCE_LAST_SCENE_NULL to make it a bit clearer.
Made events "finished" and "interrupted" signals connections as ONESHOT (so they are disconnected once the signal was received).

Also removed some unused files, many others remain.
And fixed some bugs here and there.
This commit is contained in:
Julian Murgia
2021-11-25 15:24:33 +01:00
committed by GitHub
parent d867407d01
commit a49e5a2690
19 changed files with 154 additions and 119 deletions

View File

@@ -3,10 +3,11 @@
# This event demonstrates the following:
#- fade out to black
#- show the main menu (automatic transition disabled to manage those manually)
#- show the pause menu (automatic transition disabled to manage those manually)
#- wait 2 seconds
#- change scene (automatic transition disabled to managed those manually) to reload this same room
#- change scene (automatic transition disabled to manage those manually) to reload this same room
set_global transition_manual true
# Fade out to black
transition fade_black out
@@ -32,6 +33,6 @@ wait 1
# If you transition IN here instead of room's :setup event, you will show the previous room
# Change scene to same scene, disabled automatic transition
change_scene res://game/rooms/room14/room14.tscn true
change_scene res://game/rooms/room14/room14.tscn false
# Do not transition here either, as change_scene ends the execution of this script

View File

@@ -0,0 +1,28 @@
:use
# This event demonstrates the following:
#- fade out to black
#- show the pause menu (automatic transition disabled to manage those manually)
#- wait 2 seconds
#- change scene (automatic transition enabled) to reload this same room
set_global transition_manual false
# Fade out to black
transition fade_black out
wait 2
# Show main menu, automatic transition DISABLED
show_menu pause
# Showing menu
transition shards in
# Wait 2 seconds on menu
wait 2
# Change scene to same scene, enabled automatic transition
change_scene res://game/rooms/room14/room14.tscn

View File

@@ -14,8 +14,8 @@
stop
# If we're coming from the same room as this one, we manage the player's position
# AND the transition IN manually
> [eq ESC_LAST_SCENE room14]
# AND the transition IN manually if we pushed that button
> [eq ESC_LAST_SCENE room14, transition_manual]
teleport player start
# Set player look left
@@ -25,6 +25,15 @@
transition fade_black in
stop
# If we're coming from the same room as this one, we manage the player's position only
> [eq ESC_LAST_SCENE room14, !transition_manual]
teleport player start
# Set player look left
set_angle player 270
stop
:ready
queue_event worker moveworker