Add show_menu and hide_menu ESC commands

Fixes godot-escoria/escoria-issues#48
Fix: tween was stopped_all before starting


Fix: reload locale from settings in ESCGame

Since main menu and pause menu are now loaded from ESCGame and not from escoria.gd, this must be done here.
Fix: small crash in load game

But save and load are broken at the moment...
Fix: check save and load after main menu changes


Required fixes


Fix: manage the game scene better in show and hide_menu


Enh: transition back in to the previous room if there was one


Fix a bug occurring where change_scene awaits forever for setup to end


Reworked change_scene and esc_room implementation to avoid yielding


Added a controller variable to allow new event run in events_manager


Don't empty the events queue if the running_event was interrupted


Fixed transitions and automatic transitions in change_scene

Added trace log level (for esc_compiler in particular)
Fixed various bugs in ESC scripts
Fix a bug where exit_scene happened multiple times where fast walking

Needed to clear the event queue
Fixes ready event was run because BYPASS_LAST_SCENE wrongly set


Inverted parameter "disable_automatic_transitions"

for change_scene, hide_menu, show_menu commands
Fix broken sched_event


Fixes as requested in PR
This commit is contained in:
Julian Murgia
2021-11-11 22:20:36 +01:00
parent 59c03dd9e2
commit c86b802cbb
56 changed files with 998 additions and 317 deletions

View File

@@ -0,0 +1,13 @@
:use
# Show main menu, automatic transitions ENABLED
show_menu main true
# wait 2 seconds
wait 2
# Hide main menu, automatic transitions ENABLED
hide_menu main true

View File

@@ -0,0 +1,37 @@
:use
# This event demonstrates the following:
#- fade out to black
#- show the main 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
# 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
# Transition out before hiding menu
transition fade_black out
# Hide the menu
hide_menu pause
wait 1
# Do NOT transition IN as this transition will be managed by the room's :setup event!
# 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
# Do not transition here either, as change_scene ends the execution of this script

View File

@@ -0,0 +1,13 @@
:use
# Show pause menu, automatic transition are disabled by default
# So we can manage them manually using `transition` ESC command
show_menu pause
# wait 2 seconds
wait 2
# Hide pause menu, automatic transition are disabled by default
# So we can manage them manually using `transition` ESC command
hide_menu pause

View File

@@ -0,0 +1,5 @@
:exit_scene
set_sound_state _sound res://game/sfx/sounds/doorOpen_2.ogg false
change_scene "res://game/rooms/room13/room13.tscn"

View File

@@ -0,0 +1,3 @@
:exit_scene
#set_sound_state _sound res://game/sfx/sounds/doorOpen_2.ogg false
#change_scene "res://game/rooms/room15/room15.tscn"

View File

@@ -0,0 +1,29 @@
:setup
> [eq ESC_LAST_SCENE room13]
teleport player r14_l_exit
# Set player look right
set_angle player 90
stop
> [eq ESC_LAST_SCENE room15]
teleport player r14_r_exit
# Set player look left
set_angle player 270
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]
teleport player start
# Set player look left
set_angle player 270
# Fade in from black
transition fade_black in
stop
:ready