Fixed bug where walk action initiated by ESC would never call finished().

Also removed call to inexisting function in ESCInventoryContainer.
This commit is contained in:
Julian Murgia
2021-01-28 13:32:14 +01:00
parent 14e85edba7
commit e6f4af74a8
51 changed files with 1515 additions and 35 deletions

View File

@@ -90,7 +90,7 @@ func _process(time):
current_animation = animation_to_play
escoria.report_warnings("movable.gd:_process()",
["Character " + parent.global_id + " has no animation " + animation_to_play,
"Bypassing missing animation and proceed movement."])
"Bypassing missing animation and proceed movement."], true)
pose_scale = parent.animations.directions[last_dir][1]
@@ -132,7 +132,6 @@ func walk_to(pos : Vector2, p_walk_context = null):
walk_context["fast"] = p_walk_context["fast"]
return true
else:
# return false
pass
if parent.task == parent.PLAYER_TASKS.NONE:
parent.task = parent.PLAYER_TASKS.WALK
@@ -197,6 +196,7 @@ func walk_stop(pos):
last_dir = orientation
parent.animation_sprite.play(parent.animations.idles[orientation][0])
pose_scale = parent.animations.idles[orientation][1]
else:
parent.animation_sprite.play(parent.animations.idles[last_dir][0])
pose_scale = parent.animations.idles[last_dir][1]
@@ -204,10 +204,11 @@ func walk_stop(pos):
if walk_context != null:
escoria.esc_level_runner.finished(walk_context)
# escoria.esc_level_runner.finished()
escoria.esc_level_runner.finished()
# walk_context = null
yield(parent.animation_sprite, "animation_finished")
printt(parent.global_id + " arrived at ", walk_context)
parent.emit_signal("arrived", walk_context)

View File

@@ -26,6 +26,10 @@ enum GAME_STATE {
}
onready var current_state = GAME_STATE.DEFAULT
# Logging
onready var is_reported : bool = false
##################################################################################
func _ready():
pass
@@ -46,14 +50,18 @@ func change_scene_path(scene_path):
func set_main_menu(scene):
main_menu_instance = scene
func report_warnings(p_path : String, warnings : Array) -> void:
var text = "Warnings in file "+p_path+"\n"
for w in warnings:
if w is Array:
text += str(w)+"\n"
else:
text += w+"\n"
printerr("warning is: ", text)
func report_warnings(p_path : String, warnings : Array, report_once = false) -> void:
if !is_reported:
var text = "Warnings in file "+p_path+"\n"
for w in warnings:
if w is Array:
text += str(w)+"\n"
else:
text += w+"\n"
printerr("warning is: ", text)
if report_once:
is_reported = true
func report_errors(p_path : String, errors : Array) -> void: