Skip to content

Commit

Permalink
chore: storing version and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
StraToN committed Apr 8, 2022
1 parent 6d98e7b commit 431efd8
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 82 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
12 changes: 6 additions & 6 deletions addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@ func run(command_params: Array) -> int:
"",
ESCTransitionPlayer.TRANSITION_MODE.OUT
)

if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
while yield(
escoria.main.scene_transition,
escoria.main.scene_transition,
"transition_done"
) != transition_id:
pass

if command_params[0] == "main":
escoria.game_scene.hide_main_menu()
elif command_params[0] == "pause":
escoria.game_scene.unpause_game()

if command_params[1] and escoria.main.current_scene != null:
transition_id = escoria.main.scene_transition.transition()

if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
while yield(
escoria.main.scene_transition,
escoria.main.scene_transition,
"transition_done"
) != transition_id:
pass

return ESCExecution.RC_OK
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# - *value*: Value to set the global to (can be of type string, boolean, integer
# or float)
# - *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
#
# @ESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ func run(command_params: Array) -> int:
"",
ESCTransitionPlayer.TRANSITION_MODE.OUT
)

if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
while yield(
escoria.main.scene_transition,
escoria.main.scene_transition,
"transition_done"
) != transition_id:
pass

if command_params[0] == "main":
escoria.game_scene.show_main_menu()
elif command_params[0] == "pause":
Expand All @@ -67,7 +67,7 @@ func run(command_params: Array) -> int:

if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
while yield(
escoria.main.scene_transition,
escoria.main.scene_transition,
"transition_done"
) != transition_id:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ func run(command_params: Array) -> int:
else ESCTransitionPlayer.TRANSITION_MODE.IN,
command_params[2]
)

if transition_id == ESCTransitionPlayer.TRANSITION_ID_INSTANT:
escoria.logger.debug("Performing instant transition.")
escoria.main.scene_transition.reset_shader_cutoff()
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]])
while yield(
escoria.main.scene_transition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func run(command_params: Array) -> int:
Vector2(command_params[1], command_params[2]), command_params[3]
])
yield(
(escoria.object_manager.get_object(command_params[0]).node as ESCItem),
(escoria.object_manager.get_object(command_params[0]).node as ESCItem),
"arrived"
)
return ESCExecution.RC_OK
64 changes: 32 additions & 32 deletions addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const RESERVED_OBJECTS = [


# 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
# hold all reserved objects. This entry can be identified by the "is_reserved"
# property being set to true.
#
# "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,
# "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,
# 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
Expand Down Expand Up @@ -129,15 +129,15 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
return

var room_key: ESCRoomObjectsKey = ESCRoomObjectsKey.new()

# 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".
if room == null or room.global_id.empty():
# We duplicate the key so as to not hold a reference when current_room_key
# changes.
room_key.room_global_id = current_room_key.room_global_id
room_key.room_instance_id = current_room_key.room_instance_id

if not room_key.is_valid():
# This condition should very likely never happen.
escoria.logger.report_errors(
Expand All @@ -157,7 +157,7 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
escoria.logger.report_errors(
"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,
room_key.room_global_id,
Expand All @@ -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
# auto-unregister or not. In most cases, objects are set to auto unregister.
if object.node.is_connected(
"tree_exited",
self,
"tree_exited",
self,
"unregister_object"
):
object.node.disconnect(
Expand All @@ -184,27 +184,27 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
)

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
unregister_object_by_global_id(object.global_id, room_key)

if auto_unregister:
object.node.connect(
"tree_exited",
self,
"unregister_object",
"tree_exited",
self,
"unregister_object",
[object, room_key]
)

if "is_interactive" in object.node and object.node.is_interactive:
object.interactive = true

if "esc_script" in object.node and not object.node.esc_script.empty():
var script = escoria.esc_compiler.load_esc_file(
object.node.esc_script
)
object.events = script.events

var objects: Dictionary = _get_room_objects_objects(room_key)
objects[object.global_id] = object

Expand Down Expand Up @@ -235,7 +235,7 @@ func has(global_id: String, room: ESCRoom = null) -> bool:
return reserved_objects_container.objects.has(global_id)

var room_key: ESCRoomObjectsKey

if room == null:
escoria.logger.trace("ESCObjectManager.has(): No room specified." \
+ " Defaulting to current room."
Expand All @@ -246,7 +246,7 @@ func has(global_id: String, room: ESCRoom = null) -> bool:
room_key = ESCRoomObjectsKey.new()
room_key.room_global_id = room.global_id
room_key.room_instance_id = room.get_instance_id()

if not _room_exists(room_key):
return false

Expand All @@ -259,7 +259,7 @@ func has(global_id: String, room: ESCRoom = null) -> bool:
#
# - global_id: The global id of the object to retrieve
# - 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:
if global_id in RESERVED_OBJECTS:
if reserved_objects_container.objects.has(global_id):
Expand All @@ -268,7 +268,7 @@ func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
escoria.logger.report_warnings(
"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
]
)
Expand All @@ -291,21 +291,21 @@ func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
"ESCObjectManager:get_object()",
[
"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]
]
)
return null

var objects: Dictionary = _get_room_objects_objects(room_key)

if objects.has(global_id):
return objects[global_id]
else:
escoria.logger.report_warnings(
"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]
]
)
Expand Down Expand Up @@ -333,10 +333,10 @@ func unregister_object(object: ESCObject, room_key: ESCRoomObjectsKey) -> void:
room_key.room_global_id,
room_key.room_instance_id
],
"part of a 'forced' registration, ignore this warning."
"part of a 'forced' registration, ignore this warning."
]
)

return

var room_objects = _get_room_objects_objects(room_key)
Expand Down Expand Up @@ -379,11 +379,11 @@ func save_game(p_savegame: ESCSaveGame) -> void:
"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 = {}

for obj_global_id in objects:
if not objects[obj_global_id] is ESCObject:
continue
Expand Down Expand Up @@ -473,13 +473,13 @@ func _object_exists_in_room(object: ESCObject, room_key: ESCRoomObjectsKey) -> b
"Cannot check for null objects."
]
)

return false

return false

for room_container in room_objects:
if _compare_container_to_key(room_container, room_key) \
and room_container.objects.has(object.global_id):

return true

return false
Expand Down
16 changes: 8 additions & 8 deletions addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ func change_scene(room_path: String, enable_automatic_transitions: bool) -> void
escoria.logger.debug(
"Awaiting transition %s (out) to be finished." % transition_id
)

yield(escoria.main.scene_transition, "transition_done")

# Hide main and pause menus
escoria.game_scene.hide_main_menu()
escoria.game_scene.unpause_game()
Expand Down Expand Up @@ -229,7 +229,7 @@ func init_room(room: ESCRoom) -> void:
room,
true
)

if escoria.globals_manager.has(
escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
):
Expand Down Expand Up @@ -266,7 +266,7 @@ func _perform_script_events(room: ESCRoom) -> void:
# Used to track whether any yields have been executed before the call to
# set_scene_finish.
var yielded: bool = false

if room.enabled_automatic_transitions \
and not room.is_run_directly:
var script_transition_out = escoria.esc_compiler.compile([
Expand All @@ -293,17 +293,17 @@ func _perform_script_events(room: ESCRoom) -> void:
rc = yield(escoria.event_manager, "event_finished")
if rc[0] != ESCExecution.RC_OK:
return rc[0]

yielded = true

# Hide main and pause menus
escoria.game_scene.hide_main_menu()
escoria.game_scene.unpause_game()

var setup_event_added: bool = false
# Run the setup event, if there is one.
setup_event_added = _run_script_event(escoria.event_manager.EVENT_SETUP, room)

if setup_event_added:
# Wait for setup event to be done
var rc = yield(escoria.event_manager, "event_finished")
Expand Down Expand Up @@ -364,7 +364,7 @@ func _perform_script_events(room: ESCRoom) -> void:
rc = yield(escoria.event_manager, "event_finished")
if rc[0] != ESCExecution.RC_OK:
return rc[0]

# Now that :ready is finished, if FORCE_LAST_SCENE_NULL was true, reset it
# to false
if escoria.globals_manager.get_global( \
Expand Down
4 changes: 2 additions & 2 deletions addons/escoria-core/game/core-scripts/esc_item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ func _ready():
self.pause_mode = Node.PAUSE_MODE_STOP

_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.
add_to_group(GROUP_ITEM_CAN_COLLIDE)

Expand Down
2 changes: 1 addition & 1 deletion addons/escoria-core/game/core-scripts/log/esc_logger.gd
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func error(string: String, args = [], do_savegame: bool = true):

_log(message, true)
escoria.set_game_paused(true)

if is_instance_valid(escoria.main.current_scene):
escoria.main.current_scene.game.show_crash_popup(files_to_send)

Expand Down
Loading

0 comments on commit 431efd8

Please sign in to comment.