Set a default implementation for ESCGame._on_event_done() (#486)

This commit is contained in:
Julian Murgia
2022-02-04 16:27:21 +01:00
committed by GitHub
parent caac5ef407
commit 353b349d1b
5 changed files with 93 additions and 39 deletions

View File

@@ -38,12 +38,6 @@ Implement methods to react to inputs.
"""
func _enter_tree():
escoria.action_manager.connect(
"action_finished",
self,
"_on_action_finished"
)
var room_selector_parent = $CanvasLayer/ui/HBoxContainer/VBoxContainer
if ProjectSettings.get_setting("escoria/debug/enable_room_selector") and \
@@ -55,13 +49,6 @@ func _enter_tree():
).instance()
)
func _exit_tree():
escoria.action_manager.disconnect(
"action_finished",
self,
"_on_action_finished"
)
func _input(event: InputEvent) -> void:
if escoria.main.current_scene and escoria.main.current_scene.game:
@@ -180,11 +167,6 @@ func hide_ui():
func show_ui():
$CanvasLayer/ui/HBoxContainer/inventory_ui.show()
func _on_event_done(event_name: String):
escoria.action_manager.clear_current_action()
$mouse_layer/verbs_menu.clear_tool_texture()
func hide_main_menu():
if get_node(main_menu).visible:
get_node(main_menu).hide()
@@ -259,6 +241,10 @@ func _on_action_finished():
$mouse_layer/verbs_menu.clear_tool_texture()
$mouse_layer/verbs_menu.iterate_actions_cursor(0)
func _on_event_done(_return_code: int, _event_name: String):
escoria.action_manager.clear_current_action()
$mouse_layer/verbs_menu.clear_tool_texture()
func _on_MenuButton_pressed() -> void:
pause_game()