fix: allows for transition to be disabled on init; still has issue w/ UI showing up for fraction of a second

This commit is contained in:
Duncan Brown
2022-04-21 21:32:20 -04:00
committed by Julian Murgia
parent 4c39e47d38
commit 6afff99e7c
5 changed files with 15 additions and 10 deletions

View File

@@ -84,8 +84,6 @@ func do(action: int, params: Array = [], can_interrupt: bool = false) -> void:
if can_interrupt:
escoria.event_manager.interrupt_running_event()
self.clear_current_action()
var walk_fast = false
if params.size() > 2:
walk_fast = true if params[2] else false

View File

@@ -282,8 +282,8 @@ func _on_event_finished(finished_statement: ESCStatement, return_code: int, chan
escoria.save_manager.save_enabled = true
if return_code == ESCExecution.RC_CANCEL:
return_code = ESCExecution.RC_OK
return_code = ESCExecution.RC_OK
_running_events[channel_name] = null
_channels_state[channel_name] = true

View File

@@ -113,6 +113,7 @@ func change_scene(room_path: String, enable_automatic_transitions: bool) -> void
var game_parent = escoria.game_scene.get_parent()
game_parent.remove_child(escoria.game_scene)
#escoria.game_scene.hide_ui()
room_scene.add_child(escoria.game_scene)
room_scene.move_child(escoria.game_scene, 0)
room_scene.game = escoria.game_scene

View File

@@ -39,12 +39,9 @@ func _ready() -> void:
anchor_right = 1
anchor_bottom = 1
color = Color.white
color.a = 0
mouse_filter = MOUSE_FILTER_IGNORE
_tween = Tween.new()
add_child(_tween)
_tween.connect("tween_all_completed", self, "_on_tween_completed")
transition()
# Play a transition animation
@@ -61,6 +58,14 @@ func transition(
duration: float = 1.0
) -> int:
# We put this here instead of the constructor since if we have it in the
# constructor, the transition will ALWAYS happen on game start, which might
# not be desired if 'false' is used for automatic_transitions in a
# change_scene call in :init.
if not _tween.is_inside_tree():
add_child(_tween)
_tween.connect("tween_all_completed", self, "_on_tween_completed")
if transition_name.empty():
transition_name = escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANSITION

View File

@@ -347,8 +347,9 @@ func _on_action_finished() -> void:
tooltip.clear()
func _on_event_done(_return_code: int, _event_name: String):
escoria.action_manager.clear_current_action()
verbs_menu.unselect_actions()
if _return_code == ESCExecution.RC_OK:
escoria.action_manager.clear_current_action()
verbs_menu.unselect_actions()
func apply_custom_settings(custom_settings: Dictionary):