Implement save overwrite confirmation (#368)
* Implement save overwrite confirmation + fixed pause game not pausing game execution. * docs: Automatic update of API docs Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
@@ -432,7 +432,7 @@ func set_angle(deg: int, immediate = true) -> void:
|
||||
|
||||
# Returns the angle that corresponds to the current direction of the object.
|
||||
func _get_angle() -> int:
|
||||
return parent.animations.dir_angles[last_dir].animation
|
||||
return parent.animations.dir_angles[last_dir].angle_start
|
||||
|
||||
|
||||
# Return the shortest way to turn from a direction to another. Returned way is
|
||||
|
||||
@@ -14,6 +14,10 @@ var events_queue: Array = []
|
||||
var scheduled_events: Array = []
|
||||
|
||||
|
||||
func _ready():
|
||||
self.pause_mode = Node.PAUSE_MODE_STOP
|
||||
|
||||
|
||||
# Handle the events queue and scheduled events
|
||||
func _process(delta: float) -> void:
|
||||
if events_queue.size() > 0:
|
||||
|
||||
@@ -40,7 +40,7 @@ func set_state(p_state: String, immediate: bool = false):
|
||||
if node.has_method("get_animation_player"):
|
||||
var animation_node: ESCAnimationPlayer = node.get_animation_player()
|
||||
|
||||
if animation_node:
|
||||
if animation_node.is_valid():
|
||||
animation_node.stop()
|
||||
var actual_animator
|
||||
if animation_node.has_animation(p_state):
|
||||
|
||||
@@ -137,3 +137,11 @@ func seek_end(name: String):
|
||||
# - name: Name of the animation played
|
||||
func _on_animation_finished(name: String):
|
||||
emit_signal("animation_finished", name)
|
||||
|
||||
|
||||
# Return true if the ESCAnimationPlayer node is valid, ie. it has a valid player
|
||||
# node.
|
||||
# **Returns: true if the ESCAnimationPlayer has a valid player node,
|
||||
# else false**
|
||||
func is_valid() -> bool:
|
||||
return _player_node != null and _player_node is Node
|
||||
|
||||
@@ -154,6 +154,7 @@ var _animation_player: ESCAnimationPlayer = null
|
||||
# Add the movable node, connect signals, detect child nodes
|
||||
# and register this item
|
||||
func _ready():
|
||||
self.pause_mode = Node.PAUSE_MODE_STOP
|
||||
|
||||
_detect_children()
|
||||
|
||||
@@ -214,7 +215,7 @@ func get_animation_player() -> Node:
|
||||
child is AnimationPlayer:
|
||||
player_node_path = child.get_path()
|
||||
if not has_node(player_node_path):
|
||||
escoria.logger.error(
|
||||
escoria.logger.warning(
|
||||
"Can not find node at path %s" % player_node_path
|
||||
)
|
||||
_animation_player = ESCAnimationPlayer.new(get_node(player_node_path))
|
||||
|
||||
@@ -169,6 +169,9 @@ func load_game(id: int):
|
||||
)
|
||||
|
||||
load_event.statements = load_statements
|
||||
|
||||
escoria.set_game_paused(false)
|
||||
|
||||
escoria.event_manager.queue_event(load_event)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user