chore: storing version and changelog
This commit is contained in:
@@ -50,14 +50,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.hide_main_menu()
|
||||
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:
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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":
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -129,7 +129,7 @@ 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():
|
||||
@@ -137,7 +137,7 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
||||
# 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(
|
||||
@@ -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,
|
||||
@@ -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(
|
||||
@@ -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
|
||||
|
||||
@@ -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."
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
@@ -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
|
||||
]
|
||||
)
|
||||
@@ -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]
|
||||
]
|
||||
)
|
||||
@@ -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)
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
@@ -229,7 +229,7 @@ func init_room(room: ESCRoom) -> void:
|
||||
room,
|
||||
true
|
||||
)
|
||||
|
||||
|
||||
if escoria.globals_manager.has(
|
||||
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
|
||||
# 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([
|
||||
@@ -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")
|
||||
@@ -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( \
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ func load_game(id: int):
|
||||
## GLOBALS
|
||||
for k in save_game.globals.keys():
|
||||
var global_value = save_game.globals[k]
|
||||
|
||||
|
||||
if global_value is String and global_value.empty():
|
||||
global_value = "''"
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ func _init():
|
||||
# Load settings
|
||||
func _ready():
|
||||
_handle_direct_scene_run()
|
||||
|
||||
|
||||
settings = save_manager.load_settings()
|
||||
apply_settings(settings)
|
||||
room_manager.register_reserved_globals()
|
||||
@@ -228,9 +228,9 @@ func set_game_paused(p_paused: bool):
|
||||
emit_signal("paused")
|
||||
else:
|
||||
emit_signal("resumed")
|
||||
|
||||
var scene_tree = get_tree()
|
||||
|
||||
var scene_tree = get_tree()
|
||||
|
||||
if is_instance_valid(scene_tree):
|
||||
scene_tree.paused = p_paused
|
||||
|
||||
@@ -368,11 +368,11 @@ func quit():
|
||||
# Handle anything necessary if the game started a scene directly.
|
||||
func _handle_direct_scene_run() -> void:
|
||||
var current_scene_root: Node = get_tree().get_current_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.
|
||||
return
|
||||
|
||||
|
||||
if current_scene_root is ESCRoom:
|
||||
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"])
|
||||
|
||||
previous_scene = current_scene
|
||||
|
||||
|
||||
if is_instance_valid(previous_scene):
|
||||
_disable_collisions()
|
||||
|
||||
@@ -52,14 +52,14 @@ func set_scene(p_scene: Node) -> void:
|
||||
p_scene.visible = false
|
||||
|
||||
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
|
||||
# coroutine, finish_current_scene_init() will already have been called
|
||||
# and so we don't want to risk repeating ourselves.
|
||||
if p_scene == current_scene:
|
||||
return
|
||||
|
||||
|
||||
# This actually moves the scene closest to the root node, but will
|
||||
# still be drawn behind the next node, which should be the previous
|
||||
# room.
|
||||
@@ -72,7 +72,7 @@ func set_scene(p_scene: Node) -> void:
|
||||
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().
|
||||
#
|
||||
# ### Parameters
|
||||
@@ -82,7 +82,7 @@ func finish_current_scene_init(p_scene: Node) -> void:
|
||||
move_child(p_scene, 0)
|
||||
|
||||
current_scene = p_scene
|
||||
|
||||
|
||||
check_game_scene_methods()
|
||||
|
||||
set_camera_limits()
|
||||
@@ -92,7 +92,7 @@ func finish_current_scene_init(p_scene: Node) -> void:
|
||||
# appropriate time.
|
||||
func set_scene_finish() -> void:
|
||||
current_scene.visible = true
|
||||
|
||||
|
||||
if previous_scene != null:
|
||||
clear_scene()
|
||||
|
||||
@@ -238,7 +238,7 @@ func check_game_scene_methods():
|
||||
func _is_same_scene(scene_1: Node, scene_2: Node) -> bool:
|
||||
if scene_1 is ESCRoom and scene_2 is ESCRoom:
|
||||
return scene_1.global_id == scene_2.global_id
|
||||
|
||||
|
||||
return false
|
||||
|
||||
|
||||
@@ -246,11 +246,11 @@ func _is_same_scene(scene_1: Node, scene_2: Node) -> bool:
|
||||
# game tree, collisions won't result.
|
||||
func _disable_collisions() -> void:
|
||||
var items_to_disable = previous_scene.get_tree().get_nodes_in_group(ESCItem.GROUP_ITEM_CAN_COLLIDE)
|
||||
|
||||
|
||||
for item in items_to_disable:
|
||||
if is_instance_valid(item.collision):
|
||||
item.collision.disabled = true
|
||||
if item is Area2D:
|
||||
item.monitoring = false
|
||||
item.monitorable = false
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ const TRANSITION_ID_INSTANT = -1
|
||||
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
|
||||
var transition_id: int = 0
|
||||
|
||||
@@ -60,7 +60,7 @@ func transition(
|
||||
mode: int = TRANSITION_MODE.IN,
|
||||
duration: float = 1.0
|
||||
) -> int:
|
||||
|
||||
|
||||
if transition_name.empty():
|
||||
transition_name = escoria.project_settings_manager.get_setting(
|
||||
escoria.project_settings_manager.DEFAULT_TRANSITION
|
||||
@@ -71,16 +71,16 @@ func transition(
|
||||
"transition: Transition %s not found" % transition_name,
|
||||
[]
|
||||
)
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
# that sets this scene's root (ColorRect) alpha to 0.
|
||||
if transition_name == TRANSITION_INSTANT:
|
||||
color.a = 0
|
||||
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))
|
||||
transition_id += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user