:setup action is not managed only once anymore (#358)
Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
@@ -9,10 +9,6 @@ extends ESCBaseCommand
|
||||
class_name ChangeSceneCommand
|
||||
|
||||
|
||||
# An array of scenes that have already been loaded
|
||||
var readied_scenes: Array = []
|
||||
|
||||
|
||||
# Return the descriptor of the arguments of this command
|
||||
func configure() -> ESCCommandArgumentDescriptor:
|
||||
return ESCCommandArgumentDescriptor.new(
|
||||
@@ -103,10 +99,8 @@ func run(command_params: Array) -> int:
|
||||
|
||||
escoria.main.scene_transition.fade_in()
|
||||
yield(escoria.main.scene_transition, "transition_done")
|
||||
|
||||
# If scene was never visited, add "ready" event to the events stack
|
||||
if not command_params[0] in self.readied_scenes \
|
||||
and script.events.has("ready"):
|
||||
|
||||
if script.events.has("ready"):
|
||||
escoria.event_manager.queue_event(script.events["ready"])
|
||||
var rc = yield(escoria.event_manager, "event_finished")
|
||||
while rc[1] != "ready":
|
||||
@@ -114,8 +108,6 @@ func run(command_params: Array) -> int:
|
||||
if rc[0] != ESCExecution.RC_OK:
|
||||
return rc[0]
|
||||
|
||||
self.readied_scenes.append(command_params[0])
|
||||
|
||||
# Clear queued resources
|
||||
escoria.resource_cache.clear()
|
||||
|
||||
|
||||
@@ -329,14 +329,14 @@ func set_angle(deg: int, immediate = true):
|
||||
func start_talking():
|
||||
if animation_sprite.is_playing():
|
||||
animation_sprite.stop()
|
||||
animation_sprite.play(animations.speaks[_movable.last_dir][0])
|
||||
animation_sprite.play(animations.speaks[_movable.last_dir].animation)
|
||||
|
||||
|
||||
# Stop playing the talking animation
|
||||
func stop_talking():
|
||||
if animation_sprite.is_playing():
|
||||
animation_sprite.stop()
|
||||
animation_sprite.play(animations.idles[_movable.last_dir][0])
|
||||
animation_sprite.play(animations.idles[_movable.last_dir].animation)
|
||||
|
||||
|
||||
# Detect the child nodes and set respective references
|
||||
|
||||
@@ -315,7 +315,7 @@ func _ev_left_click_on_item(obj, event, default_action = false):
|
||||
"arrived"
|
||||
)
|
||||
|
||||
self.logger.info("Context arrived: %s" % var2str(context))
|
||||
self.logger.info("Context arrived: %s" % context)
|
||||
|
||||
if context.target_object and \
|
||||
context.target_object.global_id != walk_context.\
|
||||
|
||||
@@ -146,7 +146,7 @@ func _on_mouse_double_left_click_inventory_item(
|
||||
# that is hovered
|
||||
func _on_mouse_entered_inventory_item(inventory_item_global_id: String) -> void:
|
||||
escoria.logger.info(
|
||||
"Inventory item focused " % inventory_item_global_id
|
||||
"Inventory item focused %s" % inventory_item_global_id
|
||||
)
|
||||
escoria.main.current_scene.game.inventory_item_focused(
|
||||
inventory_item_global_id
|
||||
|
||||
Reference in New Issue
Block a user