:setup action is not managed only once anymore (#358)

Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
Julian Murgia
2021-08-08 23:23:11 +02:00
committed by GitHub
parent cbb64df969
commit 61726bca81
20 changed files with 252 additions and 213 deletions

View File

@@ -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()

View File

@@ -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