Reverted setting ESC_LAST_SCENE too early in ESCRoom (#464)

This commit is contained in:
Julian Murgia
2021-11-25 23:44:20 +01:00
committed by GitHub
parent a5d7691846
commit 3a43bac46e
2 changed files with 27 additions and 13 deletions

View File

@@ -85,9 +85,9 @@ func run(command_params: Array) -> int:
) )
yield(escoria.main.scene_transition, "transition_done") yield(escoria.main.scene_transition, "transition_done")
# Hide main and pause menus # Hide main and pause menus
escoria.game_scene.hide_main_menu() escoria.game_scene.hide_main_menu()
escoria.game_scene.unpause_game() escoria.game_scene.unpause_game()
# If FORCE_LAST_SCENE_NULL is true, force ESC_LAST_SCENE to empty # If FORCE_LAST_SCENE_NULL is true, force ESC_LAST_SCENE to empty
if escoria.globals_manager.get_global("FORCE_LAST_SCENE_NULL"): if escoria.globals_manager.get_global("FORCE_LAST_SCENE_NULL"):

View File

@@ -147,12 +147,27 @@ func perform_script_events():
":transition_out", ":transition_out",
"transition %s out" % ProjectSettings.get_setting( "transition %s out" % ProjectSettings.get_setting(
"escoria/ui/default_transition" "escoria/ui/default_transition"
) ),
"wait 0.1"
]) ])
escoria.event_manager.queue_event( escoria.event_manager.queue_event(
script_transition_out.events['transition_out'] script_transition_out.events['transition_out']
) )
# Unpause the game if it was
escoria.set_game_paused(false)
# Wait for transition_out event to be done
var rc = yield(escoria.event_manager, "event_finished")
while rc[1] != "transition_out":
rc = yield(escoria.event_manager, "event_finished")
if rc[0] != ESCExecution.RC_OK:
return rc[0]
# Hide main and pause menus
escoria.game_scene.hide_main_menu()
escoria.game_scene.unpause_game()
# Run the setup event # Run the setup event
_run_script_event("setup") _run_script_event("setup")
@@ -178,7 +193,6 @@ func perform_script_events():
if ready_event_added: if ready_event_added:
# Wait for ready event to be done # Wait for ready event to be done
var rc = yield(escoria.event_manager, "event_finished") var rc = yield(escoria.event_manager, "event_finished")
while rc[1] != "ready": while rc[1] != "ready":
rc = yield(escoria.event_manager, "event_finished") rc = yield(escoria.event_manager, "event_finished")
@@ -193,12 +207,12 @@ func perform_script_events():
false, false,
true true
) )
escoria.globals_manager.set_global( escoria.globals_manager.set_global(
"ESC_LAST_SCENE", "ESC_LAST_SCENE",
escoria.main.current_scene.global_id \ escoria.main.current_scene.global_id \
if escoria.main.current_scene != null else "", if escoria.main.current_scene != null else "",
true true
) )
# Runs the script event from the script attached, if any. # Runs the script event from the script attached, if any.