extends Control @onready var tool_slots = %ToolSlots @onready var game_menu_ui = %GameMenuUI @onready var world = %World func _on_message_timer_timeout(): %MessagesContainer.visible = false func _on_player_trigger_message(message): %MessagesContainer/MessageTextEdit.text = message %MessagesContainer/MessageTimer.start(1) %MessagesContainer.visible = true func _unhandled_key_input(event:InputEvent): var key_event:InputEventKey = event as InputEventKey if key_event and key_event.pressed and key_event.get_keycode_with_modifiers() == KEY_ESCAPE: if %GameMenuUI.visible: %GameMenuUI.hide() else: %GameMenuUI.show() func _on_game_menu_ui_visibility_changed(): # Function gets triggered when scene is still in construction. In that # case just return. if tool_slots == null: return if %GameMenuUI.visible: tool_slots.hide() %GameScene.process_mode = Node.PROCESS_MODE_DISABLED else: tool_slots.show() %GameScene.process_mode = Node.PROCESS_MODE_INHERIT