chore: storing version and changelog
This commit is contained in:
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,3 +1,25 @@
|
|||||||
|
## [4.0.0-alpha.156](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.156) (2022-04-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds instant transitions with an object manager rework, along with ([82acf83](https://github.com/godot-escoria/escoria-demo-game/commit/82acf8374d0d4bc16e57d721149ffa6cedd1997f)), closes [#487](https://github.com/godot-escoria/escoria-demo-game/issues/487)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* accommodate empty parameter ([ecb7bfb](https://github.com/godot-escoria/escoria-demo-game/commit/ecb7bfb528d358b2d9a262601fa446b21ff010f6))
|
||||||
|
* add code to handle scenes run directly from the Godot editor and allow for the current room to be set in the object manager, allowing proper setup ([c87e853](https://github.com/godot-escoria/escoria-demo-game/commit/c87e853ba63e598648cf04e7eeb81152784df601))
|
||||||
|
* allows for proper reloading of all globals (reserved or otherwise); also now properly saves reserved objects; plus a couple small guards to correct issues while quitting after loading games in certain conditions ([7ff0176](https://github.com/godot-escoria/escoria-demo-game/commit/7ff0176d62a21f6a9450b3a63c23231efd7dc979))
|
||||||
|
* break loading up into two batches so objects can be loaded and accessed by other code in the loading method here ([2508786](https://github.com/godot-escoria/escoria-demo-game/commit/2508786cdea3337192f1bc6a9349a8f23a0e9ed1))
|
||||||
|
* eliminates the need to run two batches of ESC commands for loading games by introducing an extra ESC command; also corrects situations where transitions that are mixed and matched don't work together; and additional cleanup ([503d613](https://github.com/godot-escoria/escoria-demo-game/commit/503d6134dd5ba3050287ace1e4d8469e39b5c6d5))
|
||||||
|
* handles the case where no coroutines are run as part of room creation; also fixes a small bug in ESCCamera ([85b86f3](https://github.com/godot-escoria/escoria-demo-game/commit/85b86f38bebecf949da484ec85b81c1e42ba45a0))
|
||||||
|
* makes the loading process more consistent by using all ESC commands; also fixes issue caused by loaded save games not executing :setup or :ready, thereby preventing proper room switching in this case ([84c84d3](https://github.com/godot-escoria/escoria-demo-game/commit/84c84d3a0fdf1e8472bdbce873a13e1dceb68520))
|
||||||
|
* should now also prevent areas from spawning events; also removes a superfluous variable ([6d98e7b](https://github.com/godot-escoria/escoria-demo-game/commit/6d98e7bdce4e9184c5d6af5eb3301e209283c5d5))
|
||||||
|
* we now need to transition in from :ready in the case of manual transitions ([0556ccb](https://github.com/godot-escoria/escoria-demo-game/commit/0556ccbf322130bc3388da212fa7ef4d93009179))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [4.0.0-alpha.155](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.155) (2022-04-07)
|
## [4.0.0-alpha.155](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.155) (2022-04-07)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,14 +50,14 @@ func run(command_params: Array) -> int:
|
|||||||
"",
|
"",
|
||||||
ESCTransitionPlayer.TRANSITION_MODE.OUT
|
ESCTransitionPlayer.TRANSITION_MODE.OUT
|
||||||
)
|
)
|
||||||
|
|
||||||
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||||
while yield(
|
while yield(
|
||||||
escoria.main.scene_transition,
|
escoria.main.scene_transition,
|
||||||
"transition_done"
|
"transition_done"
|
||||||
) != transition_id:
|
) != transition_id:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if command_params[0] == "main":
|
if command_params[0] == "main":
|
||||||
escoria.game_scene.hide_main_menu()
|
escoria.game_scene.hide_main_menu()
|
||||||
elif command_params[0] == "pause":
|
elif command_params[0] == "pause":
|
||||||
@@ -65,12 +65,12 @@ func run(command_params: Array) -> int:
|
|||||||
|
|
||||||
if command_params[1] and escoria.main.current_scene != null:
|
if command_params[1] and escoria.main.current_scene != null:
|
||||||
transition_id = escoria.main.scene_transition.transition()
|
transition_id = escoria.main.scene_transition.transition()
|
||||||
|
|
||||||
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||||
while yield(
|
while yield(
|
||||||
escoria.main.scene_transition,
|
escoria.main.scene_transition,
|
||||||
"transition_done"
|
"transition_done"
|
||||||
) != transition_id:
|
) != transition_id:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return ESCExecution.RC_OK
|
return ESCExecution.RC_OK
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# - *value*: Value to set the global to (can be of type string, boolean, integer
|
# - *value*: Value to set the global to (can be of type string, boolean, integer
|
||||||
# or float)
|
# or float)
|
||||||
# - *force*: if false, setting a global whose name is reserved will
|
# - *force*: if false, setting a global whose name is reserved will
|
||||||
# trigger an error. Defaults to false. Reserved globals are: ESC_LAST_SCENE,
|
# trigger an error. Defaults to false. Reserved globals are: ESC_LAST_SCENE,
|
||||||
# FORCE_LAST_SCENE_NULL, ANIMATION_RESOURCES, ESC_CURRENT_SCENE
|
# FORCE_LAST_SCENE_NULL, ANIMATION_RESOURCES, ESC_CURRENT_SCENE
|
||||||
#
|
#
|
||||||
# @ESC
|
# @ESC
|
||||||
|
|||||||
@@ -49,14 +49,14 @@ func run(command_params: Array) -> int:
|
|||||||
"",
|
"",
|
||||||
ESCTransitionPlayer.TRANSITION_MODE.OUT
|
ESCTransitionPlayer.TRANSITION_MODE.OUT
|
||||||
)
|
)
|
||||||
|
|
||||||
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||||
while yield(
|
while yield(
|
||||||
escoria.main.scene_transition,
|
escoria.main.scene_transition,
|
||||||
"transition_done"
|
"transition_done"
|
||||||
) != transition_id:
|
) != transition_id:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if command_params[0] == "main":
|
if command_params[0] == "main":
|
||||||
escoria.game_scene.show_main_menu()
|
escoria.game_scene.show_main_menu()
|
||||||
elif command_params[0] == "pause":
|
elif command_params[0] == "pause":
|
||||||
@@ -67,7 +67,7 @@ func run(command_params: Array) -> int:
|
|||||||
|
|
||||||
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||||
while yield(
|
while yield(
|
||||||
escoria.main.scene_transition,
|
escoria.main.scene_transition,
|
||||||
"transition_done"
|
"transition_done"
|
||||||
) != transition_id:
|
) != transition_id:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ func run(command_params: Array) -> int:
|
|||||||
else ESCTransitionPlayer.TRANSITION_MODE.IN,
|
else ESCTransitionPlayer.TRANSITION_MODE.IN,
|
||||||
command_params[2]
|
command_params[2]
|
||||||
)
|
)
|
||||||
|
|
||||||
if transition_id == ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
if transition_id == ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||||
escoria.logger.debug("Performing instant transition.")
|
escoria.logger.debug("Performing instant transition.")
|
||||||
escoria.main.scene_transition.reset_shader_cutoff()
|
escoria.main.scene_transition.reset_shader_cutoff()
|
||||||
return ESCExecution.RC_OK
|
return ESCExecution.RC_OK
|
||||||
|
|
||||||
escoria.logger.debug("Starting transition #%s [%s, %s]"
|
escoria.logger.debug("Starting transition #%s [%s, %s]"
|
||||||
% [transition_id, command_params[0], command_params[1]])
|
% [transition_id, command_params[0], command_params[1]])
|
||||||
while yield(
|
while yield(
|
||||||
escoria.main.scene_transition,
|
escoria.main.scene_transition,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func run(command_params: Array) -> int:
|
|||||||
Vector2(command_params[1], command_params[2]), command_params[3]
|
Vector2(command_params[1], command_params[2]), command_params[3]
|
||||||
])
|
])
|
||||||
yield(
|
yield(
|
||||||
(escoria.object_manager.get_object(command_params[0]).node as ESCItem),
|
(escoria.object_manager.get_object(command_params[0]).node as ESCItem),
|
||||||
"arrived"
|
"arrived"
|
||||||
)
|
)
|
||||||
return ESCExecution.RC_OK
|
return ESCExecution.RC_OK
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ const RESERVED_OBJECTS = [
|
|||||||
|
|
||||||
|
|
||||||
# The array of registered objects (organized by room, so each entry is a structure
|
# The array of registered objects (organized by room, so each entry is a structure
|
||||||
# representing a room and its registered objects). This also includes one
|
# representing a room and its registered objects). This also includes one
|
||||||
# "room" for reserved objects; that is, we use one entry of the array to
|
# "room" for reserved objects; that is, we use one entry of the array to
|
||||||
# hold all reserved objects. This entry can be identified by the "is_reserved"
|
# hold all reserved objects. This entry can be identified by the "is_reserved"
|
||||||
# property being set to true.
|
# property being set to true.
|
||||||
#
|
#
|
||||||
# "Reserved objects" are those which are named in the RESERVED_OBJECTS const
|
# "Reserved objects" are those which are named in the RESERVED_OBJECTS const
|
||||||
# array and include objects that are used internally by Escoria in every room,
|
# array and include objects that are used internally by Escoria in every room,
|
||||||
# e.g. a music player, a sound player, a speech player, the main camera.
|
# e.g. a music player, a sound player, a speech player, the main camera.
|
||||||
#
|
#
|
||||||
# In almost all cases, the reserved objects' entry doesn't need updating once
|
# In almost all cases, the reserved objects' entry doesn't need updating once
|
||||||
@@ -129,7 +129,7 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
|||||||
return
|
return
|
||||||
|
|
||||||
var room_key: ESCRoomObjectsKey = ESCRoomObjectsKey.new()
|
var room_key: ESCRoomObjectsKey = ESCRoomObjectsKey.new()
|
||||||
|
|
||||||
# If a room was passed in, then we're going to register the object with it;
|
# If a room was passed in, then we're going to register the object with it;
|
||||||
# otherwise, we register the object with the "current room".
|
# otherwise, we register the object with the "current room".
|
||||||
if room == null or room.global_id.empty():
|
if room == null or room.global_id.empty():
|
||||||
@@ -137,7 +137,7 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
|||||||
# changes.
|
# changes.
|
||||||
room_key.room_global_id = current_room_key.room_global_id
|
room_key.room_global_id = current_room_key.room_global_id
|
||||||
room_key.room_instance_id = current_room_key.room_instance_id
|
room_key.room_instance_id = current_room_key.room_instance_id
|
||||||
|
|
||||||
if not room_key.is_valid():
|
if not room_key.is_valid():
|
||||||
# This condition should very likely never happen.
|
# This condition should very likely never happen.
|
||||||
escoria.logger.report_errors(
|
escoria.logger.report_errors(
|
||||||
@@ -157,7 +157,7 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
|||||||
escoria.logger.report_errors(
|
escoria.logger.report_errors(
|
||||||
"ESCObjectManager:register_object()",
|
"ESCObjectManager:register_object()",
|
||||||
[
|
[
|
||||||
"Object with global id %s in room (%s, %s) already registered" %
|
"Object with global id %s in room (%s, %s) already registered" %
|
||||||
[
|
[
|
||||||
object.global_id,
|
object.global_id,
|
||||||
room_key.room_global_id,
|
room_key.room_global_id,
|
||||||
@@ -173,8 +173,8 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
|||||||
# overwritten ("forced") in the future and, if it is, if it's set to
|
# overwritten ("forced") in the future and, if it is, if it's set to
|
||||||
# auto-unregister or not. In most cases, objects are set to auto unregister.
|
# auto-unregister or not. In most cases, objects are set to auto unregister.
|
||||||
if object.node.is_connected(
|
if object.node.is_connected(
|
||||||
"tree_exited",
|
"tree_exited",
|
||||||
self,
|
self,
|
||||||
"unregister_object"
|
"unregister_object"
|
||||||
):
|
):
|
||||||
object.node.disconnect(
|
object.node.disconnect(
|
||||||
@@ -184,27 +184,27 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
|||||||
)
|
)
|
||||||
|
|
||||||
if force:
|
if force:
|
||||||
# If this ID already exists and we're about to overwrite it, do the
|
# If this ID already exists and we're about to overwrite it, do the
|
||||||
# safe thing and unregister the old object first
|
# safe thing and unregister the old object first
|
||||||
unregister_object_by_global_id(object.global_id, room_key)
|
unregister_object_by_global_id(object.global_id, room_key)
|
||||||
|
|
||||||
if auto_unregister:
|
if auto_unregister:
|
||||||
object.node.connect(
|
object.node.connect(
|
||||||
"tree_exited",
|
"tree_exited",
|
||||||
self,
|
self,
|
||||||
"unregister_object",
|
"unregister_object",
|
||||||
[object, room_key]
|
[object, room_key]
|
||||||
)
|
)
|
||||||
|
|
||||||
if "is_interactive" in object.node and object.node.is_interactive:
|
if "is_interactive" in object.node and object.node.is_interactive:
|
||||||
object.interactive = true
|
object.interactive = true
|
||||||
|
|
||||||
if "esc_script" in object.node and not object.node.esc_script.empty():
|
if "esc_script" in object.node and not object.node.esc_script.empty():
|
||||||
var script = escoria.esc_compiler.load_esc_file(
|
var script = escoria.esc_compiler.load_esc_file(
|
||||||
object.node.esc_script
|
object.node.esc_script
|
||||||
)
|
)
|
||||||
object.events = script.events
|
object.events = script.events
|
||||||
|
|
||||||
var objects: Dictionary = _get_room_objects_objects(room_key)
|
var objects: Dictionary = _get_room_objects_objects(room_key)
|
||||||
objects[object.global_id] = object
|
objects[object.global_id] = object
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ func has(global_id: String, room: ESCRoom = null) -> bool:
|
|||||||
return reserved_objects_container.objects.has(global_id)
|
return reserved_objects_container.objects.has(global_id)
|
||||||
|
|
||||||
var room_key: ESCRoomObjectsKey
|
var room_key: ESCRoomObjectsKey
|
||||||
|
|
||||||
if room == null:
|
if room == null:
|
||||||
escoria.logger.trace("ESCObjectManager.has(): No room specified." \
|
escoria.logger.trace("ESCObjectManager.has(): No room specified." \
|
||||||
+ " Defaulting to current room."
|
+ " Defaulting to current room."
|
||||||
@@ -246,7 +246,7 @@ func has(global_id: String, room: ESCRoom = null) -> bool:
|
|||||||
room_key = ESCRoomObjectsKey.new()
|
room_key = ESCRoomObjectsKey.new()
|
||||||
room_key.room_global_id = room.global_id
|
room_key.room_global_id = room.global_id
|
||||||
room_key.room_instance_id = room.get_instance_id()
|
room_key.room_instance_id = room.get_instance_id()
|
||||||
|
|
||||||
if not _room_exists(room_key):
|
if not _room_exists(room_key):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ func has(global_id: String, room: ESCRoom = null) -> bool:
|
|||||||
#
|
#
|
||||||
# - global_id: The global id of the object to retrieve
|
# - global_id: The global id of the object to retrieve
|
||||||
# - room: ESCRoom instance the object is registered with.
|
# - room: ESCRoom instance the object is registered with.
|
||||||
# ***Returns*** The retrieved object, or null if not found
|
# ***Returns*** The retrieved object, or null if not found
|
||||||
func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
|
func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
|
||||||
if global_id in RESERVED_OBJECTS:
|
if global_id in RESERVED_OBJECTS:
|
||||||
if reserved_objects_container.objects.has(global_id):
|
if reserved_objects_container.objects.has(global_id):
|
||||||
@@ -268,7 +268,7 @@ func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
|
|||||||
escoria.logger.report_warnings(
|
escoria.logger.report_warnings(
|
||||||
"ESCObjectManager:get_object()",
|
"ESCObjectManager:get_object()",
|
||||||
[
|
[
|
||||||
"Reserved object with global id %s not found in object manager!"
|
"Reserved object with global id %s not found in object manager!"
|
||||||
% global_id
|
% global_id
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -291,21 +291,21 @@ func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
|
|||||||
"ESCObjectManager:get_object()",
|
"ESCObjectManager:get_object()",
|
||||||
[
|
[
|
||||||
"Specified room is empty/not found.",
|
"Specified room is empty/not found.",
|
||||||
"Object with global id %s in room instance (%s, %s) not found"
|
"Object with global id %s in room instance (%s, %s) not found"
|
||||||
% [global_id, room_key.room_global_id, room_key.room_instance_id]
|
% [global_id, room_key.room_global_id, room_key.room_instance_id]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
var objects: Dictionary = _get_room_objects_objects(room_key)
|
var objects: Dictionary = _get_room_objects_objects(room_key)
|
||||||
|
|
||||||
if objects.has(global_id):
|
if objects.has(global_id):
|
||||||
return objects[global_id]
|
return objects[global_id]
|
||||||
else:
|
else:
|
||||||
escoria.logger.report_warnings(
|
escoria.logger.report_warnings(
|
||||||
"ESCObjectManager:get_object()",
|
"ESCObjectManager:get_object()",
|
||||||
[
|
[
|
||||||
"Object with global id %s in room instance (%s, %s) not found"
|
"Object with global id %s in room instance (%s, %s) not found"
|
||||||
% [global_id, room_key.room_global_id, room_key.room_instance_id]
|
% [global_id, room_key.room_global_id, room_key.room_instance_id]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -333,10 +333,10 @@ func unregister_object(object: ESCObject, room_key: ESCRoomObjectsKey) -> void:
|
|||||||
room_key.room_global_id,
|
room_key.room_global_id,
|
||||||
room_key.room_instance_id
|
room_key.room_instance_id
|
||||||
],
|
],
|
||||||
"part of a 'forced' registration, ignore this warning."
|
"part of a 'forced' registration, ignore this warning."
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
var room_objects = _get_room_objects_objects(room_key)
|
var room_objects = _get_room_objects_objects(room_key)
|
||||||
@@ -379,11 +379,11 @@ func save_game(p_savegame: ESCSaveGame) -> void:
|
|||||||
"No current room specified or found."
|
"No current room specified or found."
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
var objects: Dictionary = _get_room_objects_objects(current_room_key)
|
var objects: Dictionary = _get_room_objects_objects(current_room_key)
|
||||||
|
|
||||||
p_savegame.objects = {}
|
p_savegame.objects = {}
|
||||||
|
|
||||||
for obj_global_id in objects:
|
for obj_global_id in objects:
|
||||||
if not objects[obj_global_id] is ESCObject:
|
if not objects[obj_global_id] is ESCObject:
|
||||||
continue
|
continue
|
||||||
@@ -473,13 +473,13 @@ func _object_exists_in_room(object: ESCObject, room_key: ESCRoomObjectsKey) -> b
|
|||||||
"Cannot check for null objects."
|
"Cannot check for null objects."
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
return false
|
|
||||||
|
|
||||||
|
return false
|
||||||
|
|
||||||
for room_container in room_objects:
|
for room_container in room_objects:
|
||||||
if _compare_container_to_key(room_container, room_key) \
|
if _compare_container_to_key(room_container, room_key) \
|
||||||
and room_container.objects.has(object.global_id):
|
and room_container.objects.has(object.global_id):
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ func change_scene(room_path: String, enable_automatic_transitions: bool) -> void
|
|||||||
escoria.logger.debug(
|
escoria.logger.debug(
|
||||||
"Awaiting transition %s (out) to be finished." % transition_id
|
"Awaiting transition %s (out) to be finished." % transition_id
|
||||||
)
|
)
|
||||||
|
|
||||||
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()
|
||||||
@@ -229,7 +229,7 @@ func init_room(room: ESCRoom) -> void:
|
|||||||
room,
|
room,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
|
|
||||||
if escoria.globals_manager.has(
|
if escoria.globals_manager.has(
|
||||||
escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
|
escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
|
||||||
):
|
):
|
||||||
@@ -266,7 +266,7 @@ func _perform_script_events(room: ESCRoom) -> void:
|
|||||||
# Used to track whether any yields have been executed before the call to
|
# Used to track whether any yields have been executed before the call to
|
||||||
# set_scene_finish.
|
# set_scene_finish.
|
||||||
var yielded: bool = false
|
var yielded: bool = false
|
||||||
|
|
||||||
if room.enabled_automatic_transitions \
|
if room.enabled_automatic_transitions \
|
||||||
and not room.is_run_directly:
|
and not room.is_run_directly:
|
||||||
var script_transition_out = escoria.esc_compiler.compile([
|
var script_transition_out = escoria.esc_compiler.compile([
|
||||||
@@ -293,17 +293,17 @@ func _perform_script_events(room: ESCRoom) -> void:
|
|||||||
rc = yield(escoria.event_manager, "event_finished")
|
rc = yield(escoria.event_manager, "event_finished")
|
||||||
if rc[0] != ESCExecution.RC_OK:
|
if rc[0] != ESCExecution.RC_OK:
|
||||||
return rc[0]
|
return rc[0]
|
||||||
|
|
||||||
yielded = true
|
yielded = true
|
||||||
|
|
||||||
# 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()
|
||||||
|
|
||||||
var setup_event_added: bool = false
|
var setup_event_added: bool = false
|
||||||
# Run the setup event, if there is one.
|
# Run the setup event, if there is one.
|
||||||
setup_event_added = _run_script_event(escoria.event_manager.EVENT_SETUP, room)
|
setup_event_added = _run_script_event(escoria.event_manager.EVENT_SETUP, room)
|
||||||
|
|
||||||
if setup_event_added:
|
if setup_event_added:
|
||||||
# Wait for setup event to be done
|
# Wait for setup event to be done
|
||||||
var rc = yield(escoria.event_manager, "event_finished")
|
var rc = yield(escoria.event_manager, "event_finished")
|
||||||
@@ -364,7 +364,7 @@ func _perform_script_events(room: ESCRoom) -> void:
|
|||||||
rc = yield(escoria.event_manager, "event_finished")
|
rc = yield(escoria.event_manager, "event_finished")
|
||||||
if rc[0] != ESCExecution.RC_OK:
|
if rc[0] != ESCExecution.RC_OK:
|
||||||
return rc[0]
|
return rc[0]
|
||||||
|
|
||||||
# Now that :ready is finished, if FORCE_LAST_SCENE_NULL was true, reset it
|
# Now that :ready is finished, if FORCE_LAST_SCENE_NULL was true, reset it
|
||||||
# to false
|
# to false
|
||||||
if escoria.globals_manager.get_global( \
|
if escoria.globals_manager.get_global( \
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ func _ready():
|
|||||||
self.pause_mode = Node.PAUSE_MODE_STOP
|
self.pause_mode = Node.PAUSE_MODE_STOP
|
||||||
|
|
||||||
_detect_children()
|
_detect_children()
|
||||||
|
|
||||||
# We add ourselves to this group so we can easily get a reference to all
|
# We add ourselves to this group so we can easily get a reference to all
|
||||||
# items in a scene tree.
|
# items in a scene tree.
|
||||||
add_to_group(GROUP_ITEM_CAN_COLLIDE)
|
add_to_group(GROUP_ITEM_CAN_COLLIDE)
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ func error(string: String, args = [], do_savegame: bool = true):
|
|||||||
|
|
||||||
_log(message, true)
|
_log(message, true)
|
||||||
escoria.set_game_paused(true)
|
escoria.set_game_paused(true)
|
||||||
|
|
||||||
if is_instance_valid(escoria.main.current_scene):
|
if is_instance_valid(escoria.main.current_scene):
|
||||||
escoria.main.current_scene.game.show_crash_popup(files_to_send)
|
escoria.main.current_scene.game.show_crash_popup(files_to_send)
|
||||||
|
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ func load_game(id: int):
|
|||||||
## GLOBALS
|
## GLOBALS
|
||||||
for k in save_game.globals.keys():
|
for k in save_game.globals.keys():
|
||||||
var global_value = save_game.globals[k]
|
var global_value = save_game.globals[k]
|
||||||
|
|
||||||
if global_value is String and global_value.empty():
|
if global_value is String and global_value.empty():
|
||||||
global_value = "''"
|
global_value = "''"
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ func _init():
|
|||||||
# Load settings
|
# Load settings
|
||||||
func _ready():
|
func _ready():
|
||||||
_handle_direct_scene_run()
|
_handle_direct_scene_run()
|
||||||
|
|
||||||
settings = save_manager.load_settings()
|
settings = save_manager.load_settings()
|
||||||
apply_settings(settings)
|
apply_settings(settings)
|
||||||
room_manager.register_reserved_globals()
|
room_manager.register_reserved_globals()
|
||||||
@@ -228,9 +228,9 @@ func set_game_paused(p_paused: bool):
|
|||||||
emit_signal("paused")
|
emit_signal("paused")
|
||||||
else:
|
else:
|
||||||
emit_signal("resumed")
|
emit_signal("resumed")
|
||||||
|
|
||||||
var scene_tree = get_tree()
|
|
||||||
|
|
||||||
|
var scene_tree = get_tree()
|
||||||
|
|
||||||
if is_instance_valid(scene_tree):
|
if is_instance_valid(scene_tree):
|
||||||
scene_tree.paused = p_paused
|
scene_tree.paused = p_paused
|
||||||
|
|
||||||
@@ -368,11 +368,11 @@ func quit():
|
|||||||
# Handle anything necessary if the game started a scene directly.
|
# Handle anything necessary if the game started a scene directly.
|
||||||
func _handle_direct_scene_run() -> void:
|
func _handle_direct_scene_run() -> void:
|
||||||
var current_scene_root: Node = get_tree().get_current_scene()
|
var current_scene_root: Node = get_tree().get_current_scene()
|
||||||
|
|
||||||
if current_scene_root.filename == ProjectSettings.get_setting('application/run/main_scene'):
|
if current_scene_root.filename == ProjectSettings.get_setting('application/run/main_scene'):
|
||||||
# This is a normal, full-game run, so there's nothing to do.
|
# This is a normal, full-game run, so there's nothing to do.
|
||||||
return
|
return
|
||||||
|
|
||||||
if current_scene_root is ESCRoom:
|
if current_scene_root is ESCRoom:
|
||||||
escoria.object_manager.set_current_room(current_scene_root)
|
escoria.object_manager.set_current_room(current_scene_root)
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func set_scene(p_scene: Node) -> void:
|
|||||||
escoria.logger.report_errors("main", ["Trying to set empty scene"])
|
escoria.logger.report_errors("main", ["Trying to set empty scene"])
|
||||||
|
|
||||||
previous_scene = current_scene
|
previous_scene = current_scene
|
||||||
|
|
||||||
if is_instance_valid(previous_scene):
|
if is_instance_valid(previous_scene):
|
||||||
_disable_collisions()
|
_disable_collisions()
|
||||||
|
|
||||||
@@ -52,14 +52,14 @@ func set_scene(p_scene: Node) -> void:
|
|||||||
p_scene.visible = false
|
p_scene.visible = false
|
||||||
|
|
||||||
escoria.object_manager.set_current_room(p_scene)
|
escoria.object_manager.set_current_room(p_scene)
|
||||||
add_child(p_scene)
|
add_child(p_scene)
|
||||||
|
|
||||||
# In cases where the room being created doesn't return because of a
|
# In cases where the room being created doesn't return because of a
|
||||||
# coroutine, finish_current_scene_init() will already have been called
|
# coroutine, finish_current_scene_init() will already have been called
|
||||||
# and so we don't want to risk repeating ourselves.
|
# and so we don't want to risk repeating ourselves.
|
||||||
if p_scene == current_scene:
|
if p_scene == current_scene:
|
||||||
return
|
return
|
||||||
|
|
||||||
# This actually moves the scene closest to the root node, but will
|
# This actually moves the scene closest to the root node, but will
|
||||||
# still be drawn behind the next node, which should be the previous
|
# still be drawn behind the next node, which should be the previous
|
||||||
# room.
|
# room.
|
||||||
@@ -72,7 +72,7 @@ func set_scene(p_scene: Node) -> void:
|
|||||||
set_camera_limits()
|
set_camera_limits()
|
||||||
|
|
||||||
|
|
||||||
# Only called by the room manager in the case where it hasn't executed a
|
# Only called by the room manager in the case where it hasn't executed a
|
||||||
# coroutine prior to calling set_scene_finish().
|
# coroutine prior to calling set_scene_finish().
|
||||||
#
|
#
|
||||||
# ### Parameters
|
# ### Parameters
|
||||||
@@ -82,7 +82,7 @@ func finish_current_scene_init(p_scene: Node) -> void:
|
|||||||
move_child(p_scene, 0)
|
move_child(p_scene, 0)
|
||||||
|
|
||||||
current_scene = p_scene
|
current_scene = p_scene
|
||||||
|
|
||||||
check_game_scene_methods()
|
check_game_scene_methods()
|
||||||
|
|
||||||
set_camera_limits()
|
set_camera_limits()
|
||||||
@@ -92,7 +92,7 @@ func finish_current_scene_init(p_scene: Node) -> void:
|
|||||||
# appropriate time.
|
# appropriate time.
|
||||||
func set_scene_finish() -> void:
|
func set_scene_finish() -> void:
|
||||||
current_scene.visible = true
|
current_scene.visible = true
|
||||||
|
|
||||||
if previous_scene != null:
|
if previous_scene != null:
|
||||||
clear_scene()
|
clear_scene()
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ func check_game_scene_methods():
|
|||||||
func _is_same_scene(scene_1: Node, scene_2: Node) -> bool:
|
func _is_same_scene(scene_1: Node, scene_2: Node) -> bool:
|
||||||
if scene_1 is ESCRoom and scene_2 is ESCRoom:
|
if scene_1 is ESCRoom and scene_2 is ESCRoom:
|
||||||
return scene_1.global_id == scene_2.global_id
|
return scene_1.global_id == scene_2.global_id
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
||||||
@@ -246,11 +246,11 @@ func _is_same_scene(scene_1: Node, scene_2: Node) -> bool:
|
|||||||
# game tree, collisions won't result.
|
# game tree, collisions won't result.
|
||||||
func _disable_collisions() -> void:
|
func _disable_collisions() -> void:
|
||||||
var items_to_disable = previous_scene.get_tree().get_nodes_in_group(ESCItem.GROUP_ITEM_CAN_COLLIDE)
|
var items_to_disable = previous_scene.get_tree().get_nodes_in_group(ESCItem.GROUP_ITEM_CAN_COLLIDE)
|
||||||
|
|
||||||
for item in items_to_disable:
|
for item in items_to_disable:
|
||||||
if is_instance_valid(item.collision):
|
if is_instance_valid(item.collision):
|
||||||
item.collision.disabled = true
|
item.collision.disabled = true
|
||||||
if item is Area2D:
|
if item is Area2D:
|
||||||
item.monitoring = false
|
item.monitoring = false
|
||||||
item.monitorable = false
|
item.monitorable = false
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const TRANSITION_ID_INSTANT = -1
|
|||||||
const TRANSITION_INSTANT = "instant"
|
const TRANSITION_INSTANT = "instant"
|
||||||
|
|
||||||
|
|
||||||
# Id of the transition. Allows keeping track of the actual transition
|
# Id of the transition. Allows keeping track of the actual transition
|
||||||
# being played or finished
|
# being played or finished
|
||||||
var transition_id: int = 0
|
var transition_id: int = 0
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ func transition(
|
|||||||
mode: int = TRANSITION_MODE.IN,
|
mode: int = TRANSITION_MODE.IN,
|
||||||
duration: float = 1.0
|
duration: float = 1.0
|
||||||
) -> int:
|
) -> int:
|
||||||
|
|
||||||
if transition_name.empty():
|
if transition_name.empty():
|
||||||
transition_name = escoria.project_settings_manager.get_setting(
|
transition_name = escoria.project_settings_manager.get_setting(
|
||||||
escoria.project_settings_manager.DEFAULT_TRANSITION
|
escoria.project_settings_manager.DEFAULT_TRANSITION
|
||||||
@@ -71,16 +71,16 @@ func transition(
|
|||||||
"transition: Transition %s not found" % transition_name,
|
"transition: Transition %s not found" % transition_name,
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
|
|
||||||
# If this is an "instant" transition, we need to set the alpha of the base
|
# If this is an "instant" transition, we need to set the alpha of the base
|
||||||
# ColorRect to 0, since the transition materials used have a final state
|
# ColorRect to 0, since the transition materials used have a final state
|
||||||
# that sets this scene's root (ColorRect) alpha to 0.
|
# that sets this scene's root (ColorRect) alpha to 0.
|
||||||
if transition_name == TRANSITION_INSTANT:
|
if transition_name == TRANSITION_INSTANT:
|
||||||
color.a = 0
|
color.a = 0
|
||||||
return TRANSITION_ID_INSTANT
|
return TRANSITION_ID_INSTANT
|
||||||
|
|
||||||
|
var material_path = get_transition(transition_name)
|
||||||
|
|
||||||
var material_path = get_transition(transition_name)
|
|
||||||
|
|
||||||
material = ResourceLoader.load(get_transition(transition_name))
|
material = ResourceLoader.load(get_transition(transition_name))
|
||||||
transition_id += 1
|
transition_id += 1
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ func element_focused(element_id: String) -> void:
|
|||||||
if escoria.action_manager.current_action != VERB_USE \
|
if escoria.action_manager.current_action != VERB_USE \
|
||||||
and escoria.action_manager.current_tool == null \
|
and escoria.action_manager.current_tool == null \
|
||||||
and target_obj is ESCItem:
|
and target_obj is ESCItem:
|
||||||
|
|
||||||
$mouse_layer/verbs_menu.set_by_name(
|
$mouse_layer/verbs_menu.set_by_name(
|
||||||
target_obj.default_action
|
target_obj.default_action
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user