Skip to content

Commit

Permalink
fix: allows for transition to be disabled on init; still has issue w/…
Browse files Browse the repository at this point in the history
… UI showing up for fraction of a second
  • Loading branch information
BHSDuncan authored and StraToN committed Apr 30, 2022
1 parent 4c39e47 commit 6afff99
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions addons/escoria-ui-9verbs/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6afff99

Please sign in to comment.